GUI: Added missing files. Forgot to add them in my last commit.

This commit is contained in:
Daniel Marjamäki 2015-08-30 13:35:02 +02:00
parent dd7c0b353d
commit 779207933c
3 changed files with 238 additions and 0 deletions

View File

@ -0,0 +1,36 @@
#include "libraryeditargdialog.h"
#include "ui_libraryeditargdialog.h"
LibraryEditArgDialog::LibraryEditArgDialog(QWidget *parent, const LibraryData::Function::Arg &a) :
QDialog(parent),
ui(new Ui::LibraryEditArgDialog),
arg(a)
{
ui->setupUi(this);
ui->notbool->setChecked(arg.notbool);
ui->notnull->setChecked(arg.notnull);
ui->notuninit->setChecked(arg.notuninit);
ui->strz->setChecked(arg.strz);
ui->formatStr->setChecked(arg.formatstr);
ui->formatStrSafe->setVisible(false);
ui->formatStrType->setVisible(false);
ui->valid->setText(arg.valid);
}
LibraryEditArgDialog::~LibraryEditArgDialog()
{
delete ui;
}
LibraryData::Function::Arg LibraryEditArgDialog::getArg() const
{
LibraryData::Function::Arg ret;
ret.notbool = ui->notbool->isChecked();
ret.notnull = ui->notnull->isChecked();
ret.notuninit = ui->notuninit->isChecked();
ret.strz = ui->strz->isChecked();
ret.formatstr = ui->formatStr->isChecked();
ret.minsizes = arg.minsizes; // TODO : read from GUI
ret.valid = ui->valid->text();
return ret;
}

View File

@ -0,0 +1,26 @@
#ifndef LIBRARYEDITARGDIALOG_H
#define LIBRARYEDITARGDIALOG_H
#include <QDialog>
#include "librarydata.h"
namespace Ui {
class LibraryEditArgDialog;
}
class LibraryEditArgDialog : public QDialog {
Q_OBJECT
public:
LibraryEditArgDialog(QWidget *parent, const LibraryData::Function::Arg &a);
~LibraryEditArgDialog();
LibraryData::Function::Arg getArg() const;
private:
Ui::LibraryEditArgDialog *ui;
LibraryData::Function::Arg arg;
};
#endif // LIBRARYEDITARGDIALOG_H

176
gui/libraryeditargdialog.ui Normal file
View File

@ -0,0 +1,176 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>LibraryEditArgDialog</class>
<widget class="QDialog" name="LibraryEditArgDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>400</width>
<height>448</height>
</rect>
</property>
<property name="windowTitle">
<string>Edit argument</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QCheckBox" name="notbool">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
&lt;p&gt;Is bool value allowed? For instance result from comparison or from '!' operator.&lt;/p&gt;
&lt;p&gt;Typically, set this if the argument is a pointer, size, etc.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt; memcmp(x, y, i == 123); // last argument should not have a bool value&lt;/pre&gt;
&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Not bool</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notnull">
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
&lt;p&gt;Is a null parameter value allowed?&lt;/p&gt;
&lt;p&gt;Typically this should be used on any pointer parameter that does not allow null.&lt;/p&gt;
&lt;p&gt;Example:&lt;/p&gt;
&lt;pre&gt; strcpy(x,y); // neither x or y is allowed to be null.&lt;/pre&gt;
&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="text">
<string>Not null</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="notuninit">
<property name="text">
<string>Not uninit</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="strz">
<property name="text">
<string>String</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCheckBox" name="formatStr">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Format string</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="formatStrType">
<item>
<property name="text">
<string>output (like printf)</string>
</property>
</item>
<item>
<property name="text">
<string>input (like scanf)</string>
</property>
</item>
</widget>
</item>
<item>
<widget class="QCheckBox" name="formatStrSafe">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>Safe</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>Min size of buffer</string>
</property>
</widget>
</item>
<item>
<widget class="QListWidget" name="minsizes"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>Valid values</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="valid"/>
</item>
</layout>
</item>
<item>
<widget class="QDialogButtonBox" name="buttonBox">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="standardButtons">
<set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
</property>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections>
<connection>
<sender>buttonBox</sender>
<signal>accepted()</signal>
<receiver>LibraryEditArgDialog</receiver>
<slot>accept()</slot>
<hints>
<hint type="sourcelabel">
<x>222</x>
<y>433</y>
</hint>
<hint type="destinationlabel">
<x>157</x>
<y>274</y>
</hint>
</hints>
</connection>
<connection>
<sender>buttonBox</sender>
<signal>rejected()</signal>
<receiver>LibraryEditArgDialog</receiver>
<slot>reject()</slot>
<hints>
<hint type="sourcelabel">
<x>290</x>
<y>439</y>
</hint>
<hint type="destinationlabel">
<x>286</x>
<y>274</y>
</hint>
</hints>
</connection>
</connections>
</ui>