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

#include <tqdict.h>

#include <kdialogbase.h>

#include "package.h"

class TDECompletion;
class KLineEdit;

class PackageListView : public TQListView
{
    TQ_OBJECT
  
  public:
    PackageListView( TQWidget *parent );

    void resetTyped();

  signals:
    void typed( const TQString & );

  protected:
    void keyPressEvent( TQKeyEvent *e );
    
  private:
    TQString mTyped;
};

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

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

    Package selectedPackage();
    TQString selectedComponent();

  protected slots:
    void slotOk();

  private slots:
    void recentSelected( int, TQListViewItem * );
    void completeSelected( int, TQListViewItem * );
    void completeTyped( const TQString & );

  private:
    Package::List mPackages;
    Package mSelectedPackage;
    TQString mSelectedComponent;
    
    TQListView *mRecentList;
    PackageListView *mCompleteList;
    KLineEdit *mPackageEdit;
    TDECompletion *mCompletion;
    TQDict<TQListViewItem> mCompletionDict;
};

#endif