summaryrefslogtreecommitdiffstats
path: root/knetworkconf/knetworkconf/knetworkconfmodule.cpp
blob: 3f67b0ced4487653d15536febd1b2f40ae824108 (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
/***************************************************************************
                          knetworkconfmodule.cpp  -  description
                             -------------------
    begin                : Tue Apr 1 2003
    copyright            : (C) 2003 by Juan Luis Baptiste
    email                : juancho@linuxmail.org
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   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 <klocale.h>
#include <kcmodule.h>
#include <tqlayout.h> 
#include <version.h>
#include "knetworkconfmodule.h"



KNetworkConfModule::KNetworkConfModule(TQWidget* parent, const char *name/*, TQStringList list*/)
  : KCModule(parent,name)
{
  TQVBoxLayout *top = new TQVBoxLayout(this);
  
  conf = new KNetworkConf(this);
  conf->setVersion(TQString(VERSION));
  conf->setReadOnly(false);
  
  top->addWidget(conf);

  if (getuid() != 0){
    conf->setReadOnlySlot(true);
    conf->setReadOnly(true);
  }  

  connect(conf,TQT_SIGNAL(networkStateChanged(bool)),TQT_SLOT(configChanged(bool)));
  setButtons(KCModule::Apply|KCModule::Help); 
}

KNetworkConfModule::~KNetworkConfModule()
{
}

void KNetworkConfModule::configChanged(bool b)
{
  emit changed(b);
}

void KNetworkConfModule::load()
{
 // conf->loadNetworkDevicesInfo();
  //conf->loadRoutingAndDNSInfo();
  //conf->loadDNSInfoTab();
}

void KNetworkConfModule::save()
{
   conf->saveInfoSlot();
}
/*
int KNetworkConfModule::buttons()
{
  return KCModule::Ok|KCModule::Apply|KCModule::Help;
}
*/
bool KNetworkConfModule::useRootOnlyMsg() const
{
  return true;
}

TQString KNetworkConfModule::rootOnlyMsg() const
{
  return "Changing the network configuration requires root access";
}

KAboutData* KNetworkConfModule::aboutData() const
{
  /*KAboutData* data = new KAboutData( "knetworkconf", I18N_NOOP("KNetworkConf"),
    VERSION, description, KAboutData::License_GPL,
    "(c) 2003, Juan Luis Baptiste", 0, "http://www.merlinux.org/knetworkconf/", "jbaptiste@merlinux.org");
  data->addAuthor("Juan Luis Baptiste",I18N_NOOP("Lead Developer"),
                      "jbaptiste@merlinux.org");
  data->addCredit("David Sansome",I18N_NOOP("Various bugfixes and features"),
                      "me@davidsansome.com");

  return data; // Memory leak, oh well...*/
  
KAboutData *aboutData = new KAboutData( "knetworkconf", I18N_NOOP("KNetworkConf"),
    VERSION, description, KAboutData::License_GPL,
    "(c) 2003 - 2005, Juan Luis Baptiste", 0, "http://www.merlinux.org/knetworkconf/", "juan.baptiste@kdemail.net");
  aboutData->addAuthor("Juan Luis Baptiste",I18N_NOOP("Lead Developer"),
                      "juan.baptiste@kdemail.net");
  aboutData->addCredit("Carlos Garnacho and the Gnome System Tools Team",I18N_NOOP("Provided the Network backend which KNetworkConf relies on."),
                      "garnacho@tuxerver.net","http://www.gnome.org/projects/gst/");
  aboutData->addCredit("Helio Chissini de Castro",I18N_NOOP("Conectiva Linux Support"),
                      "helio@conectiva.com.br");
  aboutData->addCredit("Christoph Eckert",I18N_NOOP("Documentation maintainer, and German translator"),
                      "mchristoph.eckert@t-online.de ");  
  aboutData->addCredit("David Sansome",I18N_NOOP("Various bugfixes and features"),
                      "me@davidsansome.com");                      
  aboutData->addCredit("Gustavo Pichorim Boiko",I18N_NOOP("Various bugfixes and Brazilian Portuguese translator"),"gustavo.boiko@kdemail.net");
  return aboutData;// Memory leak, oh well...                      
}

TQString KNetworkConfModule::quickHelp() const
{
  return i18n("%1Network configuration%2This module allows you to configure your TCP/IP settings.%3").arg("<h1>").arg("</h1><p>").arg("</p>");
}

//#include "knetworkconfmodule.moc"

#include "knetworkconfmodule.moc"