aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/ManaTools/Shared/GUI/Dialog.pm29
1 files changed, 22 insertions, 7 deletions
diff --git a/lib/ManaTools/Shared/GUI/Dialog.pm b/lib/ManaTools/Shared/GUI/Dialog.pm
index 7650507f..e5a0a884 100644
--- a/lib/ManaTools/Shared/GUI/Dialog.pm
+++ b/lib/ManaTools/Shared/GUI/Dialog.pm
@@ -114,25 +114,43 @@ has 'module' => (
);
has 'factory' => (
- is => 'rw',
+ is => 'ro',
isa => 'Maybe[yui::YWidgetFactory]',
lazy => 1,
init_arg => undef,
default => sub {
- return undef;
+ return yui::YUI::widgetFactory;
},
);
has 'optFactory' => (
- is => 'rw',
+ is => 'ro',
isa => 'Maybe[yui::YOptionalWidgetFactory]',
lazy => 1,
init_arg => undef,
default => sub {
- return undef;
+ return yui::YUI::optionalWidgetFactory;
},
);
+has 'mgaExternalFactory' => (
+ is => 'ro',
+ isa => 'Maybe[yui::YMGAWidgetFactory]',
+ lazy => 1,
+ init_arg => undef,
+ builder => '_MGAFactoryInitialize'
+);
+
+sub _MGAFactoryInitialize {
+ my $self = shift();
+
+ $self->factory(); # just to be sure default factory is initialized first
+
+ my $mageiaPlugin = "mga";
+ my $mgaFactory = yui::YExternalWidgets::externalWidgetFactory($mageiaPlugin);
+ return yui::YMGAWidgetFactory::getYMGAWidgetFactory($mgaFactory);
+}
+
has 'dialog' => (
is => 'rw',
isa => 'Maybe[yui::YDialog]',
@@ -386,9 +404,6 @@ sub call {
## set icon if not already set by external launcher
yui::YUI::app()->setApplicationIcon($self->icon());
- $self->factory(yui::YUI::widgetFactory);
- $self->optFactory(yui::YUI::optionalWidgetFactory);
-
## required fields
die "required widgets missing from YOptionalFactory" if (!$self->checkFields());