~ubuntu-branches/ubuntu/oneiric/valkyrie/oneiric

« back to all changes in this revision

Viewing changes to valkyrie/options/memcheck_options_page.cpp

  • Committer: Package Import Robot
  • Author(s): Clint Byrum
  • Date: 2011-09-02 22:08:34 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: package-import@ubuntu.com-20110902220834-kigsixteppj9epp5
Tags: 2.0.0-0ubuntu1
* New upstream release. (LP: #635129, LP: #832886, LP: #721298)
* Standards bumped to 3.9.2, no changes required.
* d/control, d/rules: cdbs removed, dh minimal rule instead.
* d/control: build system is qmake not autotools
* d/control: bump required qt to qt4
* d/valkyrie.install: installing html docs manually as make install
  no longer does so.
* d/patches/valkyrie-2.0.0-fix-doc.dir.patch: Fix doc path to match
  policy. Also corrects LP: #588074 since the documentation link now
  works.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/* ---------------------------------------------------------------------- 
2
 
 * Implementation of MemcheckOptionsPage        memcheck_options_page.cpp
3
 
 * Subclass of OptionsPage to hold memcheck-specific options | flags.
4
 
 * ---------------------------------------------------------------------- 
5
 
 * This file is part of Valkyrie, a front-end for Valgrind
6
 
 * Copyright (C) 2000-2008, OpenWorks LLP <info@open-works.co.uk>
7
 
 * This program is released under the terms of the GNU GPL v.2
8
 
 * See the file COPYING for the full license details.
9
 
 */
10
 
 
11
 
#include "memcheck_options_page.h"
12
 
 
13
 
#include "context_help.h"
14
 
#include "html_urls.h"
15
 
#include "memcheck_object.h"
16
 
#include "vk_messages.h"
17
 
#include "vk_utils.h"
18
 
 
19
 
 
20
 
 
21
 
MemcheckOptionsPage::MemcheckOptionsPage( QWidget* parent, VkObject* obj )
22
 
   : OptionsPage( parent, obj, "memcheck_options_page" )
23
 
24
 
   /* init the QIntDict list, resizing if necessary */
25
 
   unsigned int numItems = 11;
26
 
   m_itemList.resize( numItems );
27
 
 
28
 
   /* top layout: margin = 10; spacing = 25 */
29
 
   QVBoxLayout* vbox = new QVBoxLayout( this, 10, 25, "vbox" );
30
 
 
31
 
   /* group1: memcheck options */
32
 
   QGroupBox* group1 = new QGroupBox( " Memcheck Options ", this, "group1");
33
 
   ContextHelp::add( group1, urlMemcheck::optsMC );
34
 
   vbox->addWidget( group1, m_space );
35
 
 
36
 
   m_itemList.insert( Memcheck::LEAK_CHECK,                 /* combobox */
37
 
                      optionWidget( Memcheck::LEAK_CHECK, group1, true ) );
38
 
   m_itemList.insert( Memcheck::SHOW_REACH,                 /* checkbox */
39
 
                      optionWidget( Memcheck::SHOW_REACH, group1, false ) );
40
 
   //m_itemList.insert( Memcheck::UNDEF_VAL,                  /* checkbox */
41
 
   //                   optionWidget( Memcheck::UNDEF_VAL,  group1, false ) );
42
 
   m_itemList.insert( Memcheck::TRACK_ORI,                  /* checkbox */
43
 
                      optionWidget( Memcheck::TRACK_ORI,  group1, false ) );
44
 
  
45
 
   m_itemList.insert( Memcheck::PARTIAL,                    /* checkbox */
46
 
                      optionWidget( Memcheck::PARTIAL,    group1, false ) );
47
 
   m_itemList.insert( Memcheck::GCC_296,                    /* checkbox */
48
 
                      optionWidget( Memcheck::GCC_296,    group1, false ) );
49
 
  
50
 
   m_itemList.insert( Memcheck::LEAK_RES,                   /* combobox */
51
 
                      optionWidget( Memcheck::LEAK_RES,   group1, true ) );
52
 
   m_itemList.insert( Memcheck::FREELIST,                   /* ledit    */
53
 
                      optionWidget( Memcheck::FREELIST,   group1, true ) );
54
 
   m_itemList.insert( Memcheck::ALIGNMENT,                  /* spinbox  */
55
 
                      optionWidget( Memcheck::ALIGNMENT,  group1, true ) );
56
 
 
57
 
   /* grid layout for group1 */
58
 
   int rows = 11;
59
 
   int cols = 2;
60
 
   QGridLayout* grid1 = new QGridLayout( group1, rows, cols, m_margin, m_space );
61
 
   int row=0;
62
 
#if (QT_VERSION-0 >= 0x030200)
63
 
   grid1->setRowSpacing( row++, m_topSpace );   /* blank top row */
64
 
#else // QT_VERSION < 3.2
65
 
   grid1->addRowSpacing( row++, m_topSpace );   /* blank top row */
66
 
#endif
67
 
   grid1->setColStretch( 1, 10 );         /* push widgets to the left */
68
 
 
69
 
   grid1->addLayout( m_itemList[Memcheck::LEAK_CHECK]->hlayout(), row++, 0 );
70
 
   grid1->addWidget( m_itemList[Memcheck::SHOW_REACH]->widget(),  row++, 0 );
71
 
   //grid1->addWidget( m_itemList[Memcheck::UNDEF_VAL]->widget(),   row++, 0 );
72
 
 
73
 
   grid1->addMultiCellWidget( sep(group1,"sep1"), row,row, 0,1 );
74
 
#if (QT_VERSION-0 >= 0x030200)
75
 
   grid1->setRowSpacing( row++, m_topSpace );   /* add a bit more space here */
76
 
#else // QT_VERSION < 3.2
77
 
   grid1->addRowSpacing( row++, m_topSpace );   /* add a bit more space here */
78
 
#endif
79
 
 
80
 
   grid1->addWidget( m_itemList[Memcheck::TRACK_ORI]->widget(),   row++, 0 );
81
 
   grid1->addWidget( m_itemList[Memcheck::PARTIAL]->widget(),     row++, 0 );
82
 
   grid1->addWidget( m_itemList[Memcheck::GCC_296]->widget(),     row++, 0 );
83
 
 
84
 
   grid1->addMultiCellWidget( sep(group1,"sep2"), row,row, 0,1 );
85
 
   row++;
86
 
#if (QT_VERSION-0 >= 0x030200)
87
 
   grid1->setRowSpacing( row, m_topSpace );   /* add a bit more space here */
88
 
#else // QT_VERSION < 3.2
89
 
   grid1->addRowSpacing( row, m_topSpace );   /* add a bit more space here */
90
 
#endif
91
 
 
92
 
   grid1->addLayout( m_itemList[Memcheck::LEAK_RES]->hlayout(),    row++, 0 );
93
 
   grid1->addLayout( m_itemList[Memcheck::FREELIST]->hlayout(),    row++, 0 );
94
 
   grid1->addLayout( m_itemList[Memcheck::ALIGNMENT ]->hlayout(),  row++, 0 );
95
 
 
96
 
   vk_assert(row == rows);
97
 
 
98
 
   vbox->addStretch( m_space );
99
 
 
100
 
   /* finalise page ------------------------------------------------- */
101
 
   vk_assert( m_itemList.count() <= numItems );
102
 
 
103
 
   QIntDictIterator<OptionWidget> it( m_itemList );
104
 
   for ( ;  it.current(); ++it ) {
105
 
      connect(it.current(), SIGNAL(valueChanged( bool, OptionWidget * )),
106
 
              this,         SLOT(updateEditList( bool, OptionWidget * )));
107
 
   }
108
 
 
109
 
 
110
 
   /* Disabled Widgets -------------------------------------------------
111
 
      Valgrind presets and ignores some options when generating xml
112
 
      output. (see docs/internals/xml_output.txt) */
113
 
   m_itemList[Memcheck::LEAK_CHECK]->setEnabled( false );
114
 
}
115
 
 
116
 
 
117
 
/* called when user clicks "Apply" / "Ok" / "Reset" buttons. */
118
 
void MemcheckOptionsPage::applyOption( int optId )
119
 
120
 
   vk_assert( optId >= 0 && optId < Memcheck::NUM_OPTS );
121
 
 
122
 
//   QString argval = m_itemList[optId]->currValue();
123
 
 
124
 
   /* apply option */
125
 
   switch ( optId ) {
126
 
   default:
127
 
      break;
128
 
   }
129
 
}
130
 
 
131
 
 
132