summaryrefslogtreecommitdiffstats
path: root/kpackage/options.h
blob: 375c0c178f8f29a4435a7a63417efea22a202f91 (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
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
/*
** Copyright (C) 1999,2000 Toivo Pedaste <[email protected]>
**
*/

/*
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program in a file called COPYING; if not, write to
** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
** MA 02110-1301, USA.
*/

/*
** Bug reports and questions can be sent to [email protected]
*/



#ifndef OPTIONS_H
#define OPTIONS_H

#include "../config.h"

// Standard Headers
#include <stdio.h>

// TQt Headers
#include <tqdir.h>
#include <tqwidget.h>
#include <tqfiledialog.h>
#include <tqgroupbox.h>

// KDE headers
#include <tdeapplication.h>
#include <tdefiledialog.h>

#include <kpackage.h>

class KURLRequester;


class TQVBoxLayout;
class TQGroupBox;
class TQCheckBox;
class TQPushButton;
class KComboBox;
class TQButtonGroup;
class TQRadioButton;

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
class Options : public KDialogBase
{
  Q_OBJECT
  

public:

  Options ( TQWidget *parent = 0);
  ~Options();

  void restore();
  // show window, setting the buttons

  void setValues();
  // set the dialog to match options values

private:

  bool verifyFL;
  bool PkgRead;
  bool fRemote;
  int  DCache, dc, PCache, pc, privCmd, prc;
  TQString CacheDir;

  TQVBoxLayout* vl;

  TQVBoxLayout* vt;
  TQGroupBox *framet;
  TQGroupBox *packageBox[kpinterfaceN];
  TQCheckBox *packageHandle[kpinterfaceN];
  TQPushButton *locate[kpinterfaceN];

  TQGroupBox *hh;
  TQCheckBox *huse;
  KComboBox *hosts;

  TQVBoxLayout* vb;
  TQButtonGroup *bg;
  TQRadioButton *disp[4];

  TQVBoxLayout*  vc;
  TQButtonGroup *bc;
  TQRadioButton *dcache[3];

  TQVBoxLayout*  vp;
  TQButtonGroup *bp;
  TQRadioButton *pcache[3];

  TQVBoxLayout*  vs;
  TQButtonGroup *bs;
  TQRadioButton *privs[3];
  
  KURLRequester *cachedir;

  TQVBoxLayout* vr;
  TQGroupBox *framer;
  TQCheckBox *pkgRead;

  TQVBoxLayout* vf;
  TQGroupBox *framem;
  TQCheckBox *valid;


public slots:
    void scanLocates();
    void apply_slot();
    void cancel_slot();
    void PDCache(int);
    void PPCache(int);
    void PPrivs(int);
  
private slots:
    void insHosts();
    void useRemote();
};

//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////

class Opts
{
public:
  void readSettings(const TQString &initHost = "");
  void writeSettings();

  void readLaterSettings();
  // options to be setup after package interfaces setup

  TQStringList hostList;
  // list of hosts to choose from

  bool VerifyFL;
  // config: verify the file list

  bool PkgRead;
  // read information about uninstalled packages from each RPM file itself

  bool handlePackage[kpinterfaceN];

  enum {INSTALLED, UPDATED, NEW, ALL};
  enum {ALWAYS, SESSION, NEVER};

  int DCache;
  // how much to cache uninstall package directories

  int PCache;
  // how much to cache uninstall packages
  
  int privCmd;
  // which command to use to execute priveliged commands
  enum {SUcmd=0, SUDOcmd=1, SSHcmd=2};

  TQString CacheDir;
  // cache directory

  Opts(const TQString &initHost);
  ~Opts();
};
//////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////
#endif