summaryrefslogtreecommitdiffstats
path: root/kbugbuster/gui/centralwidget.h
blob: 187277bbd0de0d0eb5537b1e06c15c44e5d8ce52 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
/*
    centralwidget.h  -  Central widget for the KBB main window

    copyright   : (c) 2001 by Martijn Klingens
    email       : [email protected]

    *************************************************************************
    *                                                                       *
    * This program is free software; you can redistribute it and/or modify  *
    * it under the terms of the GNU General Public License as published by  *
    * the Free Software Foundation; either version 2 of the License, or     *
    * (at your option) any later version.                                   *
    *                                                                       *
    *************************************************************************
*/

#ifndef KBBMAINWINDOW_CENTRALWIDGET_H
#define KBBMAINWINDOW_CENTRALWIDGET_H

#include <tqwidget.h>

#include "package.h"
#include "bug.h"
#include "bugdetails.h"

class TQSplitter;
class TQListViewItem;

namespace KBugBusterMainWindow
{

class CWSearchWidget;
class CWBugListContainer;
class CWBugDetailsContainer;
class CWBugDetails;

/**
 * @author Martijn Klingens
 */
class CentralWidget : public TQWidget
{
    Q_OBJECT
  

public:
    CentralWidget( const TQCString &initialPackage,
                   const TQCString &initalComponent,const TQCString& initialBug,
                   TQWidget* parent = 0, const char* name = 0 );
    ~CentralWidget();

    void initialize( const TQString &initialPackage = TQString(),
                     const TQString &initalComponent = TQString(),
                     const TQString &initialBug = TQString() );
 
    void readConfig();
    void writeConfig();

    void searchBugByTitle( int options, const TQString& pattern );

    virtual TQString currentNumber() const;
    virtual TQString currentTitle() const;

    void updatePackage();

    CWBugDetails *bugDetailsWidget();

public slots:
    void slotRetrieveBugList( const TQString &package, const TQString &component );
    void slotRetrieveBugList( const TQString &package );
    void slotRetrieveBugDetails( const Bug & );
    void slotSetActiveBug( const Bug & );
    void slotRetrieveAllBugDetails();

    void updatePackageList( const Package::List &pkgs );
    void updateBugList( const Package &pkg, const TQString &component, const Bug::List &bugs );
    void updateBugList( const TQString &label, const Bug::List &bugs );
    void updateBugDetails( const Bug &, const BugDetails & );

    void slotReloadPackageList();
    void slotReloadPackage();
    void slotReloadBug();
    void slotExtractAttachments();

    /**
     * Load the bugs the user reported himself, or for which he is the assigned to person
     */
    void slotLoadMyBugs();

    void mergeBugs();
    void unmergeBugs();

    void closeBug();
    void closeBugSilently();
    void reopenBug();
    void titleBug();
    void severityBug();
    void replyBug();
    void replyPrivateBug();
    void reassignBug();

    void clearCommand();

signals:
    void resetProgressBar();
    void searchPackage(); // when clicking on the initial package widget
    void searchBugNumber(); // when clicking on the initial bug-details widget

protected slots:
    void showLoadingError( const TQString & );

private:
    CWSearchWidget        *m_searchPane;
    CWBugListContainer    *m_listPane;
    CWBugDetailsContainer *m_bugPane;

    TQSplitter *m_vertSplitter;
    TQSplitter *m_horSplitter;

    /**
     * Other status info
     */
    Package m_currentPackage;
    TQString m_currentComponent;
    Bug     m_currentBug;

    TQMap<TQString, Package> m_packageList;

    /**
     * We do multi-select, but the close/reopen buttons are per-item and
     * on highlight instead of on execute! Hence this different member
     */
    Bug m_activeBug;

    // For "load all bugs"
    bool m_bLoadingAllBugs;
};

}   // namespace

#endif // KBBMAINWINDOW_CENTRALWIGET_H