summaryrefslogtreecommitdiffstats
path: root/wifi/kwireless/kwireless.cpp
blob: 8e4944d61cf804516989013c177ffd19a00d0716 (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
/*
  $ Author: Mirko Boehm $
  $ License: This code is licensed under the LGPL $
  $ Copyright: (C) 1996-2003, Mirko Boehm $
  $ Contact: Mirko Boehm <[email protected]>
         http://www.kde.org
         http://www.hackerbuero.org $
*/

#include <kglobal.h>
#include <klocale.h>
#include <kconfig.h>
#include <kapplication.h>
#include <kmessagebox.h>

#include "kwireless.h"
#include "kwirelesswidget.h"


KWireLess::KWireLess(const TQString& configFile, Type type,
                     int actions, TQWidget *parent, const char *name)
    : KPanelApplet(configFile, type, actions, parent, name)
{
    ksConfig = config();

    widget = KWireLessWidget::makeWireLessWidget(this);
    widget->show();
}


KWireLess::~KWireLess()
{
}


void KWireLess::about()
{
    KMessageBox::information
        (0,
         i18n("<qt><b>KWireLess</b><br>"
              "Displays information about wireless network devices.<br />"
              "KWireLess is licensed to you under the terms of the GPL.<br />"
              "<i>(C) 2003 Mirko Boehm</i></qt>"),
         i18n("About KWireLess"));
}


void KWireLess::help()
{
//    KMessageBox::information(0, i18n("This is a help box"));
}


void KWireLess::preferences()
{
//    KMessageBox::information(0, i18n("This is a preferences box"));
}

int KWireLess::widthForHeight(int) const
{
    widget->setMode(KWireLessWidget::Vertical);
    return widget->preferredWidth();
}

int KWireLess::heightForWidth(int) const
{
    widget->setMode(KWireLessWidget::Horizontal);
    return widget->preferredHeight();
}

void KWireLess::resizeEvent(TQResizeEvent *)
{
    widget->setGeometry(0, 0, width(), height());
}


extern "C"
{
    KDE_EXPORT KPanelApplet* init( TQWidget *parent, const TQString configFile)
    {
        TDEGlobal::locale()->insertCatalogue("kwireless");
        return new KWireLess(configFile, KPanelApplet::Normal,
                             KPanelApplet::About,
                             // | KPanelApplet::Help | KPanelApplet::Preferences,
                             parent, "kwireless");
    }
}

#include "kwireless.moc"