|
@@ -18,6 +18,11 @@
|
|
|
#include <QFileDialog>
|
|
|
#include <QKeyEvent>
|
|
|
|
|
|
+//! A constructor
|
|
|
+/*!
|
|
|
+ * Constructor is responsible for allocating memory for all the GUI,
|
|
|
+ * arranging and connecting them in the right order.
|
|
|
+ */
|
|
|
OptionsForm::OptionsForm(QWidget *aParent)
|
|
|
: QWidget(aParent)
|
|
|
{
|
|
@@ -75,12 +80,14 @@ OptionsForm::OptionsForm(QWidget *aParent)
|
|
|
SLOT(onPathEditing())
|
|
|
);
|
|
|
|
|
|
+ /* moving it to the center of the screen */
|
|
|
move(QApplication::desktop()->screen()->rect().center() - rect().center());
|
|
|
}
|
|
|
|
|
|
+//! A destructor
|
|
|
OptionsForm::~OptionsForm()
|
|
|
{
|
|
|
- delete auto_color_generation_;
|
|
|
+ delete auto_color_generation_box_;
|
|
|
delete button_set_PASCAL_root_;
|
|
|
delete edit_PASCAL_root_;
|
|
|
delete button_ok_;
|
|
@@ -89,6 +96,7 @@ OptionsForm::~OptionsForm()
|
|
|
delete layout_v_;
|
|
|
}
|
|
|
|
|
|
+//! A slot member confirming all the changes in options
|
|
|
void
|
|
|
OptionsForm::setOptions()
|
|
|
{
|
|
@@ -96,6 +104,7 @@ OptionsForm::setOptions()
|
|
|
hide();
|
|
|
}
|
|
|
|
|
|
+//! Sets a pointer on the ImageLabeler::PASCALpath_
|
|
|
void
|
|
|
OptionsForm::setPASCALpath(QString *aPath)
|
|
|
{
|
|
@@ -107,6 +116,7 @@ OptionsForm::setPASCALpath(QString *aPath)
|
|
|
PASCALpath_ = aPath;
|
|
|
}
|
|
|
|
|
|
+//! Asks user for the new path to the PASCAL "root" folder
|
|
|
void
|
|
|
OptionsForm::newPascalPath()
|
|
|
{
|
|
@@ -129,12 +139,14 @@ OptionsForm::newPascalPath()
|
|
|
edit_PASCAL_root_->setText(newPath);
|
|
|
}
|
|
|
|
|
|
+//! Returns auto_color_generation_box_ status
|
|
|
bool
|
|
|
OptionsForm::autoColorGeneration()
|
|
|
{
|
|
|
return auto_color_generation_box_->isChecked();
|
|
|
}
|
|
|
|
|
|
+//! Sets auto_color_generation_box_ status
|
|
|
void
|
|
|
OptionsForm::setAutoColorGeneration(bool *flag)
|
|
|
{
|
|
@@ -142,6 +154,7 @@ OptionsForm::setAutoColorGeneration(bool *flag)
|
|
|
auto_color_generation_ = flag;
|
|
|
}
|
|
|
|
|
|
+//! A slot member showing the form and initializing widgets
|
|
|
void
|
|
|
OptionsForm::showOptions()
|
|
|
{
|
|
@@ -158,6 +171,7 @@ OptionsForm::showOptions()
|
|
|
show();
|
|
|
}
|
|
|
|
|
|
+//! A slot member validating path to the PASCAL "root" folder typed by user
|
|
|
void
|
|
|
OptionsForm::onPathEditing()
|
|
|
{
|
|
@@ -169,6 +183,7 @@ OptionsForm::onPathEditing()
|
|
|
edit_PASCAL_root_->setText(*PASCALpath_);
|
|
|
}
|
|
|
|
|
|
+//! An event which is automatically called on every key press
|
|
|
void
|
|
|
OptionsForm::keyPressEvent(QKeyEvent *anEvent)
|
|
|
{
|