aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAngelo Naselli <anaselli@linux.it>2016-01-16 18:51:21 +0100
committerAngelo Naselli <anaselli@linux.it>2016-01-16 18:51:21 +0100
commit63cf32ef5a948d1a7f8b051fc01bb113b9c4a031 (patch)
treea0659e50f3e625cd1b75cc43b7258240a8571b14
parent71455ea5ece68b71e867576ea040643b35aeece2 (diff)
downloadmanatools-63cf32ef5a948d1a7f8b051fc01bb113b9c4a031.tar
manatools-63cf32ef5a948d1a7f8b051fc01bb113b9c4a031.tar.gz
manatools-63cf32ef5a948d1a7f8b051fc01bb113b9c4a031.tar.bz2
manatools-63cf32ef5a948d1a7f8b051fc01bb113b9c4a031.tar.xz
manatools-63cf32ef5a948d1a7f8b051fc01bb113b9c4a031.zip
Let's use our new ManaTools::Shared::GUI::ReplacePoint
-rw-r--r--lib/ManaTools/MainDisplay.pm31
1 files changed, 23 insertions, 8 deletions
diff --git a/lib/ManaTools/MainDisplay.pm b/lib/ManaTools/MainDisplay.pm
index 21c47117..eb8b8d32 100644
--- a/lib/ManaTools/MainDisplay.pm
+++ b/lib/ManaTools/MainDisplay.pm
@@ -65,7 +65,9 @@ use ManaTools::Module;
use ManaTools::Shared;
use ManaTools::Shared::GUI;
use ManaTools::Shared::GUI::Dialog;
+use ManaTools::Shared::GUI::ReplacePoint;
use ManaTools::Shared::Locales;
+
use File::ShareDir ':ALL';
use yui;
@@ -214,9 +216,12 @@ has 'rightPaneFrame' => (
has 'replacePoint' => (
is => 'rw',
- isa => 'Maybe[yui::YReplacePoint]',
+ isa => 'Maybe[ManaTools::Shared::GUI::ReplacePoint]',
init_arg => undef,
- default => undef,
+ handles => ['addEvent', 'delEvent', 'getEvent', 'addWidget', 'delWidget', 'widget', 'addItem', 'delItem', 'item'],
+ default => sub {
+ return undef;
+ }
);
has 'selectedModule' => (
@@ -470,9 +475,17 @@ sub _setupGui {
my $leftPaneFrame = $factory->createFrame($layout, $module->settings()->{category_title});
#create right Panel Frame no need to add a label for title (use setLabel when module changes)
my $rightPaneFrame = $factory->createFrame($layout, "");
+
+
+ # create a replacepoint on the tab
+ $module->replacePoint (ManaTools::Shared::GUI::ReplacePoint->new(
+ eventHandler => $self,
+ parentWidget => $rightPaneFrame
+ ));
+ my $container = $module->replacePoint->container();
+
#create replace point for dynamically created widgets
- $module->replacePoint($factory->createReplacePoint($rightPaneFrame));
- $module->rightPane($factory->createVBox($module->replacePoint()));
+ $module->rightPane($factory->createVBox($container));
$module->leftPane($factory->createVBox($leftPaneFrame));
$module->rightPaneFrame($rightPaneFrame);
@@ -508,6 +521,7 @@ sub _setupGui {
# built one is the one shown. Forcing setting again here
yui::YUI::app()->setApplicationTitle($self->title);
yui::YUI::app()->setApplicationIcon($self->icon);
+ $module->replacePoint->finished();
return $self->widget('layout');
},
@@ -568,15 +582,16 @@ sub _categorySelected {
}
## Remove existing modules
- $self->replacePoint()->deleteChildren();
- $self->rightPane($self->factory()->createVBox($self->replacePoint()));
+ $self->replacePoint->clear();
+ $self->rightPane($self->factory()->createVBox($self->replacePoint->container()));
## Add new Module Buttons to Right Pane
$self->currCategory()->addButtons($self);
$self->rightPaneFrame()->setLabel($self->currCategory()->name());
$self->factory()->createSpacing($self->rightPane(), 1, 1, 1.0 );
- $self->replacePoint()->showChild();
- $ydialog->recalcLayout();
+
+ $self->replacePoint->finished();
+
$ydialog->doneMultipleChanges();
return 1;