Skip to content
Snippets Groups Projects
Commit 622901cb authored by Provot Bertrand's avatar Provot Bertrand
Browse files

update window name depending on filters + bug fixes on filer choice and editoritem

parent 94f2ba2a
No related branches found
No related tags found
No related merge requests found
...@@ -33,9 +33,6 @@ using namespace imagein::algorithm; ...@@ -33,9 +33,6 @@ using namespace imagein::algorithm;
void FilteringService::display(GenericInterface* gi) void FilteringService::display(GenericInterface* gi)
{ {
AlgorithmService::display(gi); AlgorithmService::display(gi);
// _filtering = _toolBar->addAction("&Filtering");
// _filterEdition = _toolBar->addAction("&FilterEditor");
QMenu* menu = gi->menu(qApp->translate("", "Filtering")); QMenu* menu = gi->menu(qApp->translate("", "Filtering"));
_filtering = menu->addAction(tr("&Apply filter")); _filtering = menu->addAction(tr("&Apply filter"));
_filtering->setEnabled(false); _filtering->setEnabled(false);
...@@ -50,7 +47,6 @@ void FilteringService::checkActionsValid(const QWidget* activeWidget) { ...@@ -50,7 +47,6 @@ void FilteringService::checkActionsValid(const QWidget* activeWidget) {
void FilteringService::connect(GenericInterface* gi) void FilteringService::connect(GenericInterface* gi)
{ {
AlgorithmService::connect(gi); AlgorithmService::connect(gi);
QObject::connect(_filtering, SIGNAL(triggered()), this, SLOT(applyFiltering())); QObject::connect(_filtering, SIGNAL(triggered()), this, SLOT(applyFiltering()));
QObject::connect(_filterEdition, SIGNAL(triggered()), this, SLOT(edition())); QObject::connect(_filterEdition, SIGNAL(triggered()), this, SLOT(edition()));
QObject::connect(gi->windowService(), SIGNAL(activeWidgetChanged(const QWidget*)), this, SLOT(checkActionsValid(const QWidget*))); QObject::connect(gi->windowService(), SIGNAL(activeWidgetChanged(const QWidget*)), this, SLOT(checkActionsValid(const QWidget*)));
...@@ -65,8 +61,6 @@ void FilteringService::applyFiltering() ...@@ -65,8 +61,6 @@ void FilteringService::applyFiltering()
_filterChoice = new FilterChoice(_gi); _filterChoice = new FilterChoice(_gi);
_filterChoice->setDoubleResult(siw->isDouble()); _filterChoice->setDoubleResult(siw->isDouble());
// QMdiArea* area = (QMdiArea*)_gi->centralWidget();
// area->addSubWindow(_filterChoice);
QDialog::DialogCode code = static_cast<QDialog::DialogCode>(_filterChoice->exec()); QDialog::DialogCode code = static_cast<QDialog::DialogCode>(_filterChoice->exec());
if(code!=QDialog::Accepted) { if(code!=QDialog::Accepted) {
...@@ -84,17 +78,10 @@ void FilteringService::edition() ...@@ -84,17 +78,10 @@ void FilteringService::edition()
{ {
_filterEditor = new FilterEditor(); _filterEditor = new FilterEditor();
_filterEditor->exec(); _filterEditor->exec();
//QMdiArea* area = (QMdiArea*)_gi->centralWidget();
//area->addSubWindow(_filterEditor);
// StandardImageWindow* siw = dynamic_cast<StandardImageWindow*>(_ws->getCurrentImageWindow());
// _ws->addWidget(_ws->getNodeId(siw), _filterEditor);
//_filterEditor->show();
} }
void FilteringService::applyAlgorithm(Filtering* algo) void FilteringService::applyAlgorithm(Filtering* algo)
{ {
//StandardImageWindow* siw = dynamic_cast<StandardImageWindow*>(_ws->getCurrentImageWindow());
if (_siw != NULL) if (_siw != NULL)
{ {
const Image_t<double>* image; const Image_t<double>* image;
...@@ -129,7 +116,7 @@ void FilteringService::applyAlgorithm(Filtering* algo) ...@@ -129,7 +116,7 @@ void FilteringService::applyAlgorithm(Filtering* algo)
delete intResImg; delete intResImg;
riw = new StandardImageWindow(resImg, _siw->getPath()); riw = new StandardImageWindow(resImg, _siw->getPath());
} }
riw->setWindowTitle(_siw->windowTitle()); riw->setWindowTitle(_siw->windowTitle() + " - " + _filterChoice->getFilterName());
emit newImageWindowCreated(_ws->getNodeId(_siw), riw); emit newImageWindowCreated(_ws->getNodeId(_siw), riw);
} }
} }
...@@ -609,6 +609,10 @@ void FilterChoice::updatePath(){ ...@@ -609,6 +609,10 @@ void FilterChoice::updatePath(){
updateBlur(true); updateBlur(true);
} }
/**
* @brief FilterChoice::updateOptions
* @param a
*/
void FilterChoice::updateOptions(bool a){ void FilterChoice::updateOptions(bool a){
if(a){ if(a){
_offsetButton->setChecked(true); _offsetButton->setChecked(true);
......
...@@ -53,6 +53,7 @@ namespace filtrme ...@@ -53,6 +53,7 @@ namespace filtrme
public: public:
FilterChoice(QWidget *parent); FilterChoice(QWidget *parent);
inline imagein::algorithm::Filtering* getFiltering() { return _filtering; } inline imagein::algorithm::Filtering* getFiltering() { return _filtering; }
inline QString getFilterName(){ return _blurChoices->currentText();}
inline bool doubleResult() { return _dblResButton->isChecked(); } inline bool doubleResult() { return _dblResButton->isChecked(); }
inline bool scalingResult() { return _scalingButton->isChecked(); } inline bool scalingResult() { return _scalingButton->isChecked(); }
inline bool offsetResult() { return _offsetButton->isChecked(); } inline bool offsetResult() { return _offsetButton->isChecked(); }
......
...@@ -105,16 +105,15 @@ void FilterEditorItem::initUI() ...@@ -105,16 +105,15 @@ void FilterEditorItem::initUI()
*/ */
void FilterEditorItem::widthChanged(const int width) void FilterEditorItem::widthChanged(const int width)
{ {
cout << "diff de width: " << width << " | " << _width << "\n";
if(_width < width){ if(_width < width){
while(_width!=width){ while(_width!=width){
emit(insertColumn(width-_width)); emit(insertColumn(_width-1));
_width++; _width++;
} }
} }
else{ else{
while(_width!=width){ while(_width!=width){
emit(removeColumn(_width-width)); emit(removeColumn(_width-1));
_width--; _width--;
} }
} }
...@@ -125,13 +124,13 @@ void FilterEditorItem::heightChanged(const int height) ...@@ -125,13 +124,13 @@ void FilterEditorItem::heightChanged(const int height)
{ {
if(_height < height){ if(_height < height){
while(_height!=height){ while(_height!=height){
emit(insertRow(height-_height)); emit(insertRow(_height - 1));
_height++; _height++;
} }
} }
else{ else{
while(_height!=height){ while(_height!=height){
emit(removeRow(_height-height)); emit(removeRow(_height- 1));
_height--; _height--;
} }
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment