summaryrefslogtreecommitdiffstats
path: root/kbugbuster/gui/packageselectdialog.h
blob: 1fe596aa64d8d10a0dc14abf5e063d338e08ca08 (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
#ifndef PACKAGESELECTDIALOG_H
#define PACKAGESELECTDIALOG_H

#include <qdict.h>

#include <kdialogbase.h>

#include "package.h"

class KCompletion;
class KLineEdit;

class PackageListView : public QListView
{
    Q_OBJECT
  public:
    PackageListView( QWidget *parent );

    void resetTyped();

  signals:
    void typed( const QString & );

  protected:
    void keyPressEvent( QKeyEvent *e );
    
  private:
    QString mTyped;
};

class PackageSelectDialog : public KDialogBase
{
    Q_OBJECT
  public:
    PackageSelectDialog(QWidget *parent=0,const char *name=0);
    ~PackageSelectDialog();

    void setRecentPackages( const QStringList & );
    void setPackages( const Package::List &pkgs );

    Package selectedPackage();
    QString selectedComponent();

  protected slots:
    void slotOk();

  private slots:
    void recentSelected( int, QListViewItem * );
    void completeSelected( int, QListViewItem * );
    void completeTyped( const QString & );

  private:
    Package::List mPackages;
    Package mSelectedPackage;
    QString mSelectedComponent;
    
    QListView *mRecentList;
    PackageListView *mCompleteList;
    KLineEdit *mPackageEdit;
    KCompletion *mCompletion;
    QDict<QListViewItem> mCompletionDict;
};

#endif