summaryrefslogtreecommitdiffstats
path: root/knetworkconf/knetworkconf/kadddnsserverdlg.ui.h
blob: 3eba8a6e30fcafe99b122cbae0e6ba9167fa6a8c (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
/****************************************************************************
** ui.h extension file, included from the uic-generated form implementation.
**
** If you wish to add, delete or rename functions or slots use
** TQt Designer which will update this file, preserving your code. Create an
** init() function in place of a constructor, and a destroy() function in
** place of a destructor.
*****************************************************************************/
#include "kaddressvalidator.h"
#include <tdemessagebox.h>

bool _modified2;
bool addingAlias;

void KAddDNSServerDlg::setAddingAlias(bool add)
{
  addingAlias = add;
}

bool KAddDNSServerDlg::modified()
{
   return _modified2;   
}    
void KAddDNSServerDlg::init()
{
   _modified2 = false; 
   addingAlias = false;
   makeButtonsResizeable();    
}    

void KAddDNSServerDlg::validateAddressSlot()
{
  if (!addingAlias)
  {
    if (KAddressValidator::isValidIPAddress(kleNewServer->text()))
    {   
       _modified2 = true; 
      close();
    }
    else
    {
      KMessageBox::error(this,i18n("The format of the specified IP address is not valid."),i18n("Invalid IP Address"));
    }  
  }
  else 
  {
    if (kleNewServer->text() !="")
    {
       _modified2 = true; 
       close();  
    }
    else
    {
       KMessageBox::error(this,i18n("You have to type an alias first."),i18n("Invalid Text"));
    }
  }  
}


void KAddDNSServerDlg::makeButtonsResizeable()
{
  kpbAddServer->setAutoResize(true);
  kpbCancel->setAutoResize(true);
}