~ubuntu-branches/ubuntu/utopic/knutclient/utopic

« back to all changes in this revision

Viewing changes to src/knutprintupsvar.h

  • Committer: Bazaar Package Importer
  • Author(s): Arnaud Quette
  • Date: 2008-06-19 11:09:50 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20080619110950-izi2q2vd0dhwlpym
Tags: 0.9.4-1
* New upstream release
* Merge back Ubuntu changes
* debian/knutclient.menu: update section to fix lintian warnings
* debian/watch: update the pattern for matching new releases (Closes: #471247)
* debian/control:
  - move Homepage to the field and update the URL
  - update Standards-Version to 3.8.0
  - update debhelper Build-Depends to 5.0.51
  - add automake and autoconf to Build-Depends
  - update NUT URL
* debian/rules:
  - fix lintian warning debian-rules-ignores-make-clean-error
  - add a commented call to dh_icons

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
                          knutprintupsvar.h  -  description
 
3
                             -------------------
 
4
    begin                : St cec 3 2002
 
5
    copyright            : (C) 2002 by Daniel Prynych
 
6
    email                : Daniel.Prynych@alo.cz
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *                                                                         *
 
11
 *   This program is free software; you can redistribute it and/or modify  *
 
12
 *   it under the terms of the GNU General Public License as published by  *
 
13
 *   the Free Software Foundation; either version 2 of the License, or     *
 
14
 *   (at your option) any later version.                                   *
 
15
 *                                                                         *
 
16
 ***************************************************************************/
 
17
 
 
18
#ifndef KNUTPRINTUPSVAR_H
 
19
#define KNUTPRINTUPSVAR_H
 
20
 
 
21
//Od verze 3 je kapp jen odkaz na kapplication
 
22
//#include <kapplication.h>
 
23
#include <kapp.h>
 
24
#include "knutupsdata.h"
 
25
#include "knutnet.h"
 
26
 
 
27
#include <kdialogbase.h>
 
28
#include <kcombobox.h>
 
29
#include <kpushbutton.h>
 
30
#include <klistview.h>
 
31
 
 
32
 
 
33
#include <qvariant.h>
 
34
#include <qlayout.h>
 
35
#include <qvaluelist.h>
 
36
 
 
37
 
 
38
#include <qvaluevector.h>
 
39
 
 
40
class QLabel;
 
41
class QPixmap;
 
42
class QFramel;
 
43
class QString;
 
44
 
 
45
/**
 
46
  *@author Daniel Prynych
 
47
  */
 
48
 
 
49
/**
 
50
 * Tato trida zajistuje zobrazeni vsech promenych,
 
51
 * ktere podporuje prislusny ovladac/driver/model (ovladac) NUTu
 
52
 * pro urcenou UPS-ku
 
53
 * @author Daniel Prynych
 
54
 * @short NUT show UPS vars
 
55
 * @version 0.3.2
 
56
*/
 
57
class KNutPrintUpsVar : public KDialogBase  {
 
58
 
 
59
    Q_OBJECT
 
60
 
 
61
public:
 
62
/**
 
63
 * Constructor - makes window, reads values of variables
 
64
 * and will write names and values of variables
 
65
 * Konstruktor - vytvori okno, nacte hodnoty promennych,
 
66
 * a vypise jmena a hodnoty promenych.
 
67
 * @param upsnet Je odkaz na instanci KNutNet - obsahuje hodnoty promennych systemu NUT.
 
68
 * @param useDescription Urcuje zda pouzit pro promenne a prikazy taky popis.
 
69
 * pokud data o UPS-kach neexistuji vraci funkce upsOk vzdy false.
 
70
 *
 
71
 * since 0.3.1
 
72
 **/
 
73
  KNutPrintUpsVar(KNutNet* const upsNet, const bool useDescription, QWidget* parent = 0, const char* name = 0, const bool modal = true);
 
74
 
 
75
/**
 
76
 * @since  0.1
 
77
 **/
 
78
  ~KNutPrintUpsVar();
 
79
 
 
80
 
 
81
  
 
82
 
 
83
/**
 
84
 * Vrati zda se povedlo pripojit na server NUT-u a nacist udaje.
 
85
 *
 
86
 * @since  0.1
 
87
 **/
 
88
  bool upsOk (void);
 
89
 
 
90
 
 
91
protected:
 
92
 
 
93
/****** protected vars ************/
 
94
 
 
95
  int countVars;
 
96
  int countIComms;
 
97
  int countRWVars;
 
98
 
 
99
  KNutNet* myUpsNet;
 
100
 
 
101
  KPushButton* reloadButton;
 
102
 
 
103
  struct dataVar {
 
104
    QString myName;
 
105
    KListViewItem* myValue;
 
106
    };
 
107
  QValueVector<dataVar> dataList;
 
108
  KListViewItem* ROVarsList;
 
109
  KListViewItem* RWVarsList;
 
110
  KListViewItem* ICommList;
 
111
 
 
112
  QFrame *page;
 
113
  KListView* table;
 
114
 
 
115
  QPixmap dirPixmap;
 
116
  
 
117
 
 
118
  bool upsConnectOk;
 
119
 
 
120
/********** protected functions ****************/
 
121
  
 
122
/**
 
123
 * @internal
 
124
 * adds name into part of tree
 
125
 * Prida jmeno do casti stromu.
 
126
 * @param table is top of tree's part
 
127
 * @param varName is text which is addes into tree on the first column
 
128
 * @param varName is text which is addes into tree on the second column
 
129
 * @param table je vrchol casti stromu.
 
130
 * @param varName je text ktere se prida do stromu na prvni sloupec.
 
131
 * @param value je text ktere se prida do stromu na druhy sloupec.
 
132
 *
 
133
 * @since  0.2.1
 
134
 **/
 
135
    KListViewItem* addListItem (KListViewItem* table, QString varName, QString value);
 
136
 
 
137
/**
 
138
 * @internal
 
139
 * Zjisti existenci jmena ve vetvi stromu
 
140
 *
 
141
 * listItem je vrcholovy prvek vetve.
 
142
 * @param name je jmeno ktere se hleda ve strome.
 
143
 *
 
144
 * @since  0.2
 
145
 **/
 
146
    KListViewItem* existListItem (KListViewItem* listItem, QString name);
 
147
  
 
148
protected slots:
 
149
 
 
150
/**
 
151
 * @internal
 
152
 * Nacte a prepise hodnoty promenych
 
153
 *
 
154
 * @since  0.3
 
155
 **/
 
156
  void slotReloadVars (void);
 
157
 
 
158
};
 
159
 
 
160
#endif