File: dialog_insinuation.cc

package info (click to toggle)
kdeutils 4%3A2.2.2-9.2
  • links: PTS
  • area: main
  • in suites: woody
  • size: 8,892 kB
  • ctags: 10,879
  • sloc: cpp: 82,942; sh: 11,754; ansic: 4,638; perl: 1,852; makefile: 706; python: 258
file content (65 lines) | stat: -rw-r--r-- 1,593 bytes parent folder | download
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
/* -*- C++ -*-
   This file implements the dialog to enter organisational attributes
   in the KDE address book.

   the KDE addressbook
   
   $ Author: Mirko Boehm $
   $ Copyright: (C) 1996-2000, Mirko Boehm $
   $ Contact: mirko@kde.org
         http://www.kde.org $
   $ License: GPL with the following explicit clarification:
         This code may be linked against any version of the Qt toolkit
         from Troll Tech, Norway. $

   $Revision: 1.4 $	 
*/

#include "dialog_insinuation.h"
#include <qlineedit.h>
#include <qlabel.h>
#include <qlayout.h>
#include <klocale.h>

InsinuationDialog::InsinuationDialog(QWidget *parent, const char*
				     name)
  : QWidget(parent, name)
{
  QString texts[]= {
    i18n("Organization:"),
    i18n("Department:"),
    i18n("Sub-Department:")
  };
  int count;
  QGridLayout *layout=new QGridLayout(this, 3, 2, 2);
  layout->setAutoAdd(true);
  // -----
  for(count=0; count<NoOfFields; ++count)
    {
      new QLabel(texts[count], this);
      fields[count]=new QLineEdit(this);
    }
}

InsinuationDialog::~InsinuationDialog()
{
}

void InsinuationDialog::setFields(const AddressBook::Entry::Address& address)
{
  int count=0;
  // -----
  fields[count++]->setText(address.org);
  fields[count++]->setText(address.orgUnit);
  fields[count++]->setText(address.orgSubUnit);
}

void InsinuationDialog::getFields(AddressBook::Entry::Address& address)
{
  int count=0;
  // -----
  address.org=fields[count++]->text();
  address.orgUnit=fields[count++]->text();
  address.orgSubUnit=fields[count++]->text();
}
#include "dialog_insinuation.moc"