summaryrefslogtreecommitdiffstats
path: root/adept/updater/app.h
blob: 2935e2fd6e74f29f7e88cd5bdf11a5c4f57bfb2c (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
/* -*- C++ -*- */
#ifndef TESTUI_APP_H
#define TESTUI_APP_H

#include <kmainwindow.h>
#include <tdeparts/part.h>
#include <kactionclasses.h>
#include <apt-front/cache/observer.h>
#include <apt-front/cache/component/state.h>
#include <apt-front/cache/component/history.h>
#include <adept/view.h>
#include <adept/commitprogress.h>
#include <adept/application.h>

class TQVBox;
class TQWidgetStack;
class TQSplitter;
class KAction;
class KPushButton;
namespace adept {
class AcqProgressWidget;
}

using namespace aptFront;
using namespace adept;

class TestApp : public KMainWindow, Application {
    Q_OBJECT
  
public:
    void setupActions();
    ExtTerminalInterface *terminal();
	TestApp();
protected slots:
    void start();
    void update();
    void postUpdate();
    void commit();

    void delayed();

    void undo() { Application::undo(); }
    void redo() { Application::redo(); }
    void checkpoint() { Application::checkpoint(); }

    void setHistoryEnabled( bool );

    void disableNext();
    void disableButtons();
    void setNext( TQString str, const char *slot,
                  TQString qstr = i18n( "Forget Changes and Quit" ),
                  const char *qslot = TQT_SLOT( close() ) );
protected:
    friend class WaitForLister;

    virtual void notifyPostChange( cache::component::Base * );
    virtual void notifyPreChange( cache::component::Base * );

    TQWidgetStack *m_stack;
    TQVBox *m_all;
    TQHBox *m_buttons;
    TQLabel *m_start, *m_bye, *m_loading;
    KPushButton *m_next, *m_quit;

    // stacked widgets
    adept::AcqProgressWidget *m_progress;
    adept::CommitProgress *m_commitProgress;
    adept::Browser *m_list;

    // other stuff
    std::vector<KAction *> m_actions;
    TQMap< TQString, TQString > m_icons;
    KAction *m_undo, *m_redo;
    cache::component::History< cache::component::State > *m_history;
};

class WaitForLister : public TQObject {
    Q_OBJECT
  
public:
    WaitForLister( TestApp *a, const char *s )
        : app( a ), slot( s )
        {
            waiting();
        }
protected slots:
    void waiting();
protected:
    TestApp *app;
    const char *slot;

};

#endif