Author: aschnell
Date: Wed Jan 14 12:50:12 2009
New Revision: 54612
URL: http://svn.opensuse.org/viewcvs/yast?rev=54612&view=rev
Log:
- backup
Added:
branches/tmp/aschnell/graph/qt/src/YQGraphPluginIf.h
branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.cc
branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.h
Modified:
branches/tmp/aschnell/graph/qt/src/CMakeLists.txt
branches/tmp/aschnell/graph/qt/src/YQApplication.cc
branches/tmp/aschnell/graph/qt/src/YQApplication.h
branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.cc
branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.h
Modified: branches/tmp/aschnell/graph/qt/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt/src/CMakeLists.txt?rev=54612&r1=54611&r2=54612&view=diff
==============================================================================
--- branches/tmp/aschnell/graph/qt/src/CMakeLists.txt (original)
+++ branches/tmp/aschnell/graph/qt/src/CMakeLists.txt Wed Jan 14 12:50:12 2009
@@ -52,6 +52,7 @@
YQMultiSelectionBox.cc
YQOptionalWidgetFactory.cc
YQPackageSelectorPluginStub.cc
+ YQGraphPluginStub.cc
YQPartitionSplitter.cc
YQProgressBar.cc
YQPushButton.cc
@@ -116,6 +117,8 @@
YQOptionalWidgetFactory.h
YQPackageSelectorPluginIf.h
YQPackageSelectorPluginStub.h
+ YQGraphPluginIf.h
+ YQGraphPluginStub.h
YQPartitionSplitter.h
YQProgressBar.h
YQPushButton.h
Modified: branches/tmp/aschnell/graph/qt/src/YQApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt/src/YQApplication.cc?rev=54612&r1=54611&r2=54612&view=diff
==============================================================================
--- branches/tmp/aschnell/graph/qt/src/YQApplication.cc (original)
+++ branches/tmp/aschnell/graph/qt/src/YQApplication.cc Wed Jan 14 12:50:12 2009
@@ -41,6 +41,7 @@
#include "YQApplication.h"
#include "YQPackageSelectorPluginStub.h"
+#include "YQGraphPluginStub.h"
YQApplication::YQApplication()
@@ -727,5 +728,23 @@
}
+YQGraphPluginStub *
+YQApplication::graphPlugin()
+{
+ static YQGraphPluginStub * plugin = 0;
+
+ if ( ! plugin )
+ {
+ plugin = new YQGraphPluginStub();
+
+ // This is a deliberate memory leak: If an application requires a
+ // Graph, it is a package selection application by
+ // definition. In this case, the ncurses_pkg plugin is intentionally
+ // kept open to avoid repeated start-up cost of the plugin and libzypp.
+ }
+
+ return plugin;
+}
+
#include "YQApplication.moc"
Modified: branches/tmp/aschnell/graph/qt/src/YQApplication.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt/src/YQApplication.h?rev=54612&r1=54611&r2=54612&view=diff
==============================================================================
--- branches/tmp/aschnell/graph/qt/src/YQApplication.h (original)
+++ branches/tmp/aschnell/graph/qt/src/YQApplication.h Wed Jan 14 12:50:12 2009
@@ -25,10 +25,12 @@
#include
#include "YQPackageSelectorPluginStub.h"
+#include "YQGraphPluginStub.h"
#include "YApplication.h"
class QSettings;
class YQPackageSelectorPlugin;
+class YQGraphPlugin;
class YQApplication: public QObject, public YApplication
@@ -215,6 +217,12 @@
static YQPackageSelectorPluginStub * packageSelectorPlugin();
/**
+ * Return the package selector plugin singleton or creates it
+ * (including loading the plugin lib) if it does not exist yet.
+ **/
+ static YQGraphPluginStub * graphPlugin();
+
+ /**
* A mouse click with the wrong mouse button was detected - e.g., a right
* click on a push button. The user might be left-handed, but his mouse
* might not (yet) be configured for left-handed use - e.g., during
Added: branches/tmp/aschnell/graph/qt/src/YQGraphPluginIf.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt/src/YQGraphPluginIf.h?rev=54612&view=auto
==============================================================================
--- branches/tmp/aschnell/graph/qt/src/YQGraphPluginIf.h (added)
+++ branches/tmp/aschnell/graph/qt/src/YQGraphPluginIf.h Wed Jan 14 12:50:12 2009
@@ -0,0 +1,37 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (c) SuSE Linux AG |
+\----------------------------------------------------------------------/
+
+ File: YQGraphPluginIf.h
+
+ Author: Arvin Schnell
+
+/-*/
+
+#ifndef YQGraphPluginIf_h
+#define YQGraphPluginIf_h
+
+#include
+#include
+#include
+
+class YQGraphPluginIf
+{
+
+public:
+
+ virtual ~YQGraphPluginIf() {}
+
+ virtual YGraph *createGraph( YWidget *parent ) = 0;
+
+};
+
+#endif
Added: branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.cc?rev=54612&view=auto
==============================================================================
--- branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.cc (added)
+++ branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.cc Wed Jan 14 12:50:12 2009
@@ -0,0 +1,58 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (c) SuSE Linux AG |
+\----------------------------------------------------------------------/
+
+ File: YQGraphPluginStub.cc
+
+ Author: Arvin Schnell
+
+/-*/
+
+#include "YQGraphPluginStub.h"
+
+#define YUILogComponent "qt-ui"
+#include "YUILog.h"
+
+#define PLUGIN_BASE_NAME "qt_graph"
+
+YQGraphPluginStub::YQGraphPluginStub()
+ : YGraphPlugin( PLUGIN_BASE_NAME )
+{
+ if ( success() )
+ {
+ yuiMilestone() << "Loaded " << PLUGIN_BASE_NAME
+ << " plugin successfully from " << pluginLibFullPath()
+ << endl;
+ }
+
+ impl = (YQGraphPluginIf*) locateSymbol("GP");
+
+ if ( ! impl )
+ {
+ yuiError() << "Plugin " << PLUGIN_BASE_NAME << " does not provide GP symbol" << endl;
+ }
+}
+
+
+YQGraphPluginStub::~YQGraphPluginStub()
+{
+ // NOP
+}
+
+
+YGraph *
+YQGraphPluginStub::createGraph( YWidget * parent )
+{
+ if ( ! impl )
+ YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
+
+ return impl->createGraph( parent );
+}
Added: branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.h?rev=54612&view=auto
==============================================================================
--- branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.h (added)
+++ branches/tmp/aschnell/graph/qt/src/YQGraphPluginStub.h Wed Jan 14 12:50:12 2009
@@ -0,0 +1,61 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (c) SuSE Linux AG |
+\----------------------------------------------------------------------/
+
+ File: YQGraphPluginStub.h
+
+ Author: Arvin Schnell
+
+/-*/
+
+#ifndef YQGraphPluginStub_h
+#define YQGraphPluginStub_h
+
+#include
+#include
+#include
+
+#include "YQGraphPluginIf.h"
+
+
+/**
+ * Simplified access to the package selector plugin.
+ **/
+class YQGraphPluginIf;
+
+
+class YQGraphPluginStub : public YGraphPlugin
+{
+public:
+ /**
+ * Constructor: Load the plugin library for the package selector.
+ **/
+ YQGraphPluginStub();
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YQGraphPluginStub();
+
+ /**
+ * Create a package selector.
+ * Implemented from YGraphPlugin.
+ *
+ * This might return 0 if the plugin lib could not be loaded or if the
+ * appropriate symbol could not be located in the plugin lib.
+ **/
+ virtual YGraph * createGraph( YWidget * parent );
+
+ YQGraphPluginIf * impl ;
+};
+
+
+#endif // YQGraphPluginStub_h
Modified: branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.cc?rev=54612&r1=54611&r2=54612&view=diff
==============================================================================
--- branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.cc (original)
+++ branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.cc Wed Jan 14 12:50:12 2009
@@ -22,6 +22,8 @@
#include "YQPackageSelectorPluginStub.h"
#include "YQWizard.h"
#include "YQTimezoneSelector.h"
+#include "YQGraphPluginStub.h"
+
#define THROW_UNSUPPORTED( WIDGET_TYPE ) \
YUI_THROW( YUIUnsupportedWidgetException( WIDGET_TYPE ) ); \
@@ -249,6 +251,27 @@
return new YQTimezoneSelector( parent, pixmap, timezones );
}
+
+bool YQOptionalWidgetFactory::hasGraph()
+{
+ YQGraphPluginStub * plugin = YQApplication::graphPlugin();
+
+ return plugin != NULL;
+}
+
+
+YGraph *
+YQOptionalWidgetFactory::createGraph( YWidget * parent )
+{
+ YQGraphPluginStub * plugin = YQApplication::graphPlugin();
+
+ if ( plugin )
+ return plugin->createGraph( parent );
+ else
+ return 0;
+}
+
+
YWidget *
YQOptionalWidgetFactory::createPatternSelector(YWidget* parent, long modeFlags)
{
Modified: branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.h?rev=54612&r1=54611&r2=54612&view=diff
==============================================================================
--- branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.h (original)
+++ branches/tmp/aschnell/graph/qt/src/YQOptionalWidgetFactory.h Wed Jan 14 12:50:12 2009
@@ -113,6 +113,9 @@
const string & pixmap,
const map & timezones );
+ virtual bool hasGraph();
+ virtual YGraph * createGraph( YWidget * parent );
+
protected:
friend class YQUI;
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org