summaryrefslogtreecommitdiffstats
path: root/wifi/locator.cpp
blob: 859b7d7301472d6d2d4357de441fc02d8f5624b2 (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
/***************************************************************************
                          locator.cpp  -  description
                             -------------------
    begin                : Mon Aug 19 2002
    copyright            : (C) 2002 by Stefan Winter
    email                : mail@stefan-winter.de
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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.                                   *
 *                                                                         *
 ***************************************************************************/

#include <tqpainter.h>
#include "locator.h"
#include "interface_wireless.h"

extern TQStringList APs;

Locator::Locator (TQWidget * tqparent, Interface_wireless * device):TQWidget (tqparent,
	 "KwiFiManager")
{
  this->device = device;
}

void
Locator::generateLocWidget ()
{
  TQString mac, ip;
  device->get_AP_info (mac, ip);
  sentence =
    new TQLabel (i18n ("AccessPoint: ") + whois (mac.local8Bit (), APs), this);
  setFixedSize (TQSize
		(sentence->tqsizeHint ().width () + 2,
		 sentence->tqsizeHint ().height ()));
  sentence->
    setFixedSize (TQSize
		  (sentence->tqsizeHint ().width () + 2,
		   sentence->tqsizeHint ().height ()));
  sentence->show ();
  widgetbild = TQPixmap::grabWidget (sentence);
  delete sentence;
}

void
Locator::paintEvent (TQPaintEvent *)
{
  TQPainter *locatorpainter = new TQPainter (this);
  generateLocWidget ();
  locatorpainter->drawPixmap (0, 0, widgetbild);
  delete locatorpainter;
}