summaryrefslogtreecommitdiffstats
path: root/kbugbuster/gui/kbbmainwindow.h
blob: 8a475dab4b231c20b010bbbd60ab45f8b146cf46 (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
141
142
/*
    kbbmainwindow.h - KBugBuster's main window

    Copyright (c) 2001-2004 by Martijn Klingens      <klingens@kde.org>

    *************************************************************************
    *                                                                       *
    * 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_H
#define KBBMAINWINDOW_H

#include <tdeapplication.h>
#include <kbookmarkmanager.h>
#include <tdemainwindow.h>
#include <tqmap.h>

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

class TDEAction;
class TDEActionMenu;
class KBookmarkMenu;
class TDEToggleAction;
class TDESelectAction;
class TQLabel;
class TQListViewItem;
class TQProgressBar;
class PreferencesDialog;
class TextViewer;
class PackageSelectDialog;

namespace KBugBusterMainWindow
{
    class CentralWidget;
}

/**
 * @author Martijn Klingens
 */
class KBBMainWindow : public TDEMainWindow, virtual public KBookmarkOwner
{
    TQ_OBJECT
  
  public:
    /**
     * construtor of KBugBusterApp, calls all init functions to create the application.
     */
    KBBMainWindow( const TQCString &initialPackage = "",
                   const TQCString &initialCpomponent = "",
                   const TQCString &initialBug = "",
                   TQWidget* parent = 0, const char* name = 0 );
    ~KBBMainWindow();

    /// Overloaded functions of KBookmarkOwner
    virtual void openBookmarkURL( const TQString & _url );
    virtual TQString currentTitle() const;
    virtual TQString currentURL() const;

  public slots:
    /**
     * Event handlers for our TDEActions
     */
    void slotStatusMsg( const TQString &text );
    void slotDisconnectedAction();
    void slotSubmit();
    void slotListChanges();
    void slotSetPercent( unsigned long percent );
    void slotSelectServer();

    void showLastResponse();
    void showBugSource();

    void clearCache();

    /**
     * Other event handlers
     */

    void searchPackage();
    void searchBugNumber();
    void searchDescription();

    void preferences();
    void updatePackage();
    void slotToggleDone();
    void slotToggleWishes();

  protected:
    virtual bool queryClose();

  protected slots:
    void setupSelectServerAction();
    void slotToggleMenubar();

  private:
    void initActions();

    /**
     * Our main widget
     */
    KBugBusterMainWindow::CentralWidget *m_mainWidget;

    /**
     * Used TDEActions
     */
    TDEAction *fileQuit;
    TDEAction *reloadpacklist;
    TDEAction *reloadpack;
    TDEAction *reloadbug;
    TDEAction *reloadall;
    TDEAction *loadMyBugs;
    TDEToggleAction *m_disconnectedAction;

    /**
     * Status bar label. We need this, because the default TQt version doesn't
     * support rich text in the messages
     */
    TQLabel *m_statusLabel;
    TQProgressBar *m_progressBar;

    PreferencesDialog *mPreferencesDialog;

    TDEActionMenu *m_pamBookmarks;
    KBookmarkMenu* m_pBookmarkMenu;

    TDESelectAction *mSelectServerAction;

    TextViewer *mResponseViewer;
    TextViewer *mBugSourceViewer;

    PackageSelectDialog *mPackageSelectDialog;
};

#endif