summaryrefslogtreecommitdiffstats
path: root/adept/adept/dpkgpm-gui.h
blob: 03f509217b70522ec24fc0750ffb6f2c98a2495b (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
/** -*- C++ -*-
	@file adept/dpkgpm-gui.h
	@author Peter Rockai <me@mornfall.net>
*/

#ifndef EPT_DPKGPM_H
#  define EPT_DPKGPM_H

#include <apt-pkg/debsystem.h>
#include <adept/dpkgpm.h>
#include <kde_terminal_interface.h>
#include <kprocess.h>
#include <kdialogbase.h>

class KListBox;
namespace KParts {
class Part;
}

namespace adept {

class PkgSystem : public TQObject, public debSystem
{
    Q_OBJECT
  
public:
    PkgSystem ();
    virtual pkgPackageManager *CreatePM( pkgDepCache *Cache ) const;
    virtual void setTerminal( KParts::Part *t );
    KParts::Part *terminal() { return m_terminalPart; }
    virtual int Score( Configuration const &Cnf ) {
        return debSystem::Score (Cnf) + 2; };
protected:
    KParts::Part *m_terminalPart;
signals:
    void statusChanged( int p, TQString m );
};

class DPkgPM : public TQObject, public aptFront::DPkgPM
{
    Q_OBJECT
  
public:
    DPkgPM (pkgDepCache *c, KParts::Part *t);
    virtual bool forkDpkg (char *const argv[]);
    virtual void dpkgMonitor (void);
    virtual bool Go (int);
    virtual bool forkScript (const char *, bool);
    ExtTerminalInterface *terminal();
    virtual void updateStatus( std::string pkg, std::string ev, std::string r );
 
public slots:
    void processExitC(const TDEProcess *p);
    void processExit(TDEProcess *p);
    void setupScriptPipe();
    void setupDpkgChild();

signals:
    void statusChanged( int p, TQString m );

protected:
    KParts::Part *m_terminalPart;
    // DPkgProgress *m_prog;
            bool m_processRunning:1;
    const TDEProcess *m_exitedProcess;
};

}

#endif