QXRD  0.11.16
Public Slots | Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
QxrdGlobalPreferencesDialog Class Reference

#include <qxrdglobalpreferencesdialog.h>

Inheritance diagram for QxrdGlobalPreferencesDialog:
Inheritance graph
[legend]
Collaboration diagram for QxrdGlobalPreferencesDialog:
Collaboration graph
[legend]

Public Slots

void accept ()
 

Public Member Functions

 QxrdGlobalPreferencesDialog (QxrdApplication *app, QWidget *parent=0)
 
 ~QxrdGlobalPreferencesDialog ()
 

Protected Member Functions

void changeEvent (QEvent *e)
 

Private Member Functions

void setupDebugWidgets (qint64 dbg)
 
qint64 readDebugWidgets ()
 

Private Attributes

QxrdApplicationm_Application
 
QVector< QCheckBox * > m_DebugWidgetList
 

Detailed Description

Definition at line 9 of file qxrdglobalpreferencesdialog.h.

Constructor & Destructor Documentation

QxrdGlobalPreferencesDialog::QxrdGlobalPreferencesDialog ( QxrdApplication app,
QWidget *  parent = 0 
)
explicit

Definition at line 8 of file qxrdglobalpreferencesdialog.cpp.

References QxrdApplication::allocator(), DEBUG_CONSTRUCTORS, m_Application, qcepDebug(), and setupDebugWidgets().

8  :
9  QDialog(parent),
10  m_Application(app)
11 {
13  printf("QxrdGlobalPreferencesDialog::QxrdGlobalPreferencesDialog(%p)\n", this);
14  }
15 
16  setupUi(this);
17 
18 // m_OpenDirectly -> setChecked(m_Application->get_OpenDirectly());
19  m_RecentExperimentsSize -> setValue(m_Application->get_RecentExperimentsSize());
20 
21  qint64 debugLevel = m_Application -> get_Debug();
22 
24 
25  if (alloc) {
26  m_ReservedMemory32 -> setRange(500, 3000);
27  m_ReservedMemory32 -> setValue(alloc->get_TotalBufferSizeMB32());
28  m_ReservedMemory64 -> setRange(500, 60000);
29  m_ReservedMemory64 -> setValue(alloc->get_TotalBufferSizeMB64());
30  m_ExtraReservedMemory -> setRange(0, 500);
31  m_ExtraReservedMemory -> setValue(alloc->get_Reserve());
32  }
33 
34  m_FileBrowserLimit -> setValue(m_Application->get_FileBrowserLimit());
35 
36  m_MessageWindowLines -> setValue(m_Application->get_MessageWindowLines());
37  m_UpdateIntervalMsec -> setValue(m_Application->get_UpdateIntervalMsec());
38 
39  setupDebugWidgets(debugLevel);
40 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26
QSharedPointer< QcepAllocator > QcepAllocatorPtr
QcepAllocatorWPtr allocator() const

Here is the call graph for this function:

QxrdGlobalPreferencesDialog::~QxrdGlobalPreferencesDialog ( )

Definition at line 42 of file qxrdglobalpreferencesdialog.cpp.

References DEBUG_CONSTRUCTORS, and qcepDebug().

43 {
45  printf("QxrdGlobalPreferencesDialog::~QxrdGlobalPreferencesDialog(%p)\n", this);
46  }
47 }
qint64 qcepDebug(int cond)
Definition: qcepdebug.cpp:26

Here is the call graph for this function:

Member Function Documentation

void QxrdGlobalPreferencesDialog::accept ( )
slot

Definition at line 61 of file qxrdglobalpreferencesdialog.cpp.

References QxrdApplication::allocator(), m_Application, and readDebugWidgets().

62 {
63  qint64 debugLevel = readDebugWidgets();
64 
65 // m_Application -> set_OpenDirectly(m_OpenDirectly->isChecked());
66  m_Application -> set_RecentExperimentsSize(m_RecentExperimentsSize->value());
67 
68  int bufferSize32 = m_ReservedMemory32 -> value();
69  int bufferSize64 = m_ReservedMemory64 -> value();
70  int extraReserve = m_ExtraReservedMemory -> value();
71 
72 
73  m_Application -> set_Debug(debugLevel);
74 
76 
77  if (alloc) {
78  alloc -> set_TotalBufferSizeMB32(bufferSize32);
79  alloc -> set_TotalBufferSizeMB64(bufferSize64);
80  alloc -> set_Reserve(extraReserve);
81  }
82 
83  m_Application -> set_FileBrowserLimit(m_FileBrowserLimit->value());
84  m_Application -> set_MessageWindowLines(m_MessageWindowLines -> value());
85  m_Application -> set_UpdateIntervalMsec(m_UpdateIntervalMsec -> value());
86 
87  QDialog::accept();
88 }
QSharedPointer< QcepAllocator > QcepAllocatorPtr
QcepAllocatorWPtr allocator() const

Here is the call graph for this function:

void QxrdGlobalPreferencesDialog::changeEvent ( QEvent *  e)
protected

Definition at line 49 of file qxrdglobalpreferencesdialog.cpp.

50 {
51  QDialog::changeEvent(e);
52  switch (e->type()) {
53  case QEvent::LanguageChange:
54  retranslateUi(this);
55  break;
56  default:
57  break;
58  }
59 }
qint64 QxrdGlobalPreferencesDialog::readDebugWidgets ( )
private

Definition at line 126 of file qxrdglobalpreferencesdialog.cpp.

References m_DebugWidgetList.

Referenced by accept().

127 {
128  qint64 mask = 1;
129  qint64 newDbg = 0;
130  int ndebug = m_DebugWidgetList.count();
131 
132  for (int i=0; i<ndebug; i++) {
133  if (m_DebugWidgetList[i]->isChecked()) {
134  newDbg |= mask;
135  }
136 
137  mask <<= 1;
138  }
139 
140  return newDbg;
141 }
QVector< QCheckBox * > m_DebugWidgetList

Here is the caller graph for this function:

void QxrdGlobalPreferencesDialog::setupDebugWidgets ( qint64  dbg)
private

Definition at line 90 of file qxrdglobalpreferencesdialog.cpp.

References g_DebugLevel, and m_DebugWidgetList.

Referenced by QxrdGlobalPreferencesDialog().

91 {
92  if (g_DebugLevel == NULL) {
93  printf("g_DebugLevel == NULL in QxrdGlobalPreferencesDialog::setupDebugWidgets\n");
94  } else {
95  QGridLayout *grid = new QGridLayout(m_DebugWidgets);
96 
97  for (int i=0; i<64; i++) {
98  qint64 mask=((qint64)1)<<i;
99  QString msg = g_DebugLevel->message(i);
100 
101  if (msg.length() > 0) {
102  QCheckBox *cb = new QCheckBox(msg);
103  cb->setChecked(dbg & mask);
104 
105  m_DebugWidgetList.append(cb);
106  } else {
107  break;
108  }
109  }
110 
111  int ndebug = m_DebugWidgetList.count();
112  int ncol = ndebug - ndebug/2;
113 
114  for (int i=0; i<ndebug; i++) {
115  QCheckBox *cb = m_DebugWidgetList[i];
116 
117  if (i < ncol) {
118  grid->addWidget(cb, i, 0);
119  } else {
120  grid->addWidget(cb, i - ncol, 1);
121  }
122  }
123  }
124 }
QVector< QCheckBox * > m_DebugWidgetList
QSharedPointer< QcepDebugDictionary > g_DebugLevel
Definition: qcepdebug.cpp:4

Here is the caller graph for this function:

Member Data Documentation

QxrdApplication* QxrdGlobalPreferencesDialog::m_Application
private

Definition at line 28 of file qxrdglobalpreferencesdialog.h.

Referenced by accept(), and QxrdGlobalPreferencesDialog().

QVector<QCheckBox*> QxrdGlobalPreferencesDialog::m_DebugWidgetList
private

Definition at line 29 of file qxrdglobalpreferencesdialog.h.

Referenced by readDebugWidgets(), and setupDebugWidgets().


The documentation for this class was generated from the following files: