1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQPackageSelectorPlugin.cc
15 Author: Stefan Hundhammer <sh@suse.de>
17 Textdomain "packages-qt"
21 #include "YQPackageSelectorPlugin.h"
22 #define y2log_component "qt-ui"
23 #include <ycp/y2log.h>
24 #include "YQPackageSelector.h"
25 #include "YQPatternSelector.h"
26 #include "YQSimplePatchSelector.h"
27 #include "YUIException.h"
29 #define PLUGIN_BASE_NAME "qt4_pkg"
32 YQPackageSelectorPlugin::YQPackageSelectorPlugin()
33 : YPackageSelectorPlugin( PLUGIN_BASE_NAME )
37 y2milestone( "Loaded %s plugin successfully from %s",
38 PLUGIN_BASE_NAME, pluginLibFullPath().c_str() );
41 YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
45 YQPackageSelectorPlugin::~YQPackageSelectorPlugin()
52 YQPackageSelectorPlugin::createPackageSelector( YWidget * parent, long modeFlags )
57 YQPackageSelector * packageSelector = 0;
61 packageSelector = new YQPackageSelector( parent, modeFlags );
63 catch (const std::exception & e)
65 y2error( "Caught std::exception: %s", e.what() );
66 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
70 y2error( "Caught unspecified exception." );
71 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
74 YUI_CHECK_NEW( packageSelector );
76 return packageSelector;
81 YQPackageSelectorPlugin::createPatternSelector( YWidget * parent, long modeFlags )
86 YQPatternSelector * patternSelector = 0;
90 patternSelector = new YQPatternSelector( parent, modeFlags );
92 catch (const std::exception & e)
94 y2error( "Caught std::exception: %s", e.what() );
95 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
99 y2error( "Caught unspecified exception." );
100 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
103 YUI_CHECK_NEW( patternSelector );
105 return patternSelector;
109 YQSimplePatchSelector *
110 YQPackageSelectorPlugin::createSimplePatchSelector( YWidget * parent, long modeFlags )
115 YQSimplePatchSelector * simplePatchSelector = 0;
119 simplePatchSelector = new YQSimplePatchSelector( parent, modeFlags );
121 catch (const std::exception & e)
123 y2error( "Caught std::exception: %s", e.what() );
124 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
128 y2error( "Caught unspecified exception." );
129 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
132 YUI_CHECK_NEW( simplePatchSelector );
134 return simplePatchSelector;