Skip to content

Commit 7792079

Browse files
committed
GUI: Added missing files. Forgot to add them in my last commit.
1 parent dd7c0b3 commit 7792079

3 files changed

Lines changed: 238 additions & 0 deletions

File tree

‎gui/libraryeditargdialog.cpp‎

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
#include "libraryeditargdialog.h"
2+
#include "ui_libraryeditargdialog.h"
3+
4+
LibraryEditArgDialog::LibraryEditArgDialog(QWidget *parent, const LibraryData::Function::Arg &a) :
5+
QDialog(parent),
6+
ui(new Ui::LibraryEditArgDialog),
7+
arg(a)
8+
{
9+
ui->setupUi(this);
10+
ui->notbool->setChecked(arg.notbool);
11+
ui->notnull->setChecked(arg.notnull);
12+
ui->notuninit->setChecked(arg.notuninit);
13+
ui->strz->setChecked(arg.strz);
14+
ui->formatStr->setChecked(arg.formatstr);
15+
ui->formatStrSafe->setVisible(false);
16+
ui->formatStrType->setVisible(false);
17+
ui->valid->setText(arg.valid);
18+
}
19+
20+
LibraryEditArgDialog::~LibraryEditArgDialog()
21+
{
22+
delete ui;
23+
}
24+
25+
LibraryData::Function::Arg LibraryEditArgDialog::getArg() const
26+
{
27+
LibraryData::Function::Arg ret;
28+
ret.notbool = ui->notbool->isChecked();
29+
ret.notnull = ui->notnull->isChecked();
30+
ret.notuninit = ui->notuninit->isChecked();
31+
ret.strz = ui->strz->isChecked();
32+
ret.formatstr = ui->formatStr->isChecked();
33+
ret.minsizes = arg.minsizes; // TODO : read from GUI
34+
ret.valid = ui->valid->text();
35+
return ret;
36+
}

‎gui/libraryeditargdialog.h‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
#ifndef LIBRARYEDITARGDIALOG_H
2+
#define LIBRARYEDITARGDIALOG_H
3+
4+
#include <QDialog>
5+
#include "librarydata.h"
6+
7+
namespace Ui {
8+
class LibraryEditArgDialog;
9+
}
10+
11+
class LibraryEditArgDialog : public QDialog {
12+
Q_OBJECT
13+
14+
public:
15+
LibraryEditArgDialog(QWidget *parent, const LibraryData::Function::Arg &a);
16+
~LibraryEditArgDialog();
17+
18+
LibraryData::Function::Arg getArg() const;
19+
20+
private:
21+
Ui::LibraryEditArgDialog *ui;
22+
23+
LibraryData::Function::Arg arg;
24+
};
25+
26+
#endif // LIBRARYEDITARGDIALOG_H

‎gui/libraryeditargdialog.ui‎

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<ui version="4.0">
3+
<class>LibraryEditArgDialog</class>
4+
<widget class="QDialog" name="LibraryEditArgDialog">
5+
<property name="geometry">
6+
<rect>
7+
<x>0</x>
8+
<y>0</y>
9+
<width>400</width>
10+
<height>448</height>
11+
</rect>
12+
</property>
13+
<property name="windowTitle">
14+
<string>Edit argument</string>
15+
</property>
16+
<layout class="QVBoxLayout" name="verticalLayout">
17+
<item>
18+
<widget class="QCheckBox" name="notbool">
19+
<property name="toolTip">
20+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
21+
&lt;p&gt;Is bool value allowed? For instance result from comparison or from '!' operator.&lt;/p&gt;
22+
&lt;p&gt;Typically, set this if the argument is a pointer, size, etc.&lt;/p&gt;
23+
&lt;p&gt;Example:&lt;/p&gt;
24+
&lt;pre&gt; memcmp(x, y, i == 123); // last argument should not have a bool value&lt;/pre&gt;
25+
&lt;/body&gt;&lt;/html&gt;</string>
26+
</property>
27+
<property name="text">
28+
<string>Not bool</string>
29+
</property>
30+
</widget>
31+
</item>
32+
<item>
33+
<widget class="QCheckBox" name="notnull">
34+
<property name="toolTip">
35+
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
36+
&lt;p&gt;Is a null parameter value allowed?&lt;/p&gt;
37+
&lt;p&gt;Typically this should be used on any pointer parameter that does not allow null.&lt;/p&gt;
38+
&lt;p&gt;Example:&lt;/p&gt;
39+
&lt;pre&gt; strcpy(x,y); // neither x or y is allowed to be null.&lt;/pre&gt;
40+
&lt;/body&gt;&lt;/html&gt;</string>
41+
</property>
42+
<property name="text">
43+
<string>Not null</string>
44+
</property>
45+
</widget>
46+
</item>
47+
<item>
48+
<widget class="QCheckBox" name="notuninit">
49+
<property name="text">
50+
<string>Not uninit</string>
51+
</property>
52+
</widget>
53+
</item>
54+
<item>
55+
<widget class="QCheckBox" name="strz">
56+
<property name="text">
57+
<string>String</string>
58+
</property>
59+
</widget>
60+
</item>
61+
<item>
62+
<layout class="QHBoxLayout" name="horizontalLayout">
63+
<item>
64+
<widget class="QCheckBox" name="formatStr">
65+
<property name="sizePolicy">
66+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
67+
<horstretch>0</horstretch>
68+
<verstretch>0</verstretch>
69+
</sizepolicy>
70+
</property>
71+
<property name="text">
72+
<string>Format string</string>
73+
</property>
74+
</widget>
75+
</item>
76+
<item>
77+
<widget class="QComboBox" name="formatStrType">
78+
<item>
79+
<property name="text">
80+
<string>output (like printf)</string>
81+
</property>
82+
</item>
83+
<item>
84+
<property name="text">
85+
<string>input (like scanf)</string>
86+
</property>
87+
</item>
88+
</widget>
89+
</item>
90+
<item>
91+
<widget class="QCheckBox" name="formatStrSafe">
92+
<property name="sizePolicy">
93+
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
94+
<horstretch>0</horstretch>
95+
<verstretch>0</verstretch>
96+
</sizepolicy>
97+
</property>
98+
<property name="text">
99+
<string>Safe</string>
100+
</property>
101+
</widget>
102+
</item>
103+
</layout>
104+
</item>
105+
<item>
106+
<widget class="QLabel" name="label">
107+
<property name="text">
108+
<string>Min size of buffer</string>
109+
</property>
110+
</widget>
111+
</item>
112+
<item>
113+
<widget class="QListWidget" name="minsizes"/>
114+
</item>
115+
<item>
116+
<layout class="QHBoxLayout" name="horizontalLayout_2">
117+
<item>
118+
<widget class="QLabel" name="label_2">
119+
<property name="text">
120+
<string>Valid values</string>
121+
</property>
122+
</widget>
123+
</item>
124+
<item>
125+
<widget class="QLineEdit" name="valid"/>
126+
</item>
127+
</layout>
128+
</item>
129+
<item>
130+
<widget class="QDialogButtonBox" name="buttonBox">
131+
<property name="orientation">
132+
<enum>Qt::Horizontal</enum>
133+
</property>
134+
<property name="standardButtons">
135+
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
136+
</property>
137+
</widget>
138+
</item>
139+
</layout>
140+
</widget>
141+
<resources/>
142+
<connections>
143+
<connection>
144+
<sender>buttonBox</sender>
145+
<signal>accepted()</signal>
146+
<receiver>LibraryEditArgDialog</receiver>
147+
<slot>accept()</slot>
148+
<hints>
149+
<hint type="sourcelabel">
150+
<x>222</x>
151+
<y>433</y>
152+
</hint>
153+
<hint type="destinationlabel">
154+
<x>157</x>
155+
<y>274</y>
156+
</hint>
157+
</hints>
158+
</connection>
159+
<connection>
160+
<sender>buttonBox</sender>
161+
<signal>rejected()</signal>
162+
<receiver>LibraryEditArgDialog</receiver>
163+
<slot>reject()</slot>
164+
<hints>
165+
<hint type="sourcelabel">
166+
<x>290</x>
167+
<y>439</y>
168+
</hint>
169+
<hint type="destinationlabel">
170+
<x>286</x>
171+
<y>274</y>
172+
</hint>
173+
</hints>
174+
</connection>
175+
</connections>
176+
</ui>

0 commit comments

Comments
 (0)