1 /*---------------------------------------------------------------------\
3 | __ __ ____ _____ ____ |
4 | \ \ / /_ _/ ___|_ _|___ \ |
5 | \ V / _` \___ \ | | __) | |
6 | | | (_| |___) || | / __/ |
7 | |_|\__,_|____/ |_| |_____| |
11 \----------------------------------------------------------------------/
13 File: YQPackageSelectorPlugin.cc
15 Author: Stefan Hundhammer <sh@suse.de>
17 Textdomain "packages-qt"
23 #include "YQPackageSelectorPlugin.h"
24 #define y2log_component "qt-ui"
25 #include <ycp/y2log.h>
26 #include "YQPackageSelector.h"
27 #include "YQPatternSelector.h"
28 #include "YQSimplePatchSelector.h"
29 #include "YUIException.h"
31 #define PLUGIN_BASE_NAME "qt4_pkg"
34 YQPackageSelectorPlugin::YQPackageSelectorPlugin()
35 : YPackageSelectorPlugin( PLUGIN_BASE_NAME )
39 y2milestone( "Loaded %s plugin successfully from %s",
40 PLUGIN_BASE_NAME, pluginLibFullPath().c_str() );
43 YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
47 YQPackageSelectorPlugin::~YQPackageSelectorPlugin()
54 YQPackageSelectorPlugin::createPackageSelector( YWidget * parent, long modeFlags )
59 YQPackageSelector * packageSelector = 0;
63 packageSelector = new YQPackageSelector( parent, modeFlags );
65 catch (const std::exception & e)
67 y2error( "Caught std::exception: %s", e.what() );
68 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
72 y2error( "Caught unspecified exception." );
73 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
76 YUI_CHECK_NEW( packageSelector );
78 return packageSelector;
83 YQPackageSelectorPlugin::createPatternSelector( YWidget * parent, long modeFlags )
88 YQPatternSelector * patternSelector = 0;
92 patternSelector = new YQPatternSelector( parent, modeFlags );
94 catch (const std::exception & e)
96 y2error( "Caught std::exception: %s", e.what() );
97 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
101 y2error( "Caught unspecified exception." );
102 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
105 YUI_CHECK_NEW( patternSelector );
107 return patternSelector;
111 YQSimplePatchSelector *
112 YQPackageSelectorPlugin::createSimplePatchSelector( YWidget * parent, long modeFlags )
117 YQSimplePatchSelector * simplePatchSelector = 0;
121 simplePatchSelector = new YQSimplePatchSelector( parent, modeFlags );
123 catch (const std::exception & e)
125 y2error( "Caught std::exception: %s", e.what() );
126 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
130 y2error( "Caught unspecified exception." );
131 y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
134 YUI_CHECK_NEW( simplePatchSelector );
136 return simplePatchSelector;