• 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
27#include "addenvvardlg.h"
28
29
30AddEnvvarDialog::AddEnvvarDialog(TQWidget *parent, const char *name)
31 : TQDialog(parent, name, true)
32{
33 setCaption(i18n("Add Environment Variable"));
34
35 TQLabel *varname_label = new TQLabel(i18n("&Name:"), this);
36 varname_edit = new KLineEdit(this);
37 varname_edit->setFocus();
38 varname_label->setBuddy(varname_edit);
39
40 connect( varname_edit, TQ_SIGNAL( textChanged ( const TQString & ) ), this, TQ_SLOT( slotTextChanged() ) );
41 TQLabel *value_label = new TQLabel(i18n("&Value:"), this);
42 value_edit = new KLineEdit(this);
43 value_label->setBuddy(value_edit);
44 TQFontMetrics fm(value_edit->fontMetrics());
45 value_edit->setMinimumWidth(fm.width('X')*35);
46 connect( value_edit, TQ_SIGNAL( textChanged ( const TQString & ) ), this, TQ_SLOT( slotTextChanged() ) );
47
48
49 TQVBoxLayout *layout = new TQVBoxLayout(this, 10);
50
51 TQGridLayout *grid = new TQGridLayout(2, 2);
52 layout->addLayout(grid);
53 grid->addWidget(varname_label, 0, 0);
54 grid->addWidget(varname_edit, 0, 1);
55 grid->addWidget(value_label, 1, 0);
56 grid->addWidget(value_edit, 1, 1);
57
58 TQFrame *frame = new TQFrame(this);
59 frame->setFrameStyle(TQFrame::HLine | TQFrame::Sunken);
60 layout->addWidget(frame, 0);
61
62 KButtonBox *buttonbox = new KButtonBox(this);
63 buttonbox->addStretch();
64 m_pOk = buttonbox->addButton( KStdGuiItem::ok());
65 TQPushButton *cancel = buttonbox->addButton(KStdGuiItem::cancel());
66 m_pOk->setDefault(true);
67 connect( m_pOk, TQ_SIGNAL(clicked()), this, TQ_SLOT(accept()) );
68 connect( cancel, TQ_SIGNAL(clicked()), this, TQ_SLOT(reject()) );
69 buttonbox->layout();
70 layout->addWidget(buttonbox, 0);
71 slotTextChanged();
72}
73
74
75AddEnvvarDialog::~AddEnvvarDialog()
76{}
77
78void AddEnvvarDialog::slotTextChanged()
79{
80 m_pOk->setEnabled( !varname_edit->text().isEmpty() && !value_edit->text().isEmpty() );
81}
82
83#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.15.0
This website is maintained by Timothy Pearson.