Ananas Library 0.9.5
addfdialog.ui.h
1/****************************************************************************
2** $Id: addfdialog.ui.h,v 1.9 2006/04/04 12:49:39 gr Exp $
3**
4** Code file of the select files plugin of Ananas
5** Designer and Engine applications
6**
7** Created : 20031201
8**
9** Copyright (C) 2003-2004 Leader InfoTech. All rights reserved.
10** Copyright (C) 2003-2004 Grigory Panov, Yoshkar-Ola.
11**
12** This file is part of the Ananas Plugins of the Ananas
13** automation accounting system.
14**
15** This file may be distributed and/or modified under the terms of the
16** GNU General Public License version 2 as published by the Free Software
17** Foundation and appearing in the file LICENSE.GPL included in the
18** packaging of this file.
19**
20** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
21** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
22**
23** See http://www.leaderit.ru/page=ananas or email sales@leaderit.ru
24** See http://www.leaderit.ru/gpl/ for GPL licensing information.
25**
26** Contact org@leaderit.ru if any conditions of this licensing are
27** not clear to you.
28**
29**********************************************************************/
30
31/****************************************************************************
32** ui.h extension file, included from the uic-generated form implementation.
33**
34** If you wish to add, delete or rename functions or slots use
35** Qt Designer which will update this file, preserving your code. Create an
36** init() function in place of a constructor, and a destroy() function in
37** place of a destructor.
38*****************************************************************************/
43void addfdialog::doOk()
44{
45 int idx;
46 idx = ListBox->currentItem();
47 if(idx>=0)
48 {
49 id = idlist[idx];
50 field = list[idx];
51 }
52 else id="0";
53 accept();
54}
55
56
57void addfdialog::init()
58{
59 id="0";
60 field="";
61}
62
63
64void addfdialog::destroy()
65{
66
67}
68
69
74const QString addfdialog::getData(bool name)
75{
76 if(name) return field;
77 else return id;
78}
79
85void addfdialog::setData( QStringList displst, QStringList flst, QStringList ilds)
86{
87 list = flst;
88 ListBox->insertStringList(displst);
89 idlist = ilds;
90}
91
92
93
94
95void addfdialog::setData( QWidget *o, aCfg *md )
96{
97
98 wDBField *w = (wDBField *)o;
99 w->getFields();
100 setData( w->defDisplayFields, w->defFields,w->defId);
101 ListBox->setCurrentItem(ListBox->findItem(w->getFieldName()));
102}
103
104
105void addfdialog::getData( QWidget *o )
106{
107 QString s;
108 wDBField *w = (wDBField *)o;
109 QValueList<Q_ULLONG> bindList = w->getBindList();
110 s = getData(true);
111 if(s.isEmpty()) return;
112 w->setFieldName(s);
113 s = getData(false);
114 if(s=="0") return;
115 // if select binding field
116 if(bindList.find(s.toULongLong()) != bindList.end())
117 {
118 cfg_message(0, tr("field already binding, please select another field."));
119 return;
120 }
121 w->setId(s.toInt());
122 w->setEditorType();
123 //w->updateProp();
124
125}
Definition acfg.h:437
Ananas DBField. widget. .
Definition wdbfield.h:62
QValueList< Q_ULLONG > getBindList()
Definition wdbfield.cpp:407
QStringList getFields()
Definition wdbfield.cpp:193
void setFieldName(QString n)
Definition wdbfield.cpp:133
void setEditorType(void)
Definition wdbfield.cpp:349