summaryrefslogtreecommitdiffstats
path: root/quanta/components/debugger/conditionalbreakpointdialog.cpp
blob: 055512daec436870ace46124bb0263c254db00d0 (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
/***************************************************************************
                            conditionalbreakpointdialog.cpp
                            --------------------
    begin                : 2005-01-08
    copyright            : (C) 2004 Linus McCabe <[email protected]>
 ***************************************************************************/

/****************************************************************************
 *                                                                          *
 *   This program is free software; you can redistribute it and/or modify   *
 *   it under the terms of the GNU General Public License as published by   *
 *   the Free Software Foundation; either version 2 of the License, or      *
 *   (at your option) any later version.                                    *
 *                                                                          *
 ***************************************************************************/


#include "conditionalbreakpointdialog.h"
#include <tqlistview.h>
#include <tqlineedit.h>
#include <qextfileinfo.h>
#include <tqcolor.h>
#include <kcombobox.h>
#include <kled.h>
#include <kiconloader.h>
#include <tqpushbutton.h>
#include <tqradiobutton.h>

#include "debuggerbreakpoint.h"

ConditionalBreakpointDialog::ConditionalBreakpointDialog(const TQString& expression, const TQString& inFile, const TQString& inClass, const TQString& inFunction)
    : ConditionalBreakpointDialogS(0, "ConditionalBreakpointDialog", false, 0)
{
  comboExpression->setCurrentText(expression);
  lineFile->setText(inFile);
  lineClass->setText(inClass);
  lineFunction->setText(inFunction);

  buttonClearFile->setPixmap(SmallIcon("clear_left"));
  buttonClearClass->setPixmap(SmallIcon("clear_left"));
  buttonClearFunction->setPixmap(SmallIcon("clear_left"));
  
  connect(comboExpression, TQT_SIGNAL(textChanged(const TQString&)), this, TQT_SLOT(slotExpressionChanged()));

  connect(buttonClearFile, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClearFile()));
  connect(buttonClearClass, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClearClass()));
  connect(buttonClearFunction, TQT_SIGNAL(pressed()), this, TQT_SLOT(slotClearFunction()));

  slotExpressionChanged();
}

ConditionalBreakpointDialog::~ConditionalBreakpointDialog()
{
}

void ConditionalBreakpointDialog::slotExpressionChanged()
{

  if(comboExpression->currentText().find( TQRegExp("[^=!]=[^=]"), 0 ) >= 0)
    ledWarning->on();
  else
    ledWarning->off();
    
}

void ConditionalBreakpointDialog::slotClearFile()
{
  lineFile->setText("");
}

void ConditionalBreakpointDialog::slotClearClass()
{
  lineClass->setText("");
}

void ConditionalBreakpointDialog::slotClearFunction()
{
  lineFunction->setText("");
}

/*DebuggerBreakpoint::Types type()*/

DebuggerBreakpoint *ConditionalBreakpointDialog::breakpoint()
{
  if(comboExpression->currentText().isEmpty())
    return NULL;
    
  DebuggerBreakpoint *bp = new DebuggerBreakpoint(
    (radioOnChange->isChecked() ? DebuggerBreakpoint::ConditionalChange : DebuggerBreakpoint::ConditionalTrue),
    comboExpression->currentText(),
    lineFile->text(),
    lineClass->text(),
    lineFunction->text());

  return bp;
}


#include "conditionalbreakpointdialog.moc"