diff --git a/gui/libraryeditargdialog.cpp b/gui/libraryeditargdialog.cpp new file mode 100644 index 000000000..91d4e274d --- /dev/null +++ b/gui/libraryeditargdialog.cpp @@ -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; +} diff --git a/gui/libraryeditargdialog.h b/gui/libraryeditargdialog.h new file mode 100644 index 000000000..d6b00bff6 --- /dev/null +++ b/gui/libraryeditargdialog.h @@ -0,0 +1,26 @@ +#ifndef LIBRARYEDITARGDIALOG_H +#define LIBRARYEDITARGDIALOG_H + +#include +#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 diff --git a/gui/libraryeditargdialog.ui b/gui/libraryeditargdialog.ui new file mode 100644 index 000000000..12f2e62fd --- /dev/null +++ b/gui/libraryeditargdialog.ui @@ -0,0 +1,176 @@ + + + LibraryEditArgDialog + + + + 0 + 0 + 400 + 448 + + + + Edit argument + + + + + + <html><head/><body> +<p>Is bool value allowed? For instance result from comparison or from '!' operator.</p> +<p>Typically, set this if the argument is a pointer, size, etc.</p> +<p>Example:</p> +<pre> memcmp(x, y, i == 123); // last argument should not have a bool value</pre> +</body></html> + + + Not bool + + + + + + + <html><head/><body> +<p>Is a null parameter value allowed?</p> +<p>Typically this should be used on any pointer parameter that does not allow null.</p> +<p>Example:</p> +<pre> strcpy(x,y); // neither x or y is allowed to be null.</pre> +</body></html> + + + Not null + + + + + + + Not uninit + + + + + + + String + + + + + + + + + + 0 + 0 + + + + Format string + + + + + + + + output (like printf) + + + + + input (like scanf) + + + + + + + + + 0 + 0 + + + + Safe + + + + + + + + + Min size of buffer + + + + + + + + + + + + Valid values + + + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + + buttonBox + accepted() + LibraryEditArgDialog + accept() + + + 222 + 433 + + + 157 + 274 + + + + + buttonBox + rejected() + LibraryEditArgDialog + reject() + + + 290 + 439 + + + 286 + 274 + + + + +