summaryrefslogtreecommitdiffstats
path: root/kdbg/pgmargsbase.cpp
blob: fe2a71dee55b4901c90894de955608a63e0c8ec7 (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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
#include <kdialog.h>
#include <tdelocale.h>
/****************************************************************************
** Form implementation generated from reading ui file '../../exper/kdbg/pgmargsbase.ui'
**
** Created: Sun Jun 6 14:57:15 2010
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "pgmargsbase.h"

#include <ntqvariant.h>
#include <ntqpushbutton.h>
#include <ntqtabwidget.h>
#include <ntqwidget.h>
#include <ntqlabel.h>
#include <ntqlineedit.h>
#include <ntqheader.h>
#include <ntqlistview.h>
#include <ntqlistbox.h>
#include <ntqlayout.h>
#include <ntqtooltip.h>
#include <ntqwhatsthis.h>

/*
 *  Constructs a PgmArgsBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 *  The dialog will by default be modeless, unless you set 'modal' to
 *  TRUE to construct a modal dialog.
 */
PgmArgsBase::PgmArgsBase( TQWidget* parent, const char* name, bool modal, WFlags fl )
    : TQDialog( parent, name, modal, fl )
{
    if ( !name )
	setName( "PgmArgsBase" );
    setSizeGripEnabled( TRUE );
    PgmArgsBaseLayout = new TQHBoxLayout( this, 11, 6, "PgmArgsBaseLayout"); 

    layout1 = new TQVBoxLayout( 0, 0, 6, "layout1"); 

    tabWidget = new TQTabWidget( this, "tabWidget" );

    argsPage = new TQWidget( tabWidget, "argsPage" );
    argsPageLayout = new TQHBoxLayout( argsPage, 11, 6, "argsPageLayout"); 

    layout2 = new TQVBoxLayout( 0, 0, 6, "layout2"); 

    labelArgs = new TQLabel( argsPage, "labelArgs" );
    layout2->addWidget( labelArgs );

    programArgs = new TQLineEdit( argsPage, "programArgs" );
    layout2->addWidget( programArgs );

    layout3 = new TQHBoxLayout( 0, 0, 6, "layout3"); 

    insertFile = new TQPushButton( argsPage, "insertFile" );
    layout3->addWidget( insertFile );

    insertDir = new TQPushButton( argsPage, "insertDir" );
    layout3->addWidget( insertDir );
    spacer1 = new TQSpacerItem( 61, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout3->addItem( spacer1 );
    layout2->addLayout( layout3 );
    spacer2 = new TQSpacerItem( 81, 180, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout2->addItem( spacer2 );
    argsPageLayout->addLayout( layout2 );
    tabWidget->insertTab( argsPage, TQString::fromLatin1("") );

    wdPage = new TQWidget( tabWidget, "wdPage" );
    wdPageLayout = new TQHBoxLayout( wdPage, 11, 6, "wdPageLayout"); 

    layout6 = new TQVBoxLayout( 0, 0, 6, "layout6"); 

    wdEdit = new TQLineEdit( wdPage, "wdEdit" );
    layout6->addWidget( wdEdit );

    layout5 = new TQHBoxLayout( 0, 0, 6, "layout5"); 

    wdBrowse = new TQPushButton( wdPage, "wdBrowse" );
    layout5->addWidget( wdBrowse );
    spacer4 = new TQSpacerItem( 321, 31, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout5->addItem( spacer4 );
    layout6->addLayout( layout5 );
    spacer5 = new TQSpacerItem( 111, 161, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout6->addItem( spacer5 );
    wdPageLayout->addLayout( layout6 );
    tabWidget->insertTab( wdPage, TQString::fromLatin1("") );

    envPage = new TQWidget( tabWidget, "envPage" );
    envPageLayout = new TQHBoxLayout( envPage, 11, 6, "envPageLayout"); 

    layout9 = new TQHBoxLayout( 0, 0, 6, "layout9"); 

    layout7 = new TQVBoxLayout( 0, 0, 6, "layout7"); 

    envLabel = new TQLabel( envPage, "envLabel" );
    layout7->addWidget( envLabel );

    envVar = new TQLineEdit( envPage, "envVar" );
    layout7->addWidget( envVar );

    envList = new TQListView( envPage, "envList" );
    envList->addColumn( tr2i18n( "Name" ) );
    envList->header()->setClickEnabled( FALSE, envList->header()->count() - 1 );
    envList->addColumn( tr2i18n( "Value" ) );
    envList->header()->setClickEnabled( FALSE, envList->header()->count() - 1 );
    envList->setSelectionMode( TQListView::Single );
    layout7->addWidget( envList );
    layout9->addLayout( layout7 );

    layout8 = new TQVBoxLayout( 0, 0, 6, "layout8"); 

    buttonModify = new TQPushButton( envPage, "buttonModify" );
    layout8->addWidget( buttonModify );

    buttonDelete = new TQPushButton( envPage, "buttonDelete" );
    layout8->addWidget( buttonDelete );
    spacer6 = new TQSpacerItem( 51, 141, TQSizePolicy::Minimum, TQSizePolicy::Expanding );
    layout8->addItem( spacer6 );
    layout9->addLayout( layout8 );
    envPageLayout->addLayout( layout9 );
    tabWidget->insertTab( envPage, TQString::fromLatin1("") );

    xsldbgOptionsPage = new TQWidget( tabWidget, "xsldbgOptionsPage" );
    xsldbgOptionsPageLayout = new TQHBoxLayout( xsldbgOptionsPage, 11, 6, "xsldbgOptionsPageLayout"); 

    xsldbgOptions = new TQListBox( xsldbgOptionsPage, "xsldbgOptions" );
    xsldbgOptions->setSelectionMode( TQListBox::Multi );
    xsldbgOptionsPageLayout->addWidget( xsldbgOptions );
    tabWidget->insertTab( xsldbgOptionsPage, TQString::fromLatin1("") );
    layout1->addWidget( tabWidget );

    layout4 = new TQHBoxLayout( 0, 0, 6, "layout4"); 

    buttonHelp = new TQPushButton( this, "buttonHelp" );
    buttonHelp->setAutoDefault( TRUE );
    layout4->addWidget( buttonHelp );
    spacer3 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum );
    layout4->addItem( spacer3 );

    buttonOk = new TQPushButton( this, "buttonOk" );
    buttonOk->setAutoDefault( TRUE );
    buttonOk->setDefault( TRUE );
    layout4->addWidget( buttonOk );

    buttonCancel = new TQPushButton( this, "buttonCancel" );
    buttonCancel->setAutoDefault( TRUE );
    layout4->addWidget( buttonCancel );
    layout1->addLayout( layout4 );
    PgmArgsBaseLayout->addLayout( layout1 );
    languageChange();
    resize( TQSize(528, 410).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( buttonOk, SIGNAL( clicked() ), this, SLOT( accept() ) );
    connect( buttonCancel, SIGNAL( clicked() ), this, SLOT( reject() ) );
    connect( insertFile, SIGNAL( clicked() ), this, SLOT( browseArgFile() ) );
    connect( wdBrowse, SIGNAL( clicked() ), this, SLOT( browseWd() ) );
    connect( buttonModify, SIGNAL( clicked() ), this, SLOT( modifyVar() ) );
    connect( buttonDelete, SIGNAL( clicked() ), this, SLOT( deleteVar() ) );
    connect( envList, SIGNAL( selectionChanged() ), this, SLOT( envListCurrentChanged() ) );
    connect( buttonHelp, SIGNAL( clicked() ), this, SLOT( invokeHelp() ) );
    connect( insertDir, SIGNAL( clicked() ), this, SLOT( browseArgDir() ) );

    // tab order
    setTabOrder( envVar, envList );
    setTabOrder( envList, buttonModify );
    setTabOrder( buttonModify, buttonDelete );
    setTabOrder( buttonDelete, programArgs );
    setTabOrder( programArgs, insertFile );
    setTabOrder( insertFile, insertDir );
    setTabOrder( insertDir, buttonHelp );
    setTabOrder( buttonHelp, buttonOk );
    setTabOrder( buttonOk, buttonCancel );
    setTabOrder( buttonCancel, tabWidget );
    setTabOrder( tabWidget, wdEdit );
    setTabOrder( wdEdit, wdBrowse );

    // buddies
    labelArgs->setBuddy( programArgs );
    envLabel->setBuddy( envVar );
}

/*
 *  Destroys the object and frees any allocated resources
 */
PgmArgsBase::~PgmArgsBase()
{
    // no need to delete child widgets, TQt does it all for us
}

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void PgmArgsBase::languageChange()
{
    setCaption( tr2i18n( "Program Arguments" ) );
    labelArgs->setText( tr2i18n( "Run <i>%1</i> with these arguments:" ) );
    TQWhatsThis::add( programArgs, tr2i18n( "Specify the arguments with which the program shall be invoked for this debugging session. You specify the arguments just as you would on the command line, that is, you can even use quotes and environment variables, for example:<p><tt>--message 'start in: ' $HOME</tt>" ) );
    insertFile->setText( tr2i18n( "Insert &file name..." ) );
    insertFile->setAccel( TQKeySequence( tr2i18n( "Alt+F" ) ) );
    TQWhatsThis::add( insertFile, tr2i18n( "Browse for a file; the full path name will be inserted at the current cursor location in the edit box above." ) );
    insertDir->setText( tr2i18n( "Insert &directory name..." ) );
    insertDir->setAccel( TQKeySequence( tr2i18n( "Alt+D" ) ) );
    TQWhatsThis::add( insertDir, tr2i18n( "Browse for a directory; the full path name will be inserted at the current cursor location in the edit box above." ) );
    tabWidget->changeTab( argsPage, tr2i18n( "&Arguments" ) );
    TQWhatsThis::add( wdEdit, tr2i18n( "Specify here the initial working directory where the program is run." ) );
    wdBrowse->setText( tr2i18n( "&Browse..." ) );
    wdBrowse->setAccel( TQKeySequence( tr2i18n( "Alt+B" ) ) );
    TQWhatsThis::add( wdBrowse, tr2i18n( "Browse for the initial working directory where the program is run." ) );
    tabWidget->changeTab( wdPage, tr2i18n( "&Working Directory" ) );
    envLabel->setText( tr2i18n( "Environment variables (<tt>NAME=value</tt>):" ) );
    TQWhatsThis::add( envVar, tr2i18n( "To add a new environment variable or to modify one, specify it here in the form <tt>NAME=value</tt> and click <b>Modify</b>." ) );
    envList->header()->setLabel( 0, tr2i18n( "Name" ) );
    envList->header()->setLabel( 1, tr2i18n( "Value" ) );
    TQWhatsThis::add( envList, tr2i18n( "Environment variables that are set <i>in addition</i> to those that are inherited are listed in this table. To add new environment variables, specify them as <tt>NAME=value</tt> in the edit box above and click <b>Modify</b>. To modify a value, select it in this list and click <b>Modify</b>. To delete an environment variable, select it in this list and click <b>Delete</b>." ) );
    buttonModify->setText( tr2i18n( "&Modify" ) );
    buttonModify->setAccel( TQKeySequence( tr2i18n( "Alt+M" ) ) );
    TQWhatsThis::add( buttonModify, tr2i18n( "Enters the environment variable that is currently specified in the edit box into the list. If the named variable is already in the list, it receives a new value; otherwise, a new entry is created." ) );
    buttonDelete->setText( tr2i18n( "&Delete" ) );
    buttonDelete->setAccel( TQKeySequence( tr2i18n( "Alt+D" ) ) );
    TQWhatsThis::add( buttonDelete, tr2i18n( "Deletes the selected environment variable from the list. This cannot be used to delete environment variables that are inherited." ) );
    tabWidget->changeTab( envPage, tr2i18n( "&Environment" ) );
    tabWidget->changeTab( xsldbgOptionsPage, tr2i18n( "&xsldbg Options" ) );
    buttonHelp->setText( tr2i18n( "&Help" ) );
    buttonHelp->setAccel( TQKeySequence( tr2i18n( "F1" ) ) );
    buttonOk->setText( tr2i18n( "&OK" ) );
    buttonOk->setAccel( TQKeySequence( TQString::null ) );
    buttonCancel->setText( tr2i18n( "&Cancel" ) );
    buttonCancel->setAccel( TQKeySequence( TQString::null ) );
}

#include "pgmargsbase.moc"