• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Buildtool Widgets Library
 

KDevelop Buildtool Widgets Library

  • buildtools
  • lib
  • widgets
addenvvardlg.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2001 Bernd Gehrmann <bernd@kdevelop.org>
3 
4  This library is free software; you can redistribute it and/or
5  modify it under the terms of the GNU Library General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include <tqlabel.h>
21 #include <tqlayout.h>
22 #include <tqpushbutton.h>
23 #include <kbuttonbox.h>
24 #include <tdelocale.h>
25 #include <kstdguiitem.h>
26 #include <tdeversion.h>
27 
28 #include "addenvvardlg.h"
29 
30 
31 AddEnvvarDialog::AddEnvvarDialog(TQWidget *parent, const char *name)
32  : TQDialog(parent, name, true)
33 {
34  setCaption(i18n("Add Environment Variable"));
35 
36  TQLabel *varname_label = new TQLabel(i18n("&Name:"), this);
37  varname_edit = new KLineEdit(this);
38  varname_edit->setFocus();
39  varname_label->setBuddy(varname_edit);
40 
41  connect( varname_edit, TQT_SIGNAL( textChanged ( const TQString & ) ), this, TQT_SLOT( slotTextChanged() ) );
42  TQLabel *value_label = new TQLabel(i18n("&Value:"), this);
43  value_edit = new KLineEdit(this);
44  value_label->setBuddy(value_edit);
45  TQFontMetrics fm(value_edit->fontMetrics());
46  value_edit->setMinimumWidth(fm.width('X')*35);
47  connect( value_edit, TQT_SIGNAL( textChanged ( const TQString & ) ), this, TQT_SLOT( slotTextChanged() ) );
48 
49 
50  TQVBoxLayout *layout = new TQVBoxLayout(this, 10);
51 
52  TQGridLayout *grid = new TQGridLayout(2, 2);
53  layout->addLayout(grid);
54  grid->addWidget(varname_label, 0, 0);
55  grid->addWidget(varname_edit, 0, 1);
56  grid->addWidget(value_label, 1, 0);
57  grid->addWidget(value_edit, 1, 1);
58 
59  TQFrame *frame = new TQFrame(this);
60  frame->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
61  layout->addWidget(frame, 0);
62 
63  KButtonBox *buttonbox = new KButtonBox(this);
64  buttonbox->addStretch();
65  m_pOk = buttonbox->addButton( KStdGuiItem::ok());
66  TQPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
67  m_pOk->setDefault(true);
68  connect( m_pOk, TQT_SIGNAL(clicked()), this, TQT_SLOT(accept()) );
69  connect( cancel, TQT_SIGNAL(clicked()), this, TQT_SLOT(reject()) );
70  buttonbox->layout();
71  layout->addWidget(buttonbox, 0);
72  slotTextChanged();
73 }
74 
75 
76 AddEnvvarDialog::~AddEnvvarDialog()
77 {}
78 
79 void AddEnvvarDialog::slotTextChanged()
80 {
81  m_pOk->setEnabled( !varname_edit->text().isEmpty() && !value_edit->text().isEmpty() );
82 }
83 
84 #include "addenvvardlg.moc"

KDevelop Buildtool Widgets Library

Skip menu "KDevelop Buildtool Widgets Library"
  • Main Page
  • Namespace List
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

KDevelop Buildtool Widgets Library

Skip menu "KDevelop Buildtool Widgets Library"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Buildtool Widgets Library by doxygen 1.8.13
This website is maintained by Timothy Pearson.