summaryrefslogtreecommitdiffstats
path: root/src/newstuff/dialog.h
blob: 082fbd8ef705041eef40910f72b0713df555f00f (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
/***************************************************************************
    copyright            : (C) 2006 by Robby Stephenson
    email                : robby@periapsis.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of version 2 of the GNU General Public License as  *
 *   published by the Free Software Foundation;                            *
 *                                                                         *
 ***************************************************************************/

#ifndef TELLICO_NEWSTUFF_DIALOG_H
#define TELLICO_NEWSTUFF_DIALOG_H

#include "manager.h"

#include <kdialogbase.h>

class KPushButton;
class KStatusBar;
namespace TDEIO {
  class Job;
}
namespace KNS {
  class Entry;
  class Provider;
}

class TQProgressBar;
class TQSplitter;
class TQLabel;
class TQTextEdit;

namespace Tellico {
  namespace GUI {
    class ListView;
    class CursorSaver;
  }

  namespace NewStuff {

class Dialog : public KDialogBase {
Q_OBJECT
  

public:
  Dialog(DataType type, TQWidget* parent);
  virtual ~Dialog();

  TQPtrList<DataSourceInfo> dataSourceInfo() const { return m_manager->dataSourceInfo(); }

private slots:
  void slotProviders(TQPtrList<KNS::Provider>* list);
  void slotData(TDEIO::Job* job, const TQByteArray& data);
  void slotResult(TDEIO::Job* job);
  void slotPreviewResult(TDEIO::Job* job);

  void slotShowPercent(TDEIO::Job* job, unsigned long percent);

  void slotSelected(TQListViewItem* item);
  void slotInstall();
  void slotDoneInstall(KNS::Entry* entry);

  void slotProviderError();
  void slotMoveProgress();

private:
  class Item;

  void setStatus(const TQString& status);
  void addEntry(KNS::Entry* entry);

  Manager* const m_manager;
  DataType m_type;
  TQString m_lang;
  TQString m_typeName;

  TQSplitter* m_split;
  GUI::ListView* m_listView;
  TQLabel* m_iconLabel;
  TQLabel* m_nameLabel;
  TQLabel* m_infoLabel;
  TQTextEdit* m_descLabel;
  KPushButton* m_install;
  KStatusBar* m_statusBar;
  TQProgressBar* m_progress;
  TQTimer* m_timer;
  GUI::CursorSaver* m_cursorSaver;
  KTempFile* m_tempPreviewImage;

  TQMap<TDEIO::Job*, KNS::Provider*> m_jobs;
  TQMap<TDEIO::Job*, TQByteArray> m_data;

  TQMap<TQListViewItem*, KNS::Entry*> m_entryMap;
  TQListViewItem* m_lastPreviewItem;
};

  }
}
#endif