YaST Commits
Threads by month
- ----- 2024 -----
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2007 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
June 2007
- 27 participants
- 490 discussions
[yast-commit] r39061 - in /branches/tmp/mvidner/ui-as-namespace: core/base/src/ core/base/tools/ycpc/ core/liby2/src/ core/liby2/src/include/y2/ core/libycp/src/ core/libyui/doc/ core/libyui/src/ core/libyui/tes...
by mvidner@svn.opensuse.org 27 Jun '07
by mvidner@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: mvidner
Date: Wed Jun 27 18:25:12 2007
New Revision: 39061
URL: http://svn.opensuse.org/viewcvs/yast?rev=39061&view=rev
Log:
First version where we can call UI from Perl
(but gtk segfaults)
Added:
branches/tmp/mvidner/ui-as-namespace/core/libyui/doc/namespace
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2CCUI.cc
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2CCUI.h
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2UINamespace.cc
- copied, changed from r39050, branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI_bindings.cc
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2UINamespace.h
Removed:
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/UI.h
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI_bindings.cc
Modified:
branches/tmp/mvidner/ui-as-namespace/core/base/src/Makefile.am
branches/tmp/mvidner/ui-as-namespace/core/base/tools/ycpc/Makefile.am
branches/tmp/mvidner/ui-as-namespace/core/base/tools/ycpc/ycpc.cc
branches/tmp/mvidner/ui-as-namespace/core/liby2/src/Y2ComponentBroker.cc
branches/tmp/mvidner/ui-as-namespace/core/liby2/src/Y2PluginComponent.cc
branches/tmp/mvidner/ui-as-namespace/core/liby2/src/genericfrontend.cc
branches/tmp/mvidner/ui-as-namespace/core/liby2/src/include/y2/Y2PluginComponent.h
branches/tmp/mvidner/ui-as-namespace/core/libycp/src/Import.cc
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/ (props changed)
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Makefile.am
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI.h
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUIComponent.cc
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUIComponent.h
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI_core.cc
branches/tmp/mvidner/ui-as-namespace/core/libyui/testsuite/Makefile.am
branches/tmp/mvidner/ui-as-namespace/core/wfm/src/Makefile.am
branches/tmp/mvidner/ui-as-namespace/core/wfm/src/Y2CCWFM.cc
branches/tmp/mvidner/ui-as-namespace/core/wfm/testsuite/Makefile.am
branches/tmp/mvidner/ui-as-namespace/core/wfm/testsuite/runc.cc
branches/tmp/mvidner/ui-as-namespace/gtk/configure.in.in
branches/tmp/mvidner/ui-as-namespace/gtk/src/Makefile.am
branches/tmp/mvidner/ui-as-namespace/gtk/src/Y2CCGtk.cc
branches/tmp/mvidner/ui-as-namespace/ncurses/src/Makefile.am
branches/tmp/mvidner/ui-as-namespace/ncurses/src/Y2CCNCursesUI.h
branches/tmp/mvidner/ui-as-namespace/ncurses/src/pkg/Makefile.am
branches/tmp/mvidner/ui-as-namespace/ncurses/testsuite/Makefile.am
branches/tmp/mvidner/ui-as-namespace/qt/src/Makefile.am
branches/tmp/mvidner/ui-as-namespace/qt/src/Y2CCQt.h
branches/tmp/mvidner/ui-as-namespace/qt/src/pkg/Makefile.am
Modified: branches/tmp/mvidner/ui-as-namespace/core/base/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/base/src/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/base/src/Makefile.am Wed Jun 27 18:25:12 2007
@@ -10,7 +10,6 @@
../../wfm/src/libpy2wfm.la \
../../libycp/src/libycp.la \
../../liby2/src/liby2.la \
- ../../libyui/src/libyui.la \
../../libscr/src/libscr.la
# ../../scr/src/libpy2scr.la
Modified: branches/tmp/mvidner/ui-as-namespace/core/base/tools/ycpc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/base/tools/ycpc/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/base/tools/ycpc/Makefile.am Wed Jun 27 18:25:12 2007
@@ -17,7 +17,7 @@
bin_PROGRAMS = ycpc
ycpc_SOURCES = ycpc.cc
ycpc_LDADD = $(top_builddir)/libycp/src/libycp.la \
- $(top_builddir)/libyui/src/libyui.la \
+ $(top_builddir)/libyui/src/libpy2UI.la \
$(top_builddir)/wfm/src/libpy2wfm.la \
$(top_builddir)/liby2/src/liby2.la \
$(top_builddir)/libscr/src/libscr.la \
Modified: branches/tmp/mvidner/ui-as-namespace/core/base/tools/ycpc/ycpc.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/base/tools/ycpc/ycpc.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/base/tools/ycpc/ycpc.cc Wed Jun 27 18:25:12 2007
@@ -29,7 +29,6 @@
#include <y2/Y2Component.h>
#include <y2/Y2ComponentBroker.h>
-#include <UI.h>
#include <scr/SCR.h>
#include <WFM.h>
@@ -1298,7 +1297,6 @@
// register builtins
SCR scr;
WFM wfm;
- UI ui;
if ((compile == parse) // both are zero
&& (compile == freshen)
Modified: branches/tmp/mvidner/ui-as-namespace/core/liby2/src/Y2ComponentBroker.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/liby2/src/Y2ComponentBroker.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/liby2/src/Y2ComponentBroker.cc Wed Jun 27 18:25:12 2007
@@ -121,11 +121,11 @@
{
string comp_name = exi->second;
- Y2Component *comp = Y2ComponentBroker::createComponent (comp_name.c_str (), true);
+ Y2Component *comp = createClient (comp_name.c_str ());
if (! comp)
{
// no client component, try server as well
- comp = Y2ComponentBroker::createComponent (comp_name.c_str (), false);
+ comp = Y2ComponentBroker::createServer (comp_name.c_str ());
}
if (comp)
Modified: branches/tmp/mvidner/ui-as-namespace/core/liby2/src/Y2PluginComponent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/liby2/src/Y2PluginComponent.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/liby2/src/Y2PluginComponent.cc Wed Jun 27 18:25:12 2007
@@ -128,6 +128,23 @@
}
+Y2Namespace*
+Y2PluginComponent::import (const char* name_space)
+{
+ if (!handle)
+ {
+ loadPlugin ();
+ }
+
+ if (!comp)
+ {
+ return 0;
+ }
+
+ return comp->import (name_space);
+}
+
+
void
Y2PluginComponent::result (const YCPValue& result)
{
Modified: branches/tmp/mvidner/ui-as-namespace/core/liby2/src/genericfrontend.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/liby2/src/genericfrontend.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/liby2/src/genericfrontend.cc Wed Jun 27 18:25:12 2007
@@ -427,6 +427,7 @@
exit (1);
}
+ Y2ComponentBroker::registerNamespaceException ("UI", server_name);
Y2Component *server = Y2ComponentBroker::createServer (server_name);
if (!server) {
print_error ("No such server module %s", server_name);
Modified: branches/tmp/mvidner/ui-as-namespace/core/liby2/src/include/y2/Y2PluginComponent.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/liby2/src/include/y2/Y2PluginComponent.h (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/liby2/src/include/y2/Y2PluginComponent.h Wed Jun 27 18:25:12 2007
@@ -102,6 +102,8 @@
* Returns the SCRAgent of the Y2Component or NULL if it doesn't have one.
*/
SCRAgent* getSCRAgent ();
+
+ Y2Namespace* import (const char* name_space);
/**
* Tells this server, that the client doesn't need it's services
Modified: branches/tmp/mvidner/ui-as-namespace/core/libycp/src/Import.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libycp/src/Import.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/libycp/src/Import.cc Wed Jun 27 18:25:12 2007
@@ -98,6 +98,8 @@
return -1;
}
+ y2debug ("Component found: %s", comp->name().c_str());
+
name_space = comp->import (cname); // do the bytecode import
if (name_space == NULL)
{
Added: branches/tmp/mvidner/ui-as-namespace/core/libyui/doc/namespace
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/doc/namespace (added)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/doc/namespace Wed Jun 27 18:25:12 2007
@@ -0,0 +1,40 @@
+Converting the UI functions from builtins to a namespace
+
+Why?
+----
+
+So that they can be called from yast2-perl-bindings (and python and ruby,
+coming soon).
+
+Usage
+-----
+
+TODO add the example
+
+How?
+----
+Makefiles: use -lpy2UI instead of -lyui. that should get wrapped properly in
+yast2-core.pc
+Remove references to the UI class.
+
+* liby2
+implement "import" also in Y2PluginComponent because the abstract UI becomes
+one.
+
+genericfrontend: because the abstract UI is now instantiable, register a
+namespace override to the server specified in argv
+
+
+* libyui
+
+Y2CCUI, YUIComponent : make the base UI instantiable so that ycpc can work
+without a real one. Implement the import method.
+
+Y2UINamespace: created, copying code from YUI_bindings.
+- FIXME overloading
+- FIXME macro player
+
+Removed UI.h that served to register the builtins. (TODO: the docs is still
+done in builtin style. Take it as inspiration.)
+
+TODO: test that threads work
Modified: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Makefile.am Wed Jun 27 18:25:12 2007
@@ -7,16 +7,17 @@
-DPLUGINDIR=\"${plugindir}\" \
-fmessage-length=0
-lib_LTLIBRARIES = libyui.la
+plugin_LTLIBRARIES = libpy2UI.la
-libyui_la_SOURCES = \
+libpy2UI_la_SOURCES = \
YUIComponent.cc \
YUI_core.cc \
YUI_builtins.cc \
YUI_widgets.cc \
YUI_special_widgets.cc \
- YUI_bindings.cc \
YUI_util.cc \
+ Y2UINamespace.cc \
+ Y2CCUI.cc \
YUIPlugin.cc \
\
YAlignment.cc \
@@ -72,9 +73,10 @@
pkginclude_HEADERS = \
YUIComponent.h \
+ Y2UINamespace.h \
+ Y2CCUI.h \
YUI.h \
YUI_util.h \
- UI.h \
YUISymbols.h \
YUIPlugin.h \
YPackageSelectorPlugin.h \
@@ -137,10 +139,17 @@
-I$(top_srcdir)/liby2/src/include \
${Y2UTIL_CFLAGS}
-libyui_la_LDFLAGS = -version-info 2:0
-libyui_la_LIBADD = -lpthread
+libpy2UI_la_LDFLAGS = -version-info 2:0
+libpy2UI_la_LIBADD = -lpthread
-CLEANFILES = libyui.kdoc
+# "foo bar: baz" is wrong
+# see "info '(automake)Multiple Outputs'"
+%BuiltinCalls.h %BuiltinTable.h : Y2%Namespace.h
+ ${ydatadir}/devtools/bin/generateYCPWrappers $< $*BuiltinCalls.h $*BuiltinTable.h
+
+BUILT_SOURCES = UIBuiltinTable.h UIBuiltinCalls.h
+
+CLEANFILES = libyui.kdoc $(BUILT_SOURCES)
#<INSTALL-HEADER-TARGET>
Added: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2CCUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2CCUI.cc (added)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2CCUI.cc Wed Jun 27 18:25:12 2007
@@ -0,0 +1,52 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: Y2CCUI.cc
+
+ Author: Stanislav Visnovsky <visnov(a)suse.cz>
+ Maintainer: Stanislav Visnovsky <visnov(a)suse.cz>
+
+/-*/
+/*
+ * Component Creator that executes access to UI
+ *
+ * Author: Stanislav Visnovsky <visnov(a)suse.cz>
+ */
+
+
+#include <ycp/y2log.h>
+#include <y2/Y2Component.h>
+#include "Y2CCUI.h"
+#include "YUIComponent.h"
+
+Y2Component* Y2CCUI::provideNamespace(const char* name)
+{
+ y2debug ("UI library namespace provider tries for '%s'", name);
+ if (strcmp (name, "UI") == 0)
+ {
+ Y2Component* ret = YUIComponent::uiComponent ();
+ if (ret == 0)
+ {
+ y2milestone ("Creating UI library component");
+ ret = new YUIComponent;
+ }
+
+ return ret;
+ }
+ else
+ {
+ return NULL;
+ }
+}
+
+// Create global variable to register this component creator
+Y2CCUI g_y2ccUI;
Added: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2CCUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2CCUI.h (added)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2CCUI.h Wed Jun 27 18:25:12 2007
@@ -0,0 +1,49 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: Y2CCUI.h
+
+ Author: Stanislav Visnovsky <visnov(a)suse.de>
+ Maintainer: Stanislav Visnovsky <visnov(a)suse.de>
+
+/-*/
+// -*- c++ -*-
+
+/*
+ * Component Creator that executes access to UI
+ *
+ * Author: Stanislav Visnovsky <visnov(a)suse.de>
+ */
+
+#ifndef Y2CCUI_h
+#define Y2CCUI_h
+
+#include <y2/Y2ComponentCreator.h>
+
+class Y2Component;
+
+class Y2CCUI : public Y2ComponentCreator
+{
+
+public:
+ Y2CCUI () : Y2ComponentCreator (Y2ComponentBroker::BUILTIN) {}
+
+ virtual bool isServerCreator () const { return true; };
+
+ /**
+ * We provide the UI namespace
+ */
+ virtual Y2Component *provideNamespace(const char *name);
+};
+
+
+#endif // Y2CCUI_h
Copied: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2UINamespace.cc (from r39050, branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI_bindings.cc)
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI_bindings.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2UINamespace.cc Wed Jun 27 18:25:12 2007
@@ -10,7 +10,7 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YUI_bindings.cc
+ File: Y2UINamespace.cc
Authors: Klaus Kaempf <kkaempf(a)suse.de>
Stanislav Visnovsky <visnov(a)suse.cz>
@@ -20,23 +20,22 @@
/-*/
-#include "UI.h"
#include "ycp/YCPBoolean.h"
#include "ycp/YCPInteger.h"
#include "ycp/YCPVoid.h"
#include "ycp/YCPString.h"
-#include "ycp/YCPCode.h"
-#include "ycp/StaticDeclaration.h"
+#include "y2/Y2Function.h"
#define y2log_component "ui"
#include "ycp/y2log.h"
#include "YUI.h"
#include "YUIComponent.h"
+#include "Y2UINamespace.h"
-static YCPValue
-UISetLanguage( const YCPString & language )
+YCPValue
+Y2UINamespace::SetLanguage( const YCPString & language )
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateSetLanguage( language );
@@ -45,8 +44,8 @@
}
-static YCPValue
-UISetLanguageAndEncoding( const YCPString & language, const YCPString & encoding )
+YCPValue
+Y2UINamespace::SetLanguage( const YCPString & language, const YCPString & encoding )
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateSetLanguage( language, encoding );
@@ -55,8 +54,8 @@
}
-static YCPValue
-UIGetProductName()
+YCPValue
+Y2UINamespace::GetProductName()
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateGetProductName();
@@ -65,8 +64,8 @@
}
-static YCPValue
-UISetProductName( const YCPString & name )
+YCPValue
+Y2UINamespace::SetProductName( const YCPString & name )
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateSetProductName( name );
@@ -75,8 +74,8 @@
}
-static YCPValue
-UISetConsoleFont( const YCPString & console_magic,
+YCPValue
+Y2UINamespace::SetConsoleFont( const YCPString & console_magic,
const YCPString & font,
const YCPString & screen_map,
const YCPString & unicode_map,
@@ -92,8 +91,8 @@
}
-static YCPValue
-UISetKeyboard()
+YCPValue
+Y2UINamespace::SetKeyboard()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateSetKeyboard();
@@ -101,17 +100,9 @@
return YCPVoid();
}
-static YCPValue
-UIRunInTerminal( const YCPString &module )
-{
- if (YUIComponent::ui() )
- return YUIComponent::ui()->evaluateRunInTerminal( module );
- else
- return YCPVoid();
-}
-static YCPValue
-UIGetLanguage( const YCPBoolean & strip )
+YCPValue
+Y2UINamespace::GetLanguage( const YCPBoolean & strip )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateGetLanguage( strip );
@@ -121,17 +112,23 @@
YCPValue
-UIUserInput()
+Y2UINamespace::RunInTerminal( const YCPString &module )
{
- if ( YUIComponent::ui() )
- return YUIComponent::ui()->evaluateUserInput();
+ if (YUIComponent::ui() )
+ return YUIComponent::ui()->evaluateRunInTerminal( module );
else
- return YCPVoid();
+ return YCPVoid();
}
+YCPValue
+Y2UINamespace::UserInput()
+{
+ return m_comp->ui()->evaluateUserInput();
+}
-static YCPValue
-UIPollInput()
+
+YCPValue
+Y2UINamespace::PollInput()
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluatePollInput();
@@ -141,7 +138,7 @@
YCPValue
-UITimeoutUserInput( const YCPInteger& timeout )
+Y2UINamespace::TimeoutUserInput( const YCPInteger& timeout )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateTimeoutUserInput( timeout );
@@ -151,7 +148,7 @@
YCPValue
-UIWaitForEvent()
+Y2UINamespace::WaitForEvent()
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateWaitForEvent();
@@ -161,7 +158,7 @@
YCPValue
-UIWaitForEventTimeout( const YCPInteger & timeout )
+Y2UINamespace::WaitForEvent( const YCPInteger & timeout )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateWaitForEvent( timeout );
@@ -170,8 +167,8 @@
}
-static YCPValue
-UIOpenDialogOpt( const YCPTerm & opts, const YCPTerm & dialog_term )
+YCPValue
+Y2UINamespace::OpenDialog( const YCPTerm & opts, const YCPTerm & dialog_term )
{
if ( YUIComponent::ui() )
// Notice: Parameter order is switched!
@@ -181,18 +178,15 @@
}
-static YCPValue
-UIOpenDialog( const YCPTerm & dialog_term )
+YCPValue
+Y2UINamespace::OpenDialog( const YCPTerm & dialog_term )
{
- if ( YUIComponent::ui() )
- return YUIComponent::ui()->evaluateOpenDialog( dialog_term );
- else
- return YCPVoid();
+ return m_comp->ui()->evaluateOpenDialog( dialog_term );
}
-static YCPValue
-UICloseDialog()
+YCPValue
+Y2UINamespace::CloseDialog()
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateCloseDialog();
@@ -201,8 +195,8 @@
}
-static YCPValue
-UIChangeWidgetOld( const YCPSymbol & widget_id, const YCPValue & property, const YCPValue & new_value )
+YCPValue
+Y2UINamespace::ChangeWidget( const YCPSymbol & widget_id, const YCPSymbol & property, const YCPValue & new_value )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateChangeWidget( widget_id, property, new_value );
@@ -211,8 +205,8 @@
}
-static YCPValue
-UIChangeWidget( const YCPTerm & widget_id, const YCPValue & property, const YCPValue & new_value )
+YCPValue
+Y2UINamespace::ChangeWidget( const YCPTerm & widget_id, const YCPSymbol & property, const YCPValue & new_value )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateChangeWidget( widget_id, property, new_value );
@@ -221,15 +215,15 @@
}
-static YCPValue
-UIChangeWidgetTerm( const YCPTerm & widget_id, const YCPValue & property, const YCPValue & new_value )
+YCPValue
+Y2UINamespace::ChangeWidget( const YCPTerm & widget_id, const YCPTerm & property, const YCPValue & new_value )
{
- return UIChangeWidget( widget_id, property, new_value );
+ return ChangeWidget( widget_id, property, new_value );
}
-static YCPValue
-UIQueryWidgetOld( const YCPSymbol & widget_id, const YCPSymbol & property )
+YCPValue
+Y2UINamespace::QueryWidget( const YCPSymbol & widget_id, const YCPSymbol & property )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateQueryWidget( widget_id, property );
@@ -238,8 +232,8 @@
}
-static YCPValue
-UIQueryWidgetOldTerm( const YCPSymbol & widget_id, const YCPTerm & property )
+YCPValue
+Y2UINamespace::QueryWidget( const YCPSymbol & widget_id, const YCPTerm & property )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateQueryWidget( widget_id, property );
@@ -248,8 +242,8 @@
}
-static YCPValue
-UIQueryWidget( const YCPTerm & widget_id, const YCPSymbol & property )
+YCPValue
+Y2UINamespace::QueryWidget( const YCPTerm & widget_id, const YCPSymbol & property )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateQueryWidget( widget_id, property );
@@ -258,8 +252,8 @@
}
-static YCPValue
-UIQueryWidgetTerm( const YCPTerm & widget_id, const YCPTerm & property )
+YCPValue
+Y2UINamespace::QueryWidget( const YCPTerm & widget_id, const YCPTerm & property )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateQueryWidget( widget_id, property );
@@ -268,8 +262,8 @@
}
-static YCPValue
-UIReplaceWidgetOld( const YCPSymbol & widget_id, const YCPTerm & new_widget )
+YCPValue
+Y2UINamespace::ReplaceWidget( const YCPSymbol & widget_id, const YCPTerm & new_widget )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateReplaceWidget( widget_id, new_widget );
@@ -278,8 +272,8 @@
}
-static YCPValue
-UIReplaceWidget( const YCPTerm & widget_id, const YCPTerm & new_widget )
+YCPValue
+Y2UINamespace::ReplaceWidget( const YCPTerm & widget_id, const YCPTerm & new_widget )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateReplaceWidget( widget_id, new_widget );
@@ -288,8 +282,8 @@
}
-static YCPValue
-UISetFocusOld( const YCPSymbol & widget_id )
+YCPValue
+Y2UINamespace::SetFocus( const YCPSymbol & widget_id )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateSetFocus( widget_id );
@@ -298,8 +292,8 @@
}
-static YCPValue
-UISetFocus( const YCPTerm & widget_id )
+YCPValue
+Y2UINamespace::SetFocus( const YCPTerm & widget_id )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateSetFocus( widget_id );
@@ -308,8 +302,8 @@
}
-static YCPValue
-UIBusyCursor()
+YCPValue
+Y2UINamespace::BusyCursor()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateBusyCursor();
@@ -318,8 +312,8 @@
}
-static YCPValue
-UIRedrawScreen()
+YCPValue
+Y2UINamespace::RedrawScreen()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateRedrawScreen();
@@ -328,8 +322,8 @@
}
-static YCPValue
-UINormalCursor()
+YCPValue
+Y2UINamespace::NormalCursor()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateNormalCursor();
@@ -338,8 +332,8 @@
}
-static YCPValue
-UIMakeScreenshotToFile( const YCPString & filename )
+YCPValue
+Y2UINamespace::MakeScreenshot( const YCPString & filename )
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateMakeScreenShot( filename );
@@ -348,18 +342,18 @@
}
-static YCPValue
-UIMakeScreenshot()
+YCPValue
+Y2UINamespace::MakeScreenshot()
{
if ( YUIComponent::ui() )
- return UIMakeScreenshotToFile( YCPNull() );
+ return MakeScreenshot( YCPNull() );
else
return YCPVoid();
}
-static YCPValue
-UIDumpWidgetTree()
+YCPValue
+Y2UINamespace::DumpWidgetTree()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateDumpWidgetTree();
@@ -368,8 +362,8 @@
}
-static YCPValue
-UIBeep()
+YCPValue
+Y2UINamespace::Beep()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateBeep();
@@ -377,8 +371,8 @@
return YCPVoid();
}
-static YCPValue
-UIRecordMacro( const YCPString & filename )
+YCPValue
+Y2UINamespace::RecordMacro( const YCPString & filename )
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateRecordMacro( filename );
@@ -387,8 +381,8 @@
}
-static YCPValue
-UIStopRecordMacro()
+YCPValue
+Y2UINamespace::StopRecordMacro()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateStopRecordMacro();
@@ -397,8 +391,8 @@
}
-static YCPValue
-UIPlayMacro( const YCPString & filename )
+YCPValue
+Y2UINamespace::PlayMacro( const YCPString & filename )
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluatePlayMacro( filename );
@@ -406,8 +400,8 @@
return YCPVoid();
}
-static YCPValue
-UIFakeUserInputNil()
+YCPValue
+Y2UINamespace::FakeUserInput()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateFakeUserInput( YCPVoid() );
@@ -416,8 +410,8 @@
}
-static YCPValue
-UIFakeUserInput( const YCPValue & next_input )
+YCPValue
+Y2UINamespace::FakeUserInput( const YCPValue & next_input )
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateFakeUserInput( next_input );
@@ -427,8 +421,8 @@
-static YCPValue
-UIGlyph( const YCPSymbol & glyphSym )
+YCPValue
+Y2UINamespace::Glyph( const YCPSymbol & glyphSym )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateGlyph( glyphSym );
@@ -437,8 +431,8 @@
}
-static YCPValue
-UIGetDisplayInfo()
+YCPValue
+Y2UINamespace::GetDisplayInfo()
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateGetDisplayInfo();
@@ -447,8 +441,8 @@
}
-static YCPValue
-UIRecalcLayout()
+YCPValue
+Y2UINamespace::RecalcLayout()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateRecalcLayout();
@@ -457,8 +451,8 @@
}
-static YCPValue
-UIPostponeShortcutCheck()
+YCPValue
+Y2UINamespace::PostponeShortcutCheck()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluatePostponeShortcutCheck();
@@ -466,8 +460,8 @@
return YCPVoid();
}
-static YCPValue
-UICheckShortcuts()
+YCPValue
+Y2UINamespace::CheckShortcuts()
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateCheckShortcuts();
@@ -476,8 +470,8 @@
}
-static YCPValue
-UIWidgetExistsOld( const YCPSymbol & widget_id )
+YCPValue
+Y2UINamespace::WidgetExists( const YCPSymbol & widget_id )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateWidgetExists( widget_id );
@@ -486,8 +480,8 @@
}
-static YCPValue
-UIWidgetExists( const YCPTerm & widget_id )
+YCPValue
+Y2UINamespace::WidgetExists( const YCPTerm & widget_id )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateWidgetExists( widget_id );
@@ -496,8 +490,8 @@
}
-static YCPValue
-UIRunPkgSelection( const YCPValue & widget_id )
+YCPValue
+Y2UINamespace::RunPkgSelection( const YCPValue & widget_id )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateRunPkgSelection( widget_id );
@@ -506,8 +500,8 @@
}
-static YCPValue
-UIAskForExistingDirectory( const YCPString & startDir, const YCPString & headline )
+YCPValue
+Y2UINamespace::AskForExistingDirectory( const YCPString & startDir, const YCPString & headline )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateAskForExistingDirectory( startDir, headline );
@@ -516,8 +510,8 @@
}
-static YCPValue
-UIAskForExistingFile( const YCPString & startWith, const YCPString & filter, const YCPString & headline )
+YCPValue
+Y2UINamespace::AskForExistingFile( const YCPString & startWith, const YCPString & filter, const YCPString & headline )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateAskForExistingFile( startWith, filter, headline );
@@ -526,8 +520,8 @@
}
-static YCPValue
-UIAskForSaveFileName( const YCPString & startWith, const YCPString & filter, const YCPString & headline )
+YCPValue
+Y2UINamespace::AskForSaveFileName( const YCPString & startWith, const YCPString & filter, const YCPString & headline )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateAskForSaveFileName( startWith, filter, headline );
@@ -536,8 +530,8 @@
}
-static YCPValue
-UISetFunctionKeys( const YCPMap & new_fkeys )
+YCPValue
+Y2UINamespace::SetFunctionKeys( const YCPMap & new_fkeys )
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateSetFunctionKeys( new_fkeys );
@@ -546,8 +540,8 @@
}
-static YCPValue
-UIRecode( const YCPString & from, const YCPString & to, const YCPString & text )
+YCPValue
+Y2UINamespace::Recode( const YCPString & from, const YCPString & to, const YCPString & text )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateRecode( from, to, text );
@@ -556,8 +550,8 @@
}
-static YCPValue
-UISetModulename( const YCPString & name )
+YCPValue
+Y2UINamespace::SetModulename( const YCPString & name )
{
if ( YUIComponent::ui() )
YUIComponent::ui()->evaluateSetModulename( name );
@@ -566,8 +560,8 @@
}
-static YCPValue
-UIHasSpecialWidget( const YCPSymbol & widget )
+YCPValue
+Y2UINamespace::HasSpecialWidget( const YCPSymbol & widget )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateHasSpecialWidget( widget );
@@ -576,8 +570,8 @@
}
-static YCPValue
-UIWizardCommand( const YCPTerm & command )
+YCPValue
+Y2UINamespace::WizardCommand( const YCPTerm & command )
{
if ( YUIComponent::ui() )
return YUIComponent::ui()->evaluateWizardCommand( command );
@@ -586,32 +580,27 @@
}
-
-
-static YCPValue
-UICollectUserInput( const YCPTerm & widget_id, const YCPSymbol & property )
+YCPValue
+Y2UINamespace::CollectUserInput( const YCPTerm & widget_id, const YCPSymbol & property )
{
if ( YUIComponent::ui() )
- return YUIComponent::ui()->evaluateCollectUserInput();
+ return YUIComponent::ui()->evaluateCollectUserInput();
else
- return YCPVoid();
+ return YCPVoid();
}
-static YCPValue
-UICollectUserInputTerm( const YCPTerm & widget_id, const YCPTerm & property )
+YCPValue
+Y2UINamespace::CollectUserInput( const YCPTerm & widget_id, const YCPTerm & property )
{
if ( YUIComponent::ui() )
- return YUIComponent::ui()->evaluateCollectUserInput();
+ return YUIComponent::ui()->evaluateCollectUserInput();
else
- return YCPVoid();
+ return YCPVoid();
}
-
-
-
-static YCPValue
-UICallHandler( void * ptr, int argc, YCPValue argv[] )
+YCPValue
+Y2UINamespace::CallHandler( void * ptr, int argc, YCPValue argv[] )
{
if ( YUIComponent::uiComponent() )
{
@@ -624,88 +613,189 @@
}
}
-bool UI::registered = false;
+// -------------
+
+Y2UIFunction::Y2UIFunction (Y2UINamespace* instance, YUIComponent* comp, unsigned int pos) :
+m_position (pos)
+, m_instance (instance)
+, m_comp (comp)
+, m_param1 ( YCPNull () )
+, m_param2 ( YCPNull () )
+, m_param3 ( YCPNull () )
+, m_param4 ( YCPNull () )
+, m_param5 ( YCPNull () )
+{
+};
-UI::UI()
+bool Y2UIFunction::attachParameter (const YCPValue& arg, const int position)
{
- if (registered)
+ switch (position)
{
- return;
+ case 0: m_param1 = arg; break;
+ case 1: m_param2 = arg; break;
+ case 2: m_param3 = arg; break;
+ case 3: m_param4 = arg; break;
+ case 4: m_param5 = arg; break;
+ default: return false;
}
- // Declarations for UI builtins and mapping to the respective C++ function.
- // NOTE: This must be static, registerDeclarations saves a pointer to it!
+ return true;
+}
+
+constTypePtr Y2UIFunction::wantedParameterType () const
+{
+ // we do not help them with type conversion
+ return Type::Any; // FIXME make this the default behavior in parent class
+}
- // This table is also processed to a YCP stub that makes the builtins
- // callable from other languages. To ease parsing, a type corresponding
- // to a single value must not contain whitespace
- static declaration_t ui_builtins[] =
+bool Y2UIFunction::appendParameter (const YCPValue& arg)
+{
+ if (m_param1.isNull ())
+ {
+ m_param1 = arg;
+ return true;
+ } else if (m_param2.isNull ())
+ {
+ m_param2 = arg;
+ return true;
+ } else if (m_param3.isNull ())
+ {
+ m_param3 = arg;
+ return true;
+ } else if (m_param4.isNull ())
+ {
+ m_param4 = arg;
+ return true;
+ } else if (m_param5.isNull ())
+ {
+ m_param5 = arg;
+ return true;
+ }
+ y2internal ("appendParameter > 5 not implemented");
+ return false;
+}
+
+bool Y2UIFunction::finishParameters ()
+{
+ y2internal ("FIXME finishParameters not implemented");
+ return true;
+}
+
+
+YCPValue Y2UIFunction::evaluateCall ()
+{
+ if ( ! m_comp->ui () )
+ {
+ y2debug( "Late creation of UI instance" );
+ m_comp->createUI();
+ }
+
+ YCPValue ret = YCPVoid();
+
+/* FIXME:
+ if ( macroPlayer )
+ {
+ if ( function == UIUserInput ||
+ function == UITimeoutUserInput ||
+ function == UIWaitForEvent ||
+ function == UIWaitForEventTimeout )
+ {
+ playNextMacroBlock ();
+ }
+ }
+*/
+ if ( m_comp->ui ()-> threads () )
+ {
+ m_comp->ui ()->_builtinCallData.function = this;
+
+ m_comp->ui ()->signalUIThread();
+
+ while ( ! m_comp->ui ()->waitForUIThread() )
+ {
+ // NOP
+ }
+
+ ret = m_comp->ui ()->_builtinCallData.result;
+ }
+ else
+ {
+ ret = evaluateCall_int ();
+ }
+
+ return ret;
+}
+
+YCPValue Y2UIFunction::evaluateCall_int ()
+{
+ switch (m_position) {
+#include "UIBuiltinCalls.h"
+ }
+
+ return YCPNull ();
+}
+
+bool Y2UIFunction::reset ()
+{
+ m_param1 = YCPNull ();
+ m_param2 = YCPNull ();
+ m_param3 = YCPNull ();
+ m_param4 = YCPNull ();
+ m_param5 = YCPNull ();
+
+ return true;
+}
+
+string Y2UIFunction::name() const
+{
+ return("Y2UI");
+}
+
+/**
+ * Constructor.
+ */
+Y2UINamespace::Y2UINamespace (YUIComponent* comp)
+{
+ m_comp = comp;
+ registerFunctions ();
+}
+
+/**
+ * Destructor.
+ */
+Y2UINamespace::~Y2UINamespace ()
+{}
+
+Y2Function* Y2UINamespace::createFunctionCall (const string name, constFunctionTypePtr type)
+{
+ symbols_t::iterator it;
+
+ y2debug ("Creating function call for %s", name.c_str ());
+
+ for ( it = m_symbols.begin (); it != m_symbols.end (); it++)
+ {
+ SymbolEntryPtr p = (*it);
+ if ( p->name () == name ) // FIXME overload && p->type () == type )
{
- { "UI", "", (void *) &UICallHandler, DECL_NAMESPACE | DECL_CALL_HANDLER },
- { "OpenDialog", "void (term)", (void*) UIOpenDialog },
- { "OpenDialog", "void (term, term)", (void*) UIOpenDialogOpt },
- { "CloseDialog", "boolean ()", (void*) UICloseDialog },
- { "UserInput", "any ()", (void*) UIUserInput },
- { "TimeoutUserInput", "any (integer)", (void*) UITimeoutUserInput },
- { "WaitForEvent", "map<string,any> (integer)", (void*) UIWaitForEventTimeout },
- { "WaitForEvent", "map<string,any> ()", (void*) UIWaitForEvent },
- { "PollInput", "any ()", (void*) UIPollInput },
- { "SetLanguage", "void (string)", (void*) UISetLanguage },
- { "SetLanguage", "void (string, string)", (void*) UISetLanguageAndEncoding},
- { "GetLanguage", "string (boolean)", (void*) UIGetLanguage },
- { "GetProductName", "string ()", (void*) UIGetProductName },
- { "SetProductName", "void (string)", (void*) UISetProductName },
- { "SetConsoleFont", "void (string, string, string, string, string)", (void*) UISetConsoleFont },
- { "SetKeyboard", "void ()", (void*) UISetKeyboard },
- { "RunInTerminal", "integer (string)", (void*) UIRunInTerminal },
- { "BusyCursor", "void ()", (void*) UIBusyCursor },
- { "NormalCursor", "void ()", (void*) UINormalCursor },
- { "RedrawScreen", "void ()", (void*) UIRedrawScreen },
- { "RecalcLayout", "void ()", (void*) UIRecalcLayout },
- { "DumpWidgetTree", "void ()", (void*) UIDumpWidgetTree },
- { "PostponeShortcutCheck", "void ()", (void*) UIPostponeShortcutCheck },
- { "CheckShortcuts", "void ()", (void*) UICheckShortcuts },
- { "MakeScreenShot", "void ()", (void*) UIMakeScreenshot },
- { "MakeScreenShot", "void (string)", (void*) UIMakeScreenshotToFile },
- { "Beep" , "void ()" , (void*) UIBeep },
- { "RecordMacro", "void (string)", (void*) UIRecordMacro },
- { "PlayMacro", "void (string)", (void*) UIPlayMacro },
- { "StopRecordMacro", "void ()", (void*) UIStopRecordMacro },
- { "FakeUserInput", "void ()", (void*) UIFakeUserInputNil },
- { "FakeUserInput", "void (any)", (void*) UIFakeUserInput },
- { "SetFunctionKeys", "void (map<string,integer>)", (void*) UISetFunctionKeys },
- { "ChangeWidget", "boolean (symbol, symbol, any)", (void*) UIChangeWidgetOld, DECL_NIL },
- { "ChangeWidget", "boolean (term, symbol, any)", (void*) UIChangeWidget, DECL_NIL },
- { "ChangeWidget", "boolean (term, term, any)", (void*) UIChangeWidgetTerm, DECL_NIL },
- { "QueryWidget", "any (symbol, symbol)", (void*) UIQueryWidgetOld },
- { "QueryWidget", "any (symbol, term)", (void*) UIQueryWidgetOldTerm },
- { "QueryWidget", "any (term, symbol)", (void*) UIQueryWidget },
- { "QueryWidget", "any (term, term)", (void*) UIQueryWidgetTerm },
- { "ReplaceWidget", "boolean (symbol, term)", (void*) UIReplaceWidgetOld },
- { "ReplaceWidget", "boolean (term, term)", (void*) UIReplaceWidget },
- { "SetFocus", "boolean (symbol)", (void*) UISetFocusOld },
- { "SetFocus", "boolean (term)", (void*) UISetFocus },
- { "WidgetExists" , "boolean (symbol)", (void*) UIWidgetExistsOld },
- { "WidgetExists", "boolean (term)", (void*) UIWidgetExists },
- { "Glyph", "string (symbol)", (void*) UIGlyph },
- { "GetDisplayInfo", "map<string,any> ()", (void*) UIGetDisplayInfo },
- { "RunPkgSelection", "any (term)", (void*) UIRunPkgSelection },
- { "AskForExistingDirectory","string (string, string)", (void*) UIAskForExistingDirectory },
- { "AskForExistingFile", "string (string, string, string)", (void*) UIAskForExistingFile },
- { "AskForSaveFileName", "string (string, string, string)", (void*) UIAskForSaveFileName },
- { "Recode", "any (string, string, string)", (void*) UIRecode },
- { "SetModulename", "void (string)", (void*) UISetModulename },
- { "HasSpecialWidget", "boolean (symbol)", (void*) UIHasSpecialWidget },
- { "WizardCommand", "boolean (term)", (void*) UIWizardCommand },
- { "CollectUserInput", "list<map<string, any>> ()", (void*) UICollectUserInput },
- { "CollectUserInput", "list<map<string, any>> ( term )", (void*) UICollectUserInputTerm },
- { 0, 0, 0, 0, 0, 0, 0 }
- };
+ y2debug ("Found symbol '%s' (%s) %d"
+ , p->name(), p->type()->toString ().c_str (), p->position ());
+ break;
+ }
+ }
- extern StaticDeclaration static_declarations;
- static_declarations.registerDeclarations ("UI", ui_builtins );
+ if (it == m_symbols.end ())
+ {
+ y2error ("No such function %s", name.c_str ());
+ return NULL;
+ }
- registered = true;
+ // FIXME:
+ // here we assume the linear adding of symbols to m_symbols
+ // this holds so far, but might fall apart easily
+ return new Y2UIFunction (this, m_comp, it- m_symbols.begin ());
}
+void Y2UINamespace::registerFunctions()
+{
+#include "UIBuiltinTable.h"
+}
Added: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2UINamespace.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2UINamespace.h (added)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/Y2UINamespace.h Wed Jun 27 18:25:12 2007
@@ -0,0 +1,284 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE GmbH |
+\----------------------------------------------------------------------/
+
+ File: Y2UINamespace.h
+
+ Authors: Stanislav Visnovsky <visnov(a)suse.cz>
+
+ Maintainer: Stefan Hundhammer <sh(a)suse.de>
+
+/-*/
+
+
+#include <y2/Y2Namespace.h>
+#include <y2/Y2Function.h>
+#include "ycp/YCPBoolean.h"
+#include "ycp/YCPInteger.h"
+#include "ycp/YCPVoid.h"
+#include "ycp/YCPString.h"
+#include "ycp/YCPCode.h"
+#include "ycp/StaticDeclaration.h"
+
+#define y2log_component "ui"
+#include "ycp/y2log.h"
+
+#include "YUI.h"
+#include "YUIComponent.h"
+
+class Y2UINamespace;
+
+class Y2UIFunction: public Y2Function
+{
+ unsigned int m_position;
+ Y2UINamespace* m_instance;
+ YUIComponent* m_comp;
+ YCPValue m_param1;
+ YCPValue m_param2;
+ YCPValue m_param3;
+ YCPValue m_param4;
+ YCPValue m_param5;
+ public:
+
+ Y2UIFunction (Y2UINamespace* instance, YUIComponent* comp, unsigned int pos);
+ bool attachParameter (const YCPValue& arg, const int position);
+ constTypePtr wantedParameterType () const;
+ bool appendParameter (const YCPValue& arg);
+ bool finishParameters ();
+ YCPValue evaluateCall ();
+ YCPValue evaluateCall_int ();
+ bool reset ();
+ string name () const;
+};
+
+class Y2UINamespace: public Y2Namespace
+{
+ private:
+ void registerFunctions ();
+
+ vector<string> _registered_functions;
+
+ YUIComponent* m_comp;
+
+ public:
+ /**
+ * Constructor.
+ */
+ Y2UINamespace (YUIComponent* comp);
+
+ /**
+ * Destructor.
+ */
+ virtual ~Y2UINamespace ();
+
+ virtual const string name () const
+ {
+ return "UI";
+ }
+
+ virtual const string filename () const
+ {
+ return "UI";
+ }
+
+ virtual string toString () const
+ {
+ return "// not possible toString";
+ }
+
+ virtual YCPValue evaluate (bool cse = false )
+ {
+ if (cse) return YCPNull ();
+ else return YCPVoid ();
+ }
+
+ virtual Y2Function* createFunctionCall (const string name, constFunctionTypePtr type);
+
+ /* TYPEINFO: void (string) */
+ YCPValue SetLanguage ( const YCPString & language );
+
+ /* TYPEINFO: void (string, string) */
+ YCPValue SetLanguage ( const YCPString & language, const YCPString & encoding );
+
+ /* TYPEINFO: string () */
+ YCPValue GetProductName ();
+
+ /* TYPEINFO: void (string) */
+ YCPValue SetProductName ( const YCPString & name );
+
+ /* TYPEINFO: void (string, string, string, string, string) */
+ YCPValue SetConsoleFont ( const YCPString & console_magic, const YCPString & font, const YCPString & screen_map, const YCPString & unicode_map, const YCPString & encoding );
+
+ /* TYPEINFO: void () */
+ YCPValue SetKeyboard ();
+
+ /* TYPEINFO: string (boolean) */
+ YCPValue GetLanguage ( const YCPBoolean & strip );
+
+ /* TYPEINFO: any() */
+ YCPValue UserInput();
+
+ /* TYPEINFO: any () */
+ YCPValue PollInput ();
+
+ /* TYPEINFO: any (integer) */
+ YCPValue TimeoutUserInput ( const YCPInteger& timeout );
+
+ /* TYPEINFO: map<string,any> () */
+ YCPValue WaitForEvent ();
+
+ /* TYPEINFO: map<string,any> (integer) */
+ YCPValue WaitForEvent( const YCPInteger & timeout );
+
+ /* TYPEINFO: void(term) */
+ YCPValue OpenDialog( const YCPTerm & dialog_term );
+
+ /* TYPEINFO: void(term,term) */
+ YCPValue OpenDialog( const YCPTerm & opts, const YCPTerm & dialog_term );
+
+ /* TYPEINFO: boolean() */
+ YCPValue CloseDialog();
+
+ // TODO DECL_NIL?
+ /* TYPEINFO: boolean (symbol, symbol, any) */
+ YCPValue ChangeWidget ( const YCPSymbol & widget_id, const YCPSymbol & property, const YCPValue & new_value );
+
+ // TODO DECL_NIL?
+ /* TYPEINFO: boolean (term, symbol, any) */
+ YCPValue ChangeWidget ( const YCPTerm & widget_id, const YCPSymbol & property, const YCPValue & new_value );
+
+ // TODO DECL_NIL?
+ /* TYPEINFO: boolean (term, term, any) */
+ YCPValue ChangeWidget ( const YCPTerm & widget_id, const YCPTerm & property, const YCPValue & new_value );
+
+ /* TYPEINFO: any (symbol, symbol) */
+ YCPValue QueryWidget ( const YCPSymbol & widget_id, const YCPSymbol & property );
+
+ /* TYPEINFO: any (symbol, term) */
+ YCPValue QueryWidget ( const YCPSymbol & widget_id, const YCPTerm & property );
+
+ /* TYPEINFO: any (term, symbol) */
+ YCPValue QueryWidget ( const YCPTerm & widget_id, const YCPSymbol & property );
+
+ /* TYPEINFO: any (term, term) */
+ YCPValue QueryWidget ( const YCPTerm & widget_id, const YCPTerm & property );
+
+ /* TYPEINFO: boolean (symbol, term) */
+ YCPValue ReplaceWidget ( const YCPSymbol & widget_id, const YCPTerm & new_widget );
+
+ /* TYPEINFO: boolean (term, term) */
+ YCPValue ReplaceWidget ( const YCPTerm & widget_id, const YCPTerm & new_widget );
+
+ /* TYPEINFO: boolean (symbol) */
+ YCPValue SetFocus ( const YCPSymbol & widget_id );
+
+ /* TYPEINFO: boolean (term) */
+ YCPValue SetFocus ( const YCPTerm & widget_id );
+
+ /* TYPEINFO: integer (string) */
+ YCPValue RunInTerminal ( const YCPString & command );
+
+ /* TYPEINFO: void () */
+ YCPValue BusyCursor ();
+
+ /* TYPEINFO: void () */
+ YCPValue RedrawScreen ();
+
+ /* TYPEINFO: void () */
+ YCPValue NormalCursor ();
+
+ /* TYPEINFO: void (string) */
+ YCPValue MakeScreenshot ( const YCPString & filename );
+
+ /* TYPEINFO: void () */
+ YCPValue MakeScreenshot ();
+
+ /* TYPEINFO: void () */
+ YCPValue DumpWidgetTree ();
+
+ /* TYPEINFO: void () */
+ YCPValue Beep ();
+
+ /* TYPEINFO: void (string) */
+ YCPValue RecordMacro ( const YCPString & filename );
+
+ /* TYPEINFO: void () */
+ YCPValue StopRecordMacro ();
+
+ /* TYPEINFO: void (string) */
+ YCPValue PlayMacro ( const YCPString & filename );
+
+ /* TYPEINFO: void () */
+ YCPValue FakeUserInput ();
+
+ /* TYPEINFO: void (any) */
+ YCPValue FakeUserInput ( const YCPValue & next_input );
+
+ /* TYPEINFO: string (symbol) */
+ YCPValue Glyph ( const YCPSymbol & glyphSym );
+
+ /* TYPEINFO: map<string,any> () */
+ YCPValue GetDisplayInfo ();
+
+ /* TYPEINFO: void () */
+ YCPValue RecalcLayout ();
+
+ /* TYPEINFO: void () */
+ YCPValue PostponeShortcutCheck ();
+
+ /* TYPEINFO: void () */
+ YCPValue CheckShortcuts ();
+
+ /* TYPEINFO: boolean (symbol) */
+ YCPValue WidgetExists ( const YCPSymbol & widget_id );
+
+ /* TYPEINFO: boolean (term) */
+ YCPValue WidgetExists ( const YCPTerm & widget_id );
+
+ /* TYPEINFO: any (term) */
+ YCPValue RunPkgSelection ( const YCPValue & widget_id );
+
+ /* TYPEINFO: string (string, string) */
+ YCPValue AskForExistingDirectory ( const YCPString & startDir, const YCPString & headline );
+
+ /* TYPEINFO: string (string, string, string) */
+ YCPValue AskForExistingFile ( const YCPString & startWith, const YCPString & filter, const YCPString & headline );
+
+ /* TYPEINFO: string (string, string, string) */
+ YCPValue AskForSaveFileName ( const YCPString & startWith, const YCPString & filter, const YCPString & headline );
+
+ /* TYPEINFO: void (map<string,integer>) */
+ YCPValue SetFunctionKeys ( const YCPMap & new_fkeys );
+
+ /* TYPEINFO: any (string, string, string) */
+ YCPValue Recode ( const YCPString & from, const YCPString & to, const YCPString & text );
+
+ /* TYPEINFO: void (string) */
+ YCPValue SetModulename ( const YCPString & name );
+
+ /* TYPEINFO: boolean (symbol) */
+ YCPValue HasSpecialWidget ( const YCPSymbol & widget );
+
+ /* TYPEINFO: boolean (term) */
+ YCPValue WizardCommand ( const YCPTerm & command );
+
+ // FIXME BOGUS!, see implementation
+ /* TYPEINFO:list<map<string, any>> () */
+ YCPValue CollectUserInput( const YCPTerm & widget_id, const YCPSymbol & property );
+
+ // FIXME BOGUS!, see implementation
+ /* TYPEINFO:list<map<string, any>> (term) */
+ YCPValue CollectUserInput( const YCPTerm & widget_id, const YCPTerm & property );
+
+YCPValue
+CallHandler( void * ptr, int argc, YCPValue argv[] );
+
+};
Modified: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI.h (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI.h Wed Jun 27 18:25:12 2007
@@ -51,7 +51,7 @@
class YTree;
class YTreeItem;
class Y2Component;
-
+class Y2UIFunction;
typedef struct
{
@@ -62,17 +62,13 @@
struct YUIBuiltinCallData
{
- void * function;
- int argc;
- YCPValue * argv;
+ Y2UIFunction * function;
YCPValue result;
YUIBuiltinCallData()
: result( YCPVoid() )
{
function = 0;
- argc = 0;
- argv = 0;
}
};
@@ -101,6 +97,7 @@
*/
YUI( bool with_threads );
+ friend class Y2UIFunction;
public:
@@ -117,6 +114,11 @@
/**
+ * Access to the flag, if we run with threads.
+ **/
+ bool threads() { return with_threads; }
+
+ /**
* Looks up the topmost dialog
*/
YDialog *currentDialog() const;
@@ -266,7 +268,10 @@
* This is called from libycp/YExpression via the UI builtin declarations
* that call UICallHandler.
**/
- YCPValue callBuiltin( void * function, int argc, YCPValue argv[] );
+ YCPValue callBuiltin( void * /*function*/, int /*argc*/, YCPValue /*argv*/[] ) {
+ // FIXME dummy UI?
+ return YCPNull();
+ }
/**
* Call 'function' with 'argc' YCPValue parameters and return the result of
@@ -447,7 +452,7 @@
*
* Derived UIs may or may not choose to overwrite this.
*/
- virtual YCPString glyph( const YCPSymbol & glyphSymbol ) { return YCPString( "" ); }
+ virtual YCPString glyph( const YCPSymbol & /*glyphSymbol*/ ) { return YCPString( "" ); }
//
@@ -894,7 +899,7 @@
* Use this to post-initialize widget stuff that cannot be done in the
* createPackageSelector() method.
**/
- virtual YCPValue runPkgSelection( YWidget * packageSelector ) { return YCPVoid(); }
+ virtual YCPValue runPkgSelection( YWidget * /*packageSelector*/ ) { return YCPVoid(); }
/**
Modified: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUIComponent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUIComponent.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUIComponent.cc Wed Jun 27 18:25:12 2007
@@ -27,6 +27,7 @@
#include <ycp/YCPVoid.h>
#include "YUIComponent.h"
+#include "Y2UINamespace.h"
#include "YUI.h"
@@ -43,13 +44,16 @@
_macro_file = 0;
_with_threads = false;
_have_server_options = false;
+ _namespace = NULL;
if ( _uiComponent )
{
- y2error( "Can't create multiple instances of UI component!" );
- return;
+ y2error( "Can't create multiple instances of UI component! (existing '%s', requested '%s')"
+ , _uiComponent->name ().c_str(), this->name ().c_str ());
+ return;
}
-
+
+ y2internal ("Setting UI component to '%s'", name().c_str());
_uiComponent = this;
}
@@ -67,6 +71,23 @@
}
+Y2Namespace *YUIComponent::import (const char* name)
+{
+ y2debug ("%s trying to import %s", this->name().c_str(), name);
+ if ( strcmp (name, "UI") == 0)
+ {
+ if (_namespace == NULL)
+ {
+ _namespace = new Y2UINamespace(this);
+ y2debug ("Namespace created %p", _namespace);
+ }
+
+ return _namespace;
+ }
+
+ return NULL;
+}
+
void YUIComponent::createUI()
{
if ( ! _have_server_options )
@@ -142,7 +163,7 @@
}
-void YUIComponent::result( const YCPValue & result )
+void YUIComponent::result( const YCPValue & /*result*/ )
{
if ( _ui )
delete _ui;
@@ -167,4 +188,12 @@
}
+YUI * YUIComponent::createUI( int /*argc*/, char ** /*argv*/, bool /*with_threads*/, const char * /*macro_file*/ )
+{
+ // This component can be instantiated for compilation purposes
+ // but it cannot evaluate the code.
+ y2internal ("Cannot create generic UI");
+ return 0;
+}
+
// EOF
Modified: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUIComponent.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUIComponent.h (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUIComponent.h Wed Jun 27 18:25:12 2007
@@ -26,6 +26,7 @@
class YUI;
+class Y2Namespace;
/**
* @short abstract base class for YaST2 user interface components.
@@ -33,7 +34,7 @@
**/
class YUIComponent : public Y2Component
{
-protected:
+public:
/**
* Constructor.
*/
@@ -44,6 +45,7 @@
*/
virtual ~YUIComponent();
+protected:
/**
* Create the UI. This is called when all the information for doing that is
* complete, in setServerOptions().
@@ -51,10 +53,12 @@
*
* Implement this method in derived classes.
**/
- virtual YUI * createUI( int argc, char **argv, bool with_threads, const char * macro_file ) = 0;
+ virtual YUI * createUI( int argc, char **argv, bool with_threads, const char * macro_file );
public:
+ virtual Y2Namespace *import (const char* name);
+
/**
* Returns the instance of the UI component 0 if none has been created yet.
**/
@@ -116,6 +120,7 @@
static YUI * _ui;
static YUIComponent * _uiComponent;
+ Y2Namespace * _namespace;
int _argc;
char ** _argv;
Modified: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI_core.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YUI_core.cc Wed Jun 27 18:25:12 2007
@@ -40,6 +40,7 @@
#include <ycp/y2log.h>
#include <ycp/YCPVoid.h>
+#include "Y2UINamespace.h"
#include "YUI.h"
#include "YUISymbols.h"
#include "YWidget.h"
@@ -180,45 +181,6 @@
extern YCPValue UIWaitForEventTimeout( const YCPInteger & timeout );
-YCPValue YUI::callBuiltin( void * function, int argc, YCPValue argv[] )
-{
- YCPValue ret = YCPVoid();
-
- if ( macroPlayer )
- {
- if ( function == UIUserInput ||
- function == UITimeoutUserInput ||
- function == UIWaitForEvent ||
- function == UIWaitForEventTimeout )
- {
- playNextMacroBlock ();
- }
- }
-
- if ( with_threads )
- {
- _builtinCallData.function = function;
- _builtinCallData.argc = argc;
- _builtinCallData.argv = argv;
-
- signalUIThread();
-
- while ( ! waitForUIThread() )
- {
- // NOP
- }
-
- ret = _builtinCallData.result;
- }
- else
- {
- ret = callFunction( function, argc, argv );
- }
-
- return ret;
-}
-
-
YCPValue YUI::callFunction( void * function, int argc, YCPValue argv[] )
{
if ( function == 0 )
@@ -366,11 +328,8 @@
if ( terminate_ui_thread )
return;
- // callFunction() checks for NULL function pointers
+ _builtinCallData.result = _builtinCallData.function->evaluateCall_int();
- _builtinCallData.result = callFunction( _builtinCallData.function,
- _builtinCallData.argc,
- _builtinCallData.argv );
signalYCPThread();
}
}
Modified: branches/tmp/mvidner/ui-as-namespace/core/libyui/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/testsuite/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/testsuite/Makefile.am Wed Jun 27 18:25:12 2007
@@ -12,7 +12,7 @@
noinst_PROGRAMS = runyui
runyui_SOURCES = runyui.cc
-runyui_LDADD = ../src/libyui.la ../../liby2/src/liby2.la ../../libycp/src/libycp.la ${Y2UTIL_LIBS} -lpthread
+runyui_LDADD = ../src/libpy2UI.la ../../liby2/src/liby2.la ../../libycp/src/libycp.la ${Y2UTIL_LIBS} -lpthread
AUTOMAKE_OPTIONS = dejagnu
Modified: branches/tmp/mvidner/ui-as-namespace/core/wfm/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/wfm/src/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/wfm/src/Makefile.am Wed Jun 27 18:25:12 2007
@@ -24,7 +24,7 @@
libpy2wfm_la_LDFLAGS = -version-info 2:0
libpy2wfm_la_LIBADD = \
../../scr/src/libpy2scr.la \
- ../../libyui/src/libyui.la \
+ ../../libyui/src/libpy2UI.la \
../../libscr/src/libscr.la \
../../libycp/src/libycp.la \
../../liby2/src/liby2.la \
Modified: branches/tmp/mvidner/ui-as-namespace/core/wfm/src/Y2CCWFM.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/wfm/src/Y2CCWFM.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/wfm/src/Y2CCWFM.cc Wed Jun 27 18:25:12 2007
@@ -45,7 +45,6 @@
#endif
#include <scr/SCR.h>
-#include <UI.h>
#include "WFM.h"
Y2CCWFM::Y2CCWFM()
@@ -59,7 +58,6 @@
// we can't do this in constructor, since it is called in static initialization
// and we can't control the order of initialization - it can crash
static SCR scr;
- static UI ui;
static WFM wfm;
}
Modified: branches/tmp/mvidner/ui-as-namespace/core/wfm/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/wfm/testsuite/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/wfm/testsuite/Makefile.am Wed Jun 27 18:25:12 2007
@@ -24,7 +24,7 @@
runwfm_LDADD = \
../src/libpy2wfm.la \
- $(top_builddir)/libyui/src/libyui.la \
+ $(top_builddir)/libyui/src/libpy2UI.la \
$(top_builddir)/libscr/src/libscr.la \
$(top_builddir)/libycp/src/libycp.la \
$(top_builddir)/liby2/src/liby2.la \
@@ -33,7 +33,7 @@
runc_SOURCES = runc.cc
runc_LDFLAGS = -L$(libdir)
runc_LDADD = ../src/libpy2wfm.la \
- $(top_builddir)/libyui/src/libyui.la \
+ $(top_builddir)/libyui/src/libpy2UI.la \
$(top_builddir)/libscr/src/libscr.la \
$(top_builddir)/libycp/src/libycp.la \
$(top_builddir)/liby2/src/liby2.la \
Modified: branches/tmp/mvidner/ui-as-namespace/core/wfm/testsuite/runc.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/wfm/testsuite/runc.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/wfm/testsuite/runc.cc Wed Jun 27 18:25:12 2007
@@ -25,7 +25,6 @@
#include <y2/Y2Component.h>
#include <y2/Y2ComponentCreator.h>
-#include <UI.h>
#include <scr/SCR.h>
#include <WFM.h>
@@ -321,7 +320,6 @@
// initialize the buildins
WFM wfm;
SCR scr;
- UI ui;
for(;;)
{
Modified: branches/tmp/mvidner/ui-as-namespace/gtk/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/g…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/gtk/configure.in.in (original)
+++ branches/tmp/mvidner/ui-as-namespace/gtk/configure.in.in Wed Jun 27 18:25:12 2007
@@ -32,10 +32,6 @@
AC_HEADER_STDC
dnl Try to find the Zypp includes
-if ! test -d /usr/include/zypp; then
- AC_MSG_ERROR(libzypp-devel not installed.)
-fi
-
PKG_CHECK_MODULES( ZYPP, libzypp )
AC_SUBST(ZYPP_LIBS)
Modified: branches/tmp/mvidner/ui-as-namespace/gtk/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/g…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/gtk/src/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/gtk/src/Makefile.am Wed Jun 27 18:25:12 2007
@@ -13,7 +13,7 @@
plugin_LTLIBRARIES = libpy2gtk.la
libpy2gtk_la_LDFLAGS = -version-info 2:0
-libpy2gtk_la_LIBADD = -L$(libdir) -lyui -lycp -ly2 $(GTK_LIBS) $(ZYPP_LIBS)
+libpy2gtk_la_LIBADD = -L$(plugindir) -lpy2UI -L$(libdir) -lycp -ly2 $(GTK_LIBS) $(ZYPP_LIBS)
libpy2gtk_la_SOURCES = \
Y2CCGtk.cc \
YGUtils.cc \
@@ -59,6 +59,6 @@
test_SOURCES = test.cc
test_LDADD = $(top_builddir)/src/$(plugin_LTLIBRARIES)
-INCLUDES = -I$(srcdir)/include -I$(includedir) -I$(includedir)/yui
+INCLUDES = -I$(srcdir)/include -I$(includedir) -I$(includedir)/yui $(ZYPP_CFLAGS)
EXTRA_DIST = computer.xpm
Modified: branches/tmp/mvidner/ui-as-namespace/gtk/src/Y2CCGtk.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/g…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/gtk/src/Y2CCGtk.cc (original)
+++ branches/tmp/mvidner/ui-as-namespace/gtk/src/Y2CCGtk.cc Wed Jun 27 18:25:12 2007
@@ -5,6 +5,8 @@
#include <config.h>
#include <YGUI.h>
#include <YUIComponent.h>
+#include <Y2CCUI.h>
+#include <ycp/y2log.h>
class YGUIComponent : public YUIComponent
{
@@ -24,17 +26,24 @@
}
};
-class Y2CCGtk : public Y2ComponentCreator
+class Y2CCGtk : public Y2CCUI
{
public:
- Y2CCGtk () : Y2ComponentCreator (Y2ComponentBroker::BUILTIN) { };
+ Y2CCGtk () : Y2CCUI() { };
bool isServerCreator () const { return true; };
Y2Component *create (const char * name) const
{
- if (!strcmp (name, "gtk") )
- return new YGUIComponent ();
+ y2milestone( "Creating %s component", name );
+ if (!strcmp (name, "gtk") ) {
+ Y2Component* ret = YUIComponent::uiComponent ();
+ if (!ret || ret->name () != name) {
+ y2debug ("UI component is %s, creating %s", ret? ret->name().c_str() : "NULL", name);
+ ret = new YGUIComponent();
+ }
+ return ret;
+ }
else
return 0;
}
Modified: branches/tmp/mvidner/ui-as-namespace/ncurses/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/n…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/ncurses/src/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/ncurses/src/Makefile.am Wed Jun 27 18:25:12 2007
@@ -5,7 +5,6 @@
SUBDIRS = pkg
AM_CXXFLAGS = -DY2LOG=\"ui-ncurses\" -DLOCALEDIR=\"${localedir}\"
-AM_LDFLAGS = -L$(libdir)
# plugin, libtool forces 'lib' prefix
plugin_LTLIBRARIES = libpy2ncurses.la
@@ -15,14 +14,14 @@
#liby2ncurses_la_LDFLAGS = -version-info 2:0
libpy2ncurses_la_LIBADD = \
- -L$(libdir) \
- -lyui \
+ -L$(plugindir) \
+ -lpy2UI \
-lncursesw -lpanelw
#libpy2ncurses_la_LIBADD = \
# -L$(libdir) \
# -Lpkg -lpy2ncurses_pkg \
-# -lyui \
+# -lpy2UI \
# -lncursesw -lpanelw
#liby2ncurses_la_LIBADD = $(libpy2ncurses_la_LIBADD)
@@ -164,7 +163,7 @@
# Y2CCNCursesUI.cc Y2CCNCursesUI.h \
# YNCursesComponent.h
-INCLUDES = -I$(srcdir)/pkg -I$(includedir) -I$(includedir)/yui -I$(includedir)/y2util/qt
+INCLUDES = -I$(srcdir)/pkg -I$(includedir) -I$(includedir)/yui -I$(includedir)/y2util/qt ${ZYPP_CFLAGS}
lang2encoding.cc: lang2encoding.tab
./lang2encoding.tab > lang2encoding.cc
Modified: branches/tmp/mvidner/ui-as-namespace/ncurses/src/Y2CCNCursesUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/n…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/ncurses/src/Y2CCNCursesUI.h (original)
+++ branches/tmp/mvidner/ui-as-namespace/ncurses/src/Y2CCNCursesUI.h Wed Jun 27 18:25:12 2007
@@ -24,6 +24,7 @@
#include "YNCursesComponent.h"
#include <iosfwd>
+#include <yui/Y2CCUI.h>
#include "ycp/y2log.h"
@@ -34,13 +35,13 @@
* such a component - returns a newly created component of this
* type. The Y2CCNCursesUI can create components with the name "ncursesui".
*/
-class Y2CCNcursesUI : public Y2ComponentCreator
+class Y2CCNcursesUI : public Y2CCUI
{
public:
/**
* Creates a NCursesUI component creator
*/
- Y2CCNcursesUI() : Y2ComponentCreator(Y2ComponentBroker::BUILTIN) { };
+ Y2CCNcursesUI() : Y2CCUI() { };
/**
* Returns true, since the NCursesUI component is a
@@ -59,8 +60,13 @@
{
y2milestone( "Creating %s component", name );
if (!strcmp(name, "ncurses") ) {
- Y2Component* r = new YNCursesComponent();
- return r;
+ Y2Component* ret = YUIComponent::uiComponent ();
+ if (!ret || ret->name () != name)
+ {
+ y2debug ("UI component is %s, creating %s", ret? ret->name().c_str() : "NULL", name);
+ ret = new YNCursesComponent();
+ }
+ return ret;
}
else return 0;
}
Modified: branches/tmp/mvidner/ui-as-namespace/ncurses/src/pkg/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/n…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/ncurses/src/pkg/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/ncurses/src/pkg/Makefile.am Wed Jun 27 18:25:12 2007
@@ -6,7 +6,6 @@
you_layout.ycp
AM_CXXFLAGS = -DY2LOG=\"ui-ncurses\" -DLOCALEDIR=\"${localedir}\"
-AM_LDFLAGS = -L$(libdir)
# plugin, libtool forces 'lib' prefix
# plugin_LTLIBRARIES = libpy2ncurses_pkg.la
@@ -14,7 +13,7 @@
libpy2ncurses_pkg_la_LDFLAGS = -version-info 2:0
libpy2ncurses_pkg_la_LIBADD = \
- -L$(libdir) -lyui \
+ -L$(plugindir) -lpy2UI \
${ZYPP_LIBS}
noinst_HEADERS = \
Modified: branches/tmp/mvidner/ui-as-namespace/ncurses/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/n…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/ncurses/testsuite/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/ncurses/testsuite/Makefile.am Wed Jun 27 18:25:12 2007
@@ -14,7 +14,7 @@
runcurses_SOURCES = runcurses.cc
runcurses_LDADD = ../src/libpy2ncurses.la ../src/pkg/libpy2ncurses_pkg.la \
- -lncurses -lpanel -lpthread -ly2 -lyui -lycp -lutil
+ -lncurses -lpanel -lpthread -ly2 -L$(plugindir) -lpy2UI -lycp -lutil
runcurses_LDFLAGS = -L$(libdir) \
-Xlinker --whole-archive \
@@ -26,15 +26,15 @@
NCstring_test.h NCstring_test.cc
utf8test_LDADD = ../src/libpy2ncurses.la ../src/pkg/libpy2ncurses_pkg.la \
- -lncursesw -lpanelw -lpthread -ly2 -lyui -lycp -lutil
+ -lncursesw -lpanelw -lpthread -ly2 -L$(plugindir) -lpy2UI -lycp -lutil
in_wch_SOURCES = in_wch.cc
-#in_wch_LDADD = -lncursesw -lpanelw -lpthread -ly2 -lyui -lycp -lutil
+#in_wch_LDADD = -lncursesw -lpanelw -lpthread -ly2 -lpy2UI -lycp -lutil
in_wch_LDADD = -lncursesw
y2ncurses_SOURCES = y2ncurses.cc
-y2ncurses_LDADD = -lncurses -lpanel -lpthread -ly2 -lyui -lycp \
+y2ncurses_LDADD = -lncurses -lpanel -lpthread -ly2 -L$(plugindir) -lpy2UI -lycp \
-lutil
y2ncurses_LDFLAGS = -static -L$(libdir) \
Modified: branches/tmp/mvidner/ui-as-namespace/qt/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/q…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/qt/src/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/qt/src/Makefile.am Wed Jun 27 18:25:12 2007
@@ -30,13 +30,13 @@
libpy2qt_la_LDFLAGS = -version-info 2:0
libpy2qt_la_LIBADD = \
- -L$(libdir) -lyui \
+ -L$(plugindir) -lpy2UI \
-L$(QTLIBDIR) -lqt-mt \
-lX11 -lXext -lSM -lICE
# libpy2qt_la_LIBADD = \
# -Lpkg -ly2qt_pkg \
-# -L$(libdir) -lyui \
+# -L$(libdir) -lpy2UI \
# -L$(QTLIBDIR) -lqt-mt \
# -lX11 -lXext -lSM -lICE
@@ -283,4 +283,4 @@
CLEANFILES = *.moc
-INCLUDES = -I$(srcdir)/pkg -I$(QTDIR)/include -I$(includedir) -I$(includedir)/yui
+INCLUDES = -I$(srcdir)/pkg -I$(QTDIR)/include -I$(includedir) -I$(includedir)/yui ${ZYPP_CFLAGS}
Modified: branches/tmp/mvidner/ui-as-namespace/qt/src/Y2CCQt.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/q…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/qt/src/Y2CCQt.h (original)
+++ branches/tmp/mvidner/ui-as-namespace/qt/src/Y2CCQt.h Wed Jun 27 18:25:12 2007
@@ -23,6 +23,7 @@
#define _Y2CCQt_h
#include "YQUIComponent.h"
+#include <yui/Y2CCUI.h>
/**
* @short Y2ComponentCreator that can create Qt user interfaces
@@ -31,13 +32,13 @@
* such a component - returns a newly created component of this
* type. The Y2CCQt can create components with the name "qt".
*/
-class Y2CCQt : public Y2ComponentCreator
+class Y2CCQt : public Y2CCUI
{
public:
/**
* Creates a Qt component creator
*/
- Y2CCQt() : Y2ComponentCreator(Y2ComponentBroker::BUILTIN) { };
+ Y2CCQt() : Y2CCUI() { };
/**
* Returns true, since the qt component is a
@@ -51,7 +52,14 @@
Y2Component *create(const char * name) const
{
if (!strcmp(name, "qt") )
- return new YQUIComponent();
+ {
+ Y2Component* ret = YUIComponent::uiComponent ();
+ if (!ret || ret->name () != name)
+ {
+ ret = new YQUIComponent();
+ }
+ return ret;
+ }
else
return 0;
}
Modified: branches/tmp/mvidner/ui-as-namespace/qt/src/pkg/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/q…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/qt/src/pkg/Makefile.am (original)
+++ branches/tmp/mvidner/ui-as-namespace/qt/src/pkg/Makefile.am Wed Jun 27 18:25:12 2007
@@ -23,7 +23,7 @@
libpy2qt_pkg_la_LDFLAGS = -version-info 2:0
libpy2qt_pkg_la_LIBADD = \
- -L$(libdir) -lyui \
+ -L$(plugindir) -lpy2UI \
-L$(QTLIBDIR) -lqt-mt \
-lX11 -lXext -lSM -lICE \
${ZYPP_LIBS}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39060 - /branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
by sh-sh-sh@svn.opensuse.org 27 Jun '07
by sh-sh-sh@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: sh-sh-sh
Date: Wed Jun 27 18:03:07 2007
New Revision: 39060
URL: http://svn.opensuse.org/viewcvs/yast?rev=39060&view=rev
Log:
added example
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Wed Jun 27 18:03:07 2007
@@ -2218,7 +2218,7 @@
* @option scaleToFit scale the pixmap so it fits the available space: zoom in or out as needed
* @option zeroWidth make widget report a preferred width of 0
* @option zeroHeight make widget report a preferred height of 0
- * @example Image1.ycp Image-animated.ycp
+ * @example Image1.ycp Image-animated.ycp Image-scaled.ycp
*
* @description
*
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39059 - in /branches/tmp/sh/mod-ui: core/libyui/src/ qt/src/ qt/src/pkg/
by sh-sh-sh@svn.opensuse.org 27 Jun '07
by sh-sh-sh@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: sh-sh-sh
Date: Wed Jun 27 17:58:34 2007
New Revision: 39059
URL: http://svn.opensuse.org/viewcvs/yast?rev=39059&view=rev
Log:
ported PackageSelector
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc
branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h
branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.cc
branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.h
branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelectorPlugin.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h
branches/tmp/sh/mod-ui/qt/src/YQImage.cc
branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc
branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/YQPackageSelectorPlugin.cc
branches/tmp/sh/mod-ui/qt/src/YQPackageSelectorPlugin.h
branches/tmp/sh/mod-ui/qt/src/YQUI.h
branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelector.cc
branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelector.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorBase.cc
branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorBase.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorHelp.cc
branches/tmp/sh/mod-ui/qt/src/pkg/YQPatternSelector.cc
branches/tmp/sh/mod-ui/qt/src/pkg/YQPatternSelector.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgChangeLogView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgChangesDialog.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgConflictDialog.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgConflictList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDependenciesView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDescriptionDialog.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDescriptionView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDiskUsageList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDiskUsageWarningDialog.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgFileListView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgGenericDetailsView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgInstSrcFilterView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgInstSrcList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgLangList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgObjList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatchFilterView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatchList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatternList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgProductDialog.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgProductList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgRpmGroupTagsFilterView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSearchFilterView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelDescriptionView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelList.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelMapper.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgStatusFilterView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgTechnicalDetailsView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgTextDialog.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgUpdateProblemFilterView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgVersionsView.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQSimplePatchSelector.cc
branches/tmp/sh/mod-ui/qt/src/pkg/YQSimplePatchSelector.h
branches/tmp/sh/mod-ui/qt/src/pkg/YQZypp.h
Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Wed Jun 27 17:58:34 2007
@@ -236,10 +236,10 @@
- virtual YWidget::setFunctionKey
Since YWidgetOpt is no longer passed to constructors, NCurses should use
- those new functions instead.
+ those new functions instead.
YWidget::setFunctionKey() is called from YCPDialogParser after the widget is
created, so either use the new function in the keyboard handlers or overwrite
- YWidget::setFunctionKey().
+ YWidget::setFunctionKey().
* YCheckBox:
- getValue() -> value()
@@ -265,7 +265,7 @@
- virtual void setAutoScrollDown( bool on = true );
- bool shrinkable() const;
- void setShrinkable( bool shrinkable = true );
-
+
2007-06-27 14:45 sh(a)suse.de
@@ -275,3 +275,24 @@
* Dropped support for fallback label (was never used in NCurses anyway)
* Dropped support for `opt(`tiled)
* Moved YWidgetOpt stuff to YImage methods
+
+
+2007-06-27 18:00 sh(a)suse.de
+
+* YPackageSelector:
+
+ * added modeFlags parameter (summarizing all the YWidgetOpts)
+ * added mode checking functions:
+ - bool testMode()
+ - bool onlineUpdateMode()
+ - bool updateMode()
+ - ...
+ * Dropped long-obsolete floppyDevice parameter
+
+* YPackageSelectorPlugin:
+ * added modeFlags parameter
+
+* Factories:
+ * added modeFlags parameter for PackageSelector etc.
+ * now calling the YPackagePlugin from the factory create...() functions
+
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Wed Jun 27 17:58:34 2007
@@ -47,12 +47,13 @@
#include "YDumbTab.h"
#include "YEmpty.h"
#include "YFrame.h"
-#include "YInputField.h"
#include "YImage.h"
+#include "YInputField.h"
#include "YLabel.h"
#include "YLayoutBox.h"
#include "YMenuButton.h"
#include "YMultiSelectionBox.h"
+#include "YPackageSelector.h"
#include "YPushButton.h"
#include "YRadioButton.h"
#include "YRadioButtonGroup.h"
@@ -2357,7 +2358,7 @@
* @option searchMode start with the "search" filter view
* @option summaryMode start with the "installation summary" filter view
* @option instSourcesMode start with the "installation sources" filter view
- * @usage `PackageSelector( "/dev/fd0" )
+ * @usage `PackageSelector()
*
* @examples PackageSelector.ycp
*
@@ -2396,25 +2397,27 @@
// Parse options
+ long modeFlags = 0;
+
for ( int o=0; o < optList->size(); o++ )
{
if ( optList->value(o)->isSymbol() )
{
string sym = optList->value(o)->asSymbol()->symbol();
- if ( sym == YUIOpt_youMode ) opt.youMode.setValue( true );
- else if ( sym == YUIOpt_updateMode ) opt.updateMode.setValue( true );
- else if ( sym == YUIOpt_searchMode ) opt.searchMode.setValue( true );
- else if ( sym == YUIOpt_summaryMode ) opt.summaryMode.setValue( true );
- else if ( sym == YUIOpt_instSourcesMode ) opt.instSourcesMode.setValue( true );
+ if ( sym == YUIOpt_youMode ) modeFlags |= YPkg_OnlineUpdateMode;
+ else if ( sym == YUIOpt_updateMode ) modeFlags |= YPkg_UpdateMode;
+ else if ( sym == YUIOpt_searchMode ) modeFlags |= YPkg_SearchMode;
+ else if ( sym == YUIOpt_summaryMode ) modeFlags |= YPkg_SummaryMode;
+ else if ( sym == YUIOpt_instSourcesMode ) modeFlags |= YPkg_InstSourcesMode;
+ else if ( sym == YUIOpt_testMode ) modeFlags |= YPkg_TestMode;
else logUnknownOption( term, optList->value(o) );
}
else logUnknownOption( term, optList->value(o) );
}
- YCPString floppyDevice = numArgs > 0 ? term->value( argnr )->asString() : YCPString( "" );
- return YUI::ui()->createPackageSelector( parent, opt, floppyDevice );
+ return YUI::widgetFactory()->createPackageSelector( parent, modeFlags );
}
@@ -3090,16 +3093,8 @@
}
rejectAllOptions( term, optList );
-
- if ( YUI::ui()->hasPatternSelector() )
- {
- return YUI::ui()->createPatternSelector( parent, opt );
- }
- else
- {
- y2error( "This UI does not support the PatternSelector." );
- return 0;
- }
+
+ return YUI::optionalWidgetFactory()->createPatternSelector( parent );
}
@@ -3148,15 +3143,7 @@
rejectAllOptions( term, optList );
- if ( YUI::ui()->hasSimplePatchSelector() )
- {
- return YUI::ui()->createSimplePatchSelector( parent, opt );
- }
- else
- {
- y2error( "This UI does not support the SimplePatchSelector." );
- return 0;
- }
+ return YUI::optionalWidgetFactory()->createSimplePatchSelector( parent );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.cc Wed Jun 27 17:58:34 2007
@@ -129,7 +129,7 @@
}
YWidget *
-YOptionalWidgetFactory::createPatternSelector( YWidget * parent )
+YOptionalWidgetFactory::createPatternSelector( YWidget * parent, long modeFlags )
{
THROW_UNSUPPORTED( "YPatternSelector" );
}
@@ -142,7 +142,7 @@
}
YWidget *
-YOptionalWidgetFactory::createSimplePatchSelector( YWidget * parent )
+YOptionalWidgetFactory::createSimplePatchSelector( YWidget * parent, long modeFlags )
{
THROW_UNSUPPORTED( "YSimplePatchSelector" );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YOptionalWidgetFactory.h Wed Jun 27 17:58:34 2007
@@ -76,10 +76,10 @@
virtual YBarGraph * createBarGraph ( YWidget * parent, list<int> values, list<string> labels );
virtual bool hasPatternSelector();
- virtual YWidget * createPatternSelector ( YWidget * parent );
+ virtual YWidget * createPatternSelector ( YWidget * parent, long modeFlags = 0 );
virtual bool hasSimplePatchSelector();
- virtual YWidget * createSimplePatchSelector( YWidget * parent );
+ virtual YWidget * createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
virtual bool hasMultiProgressMeter();
virtual YMultiProgressMeter * createHMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.cc Wed Jun 27 17:58:34 2007
@@ -23,12 +23,11 @@
#include "YPackageSelector.h"
-YPackageSelector::YPackageSelector( const YWidgetOpt & opt )
- : YWidget( opt )
+YPackageSelector::YPackageSelector( YWidget * parent, long modeFlags )
+ : YWidget( parent )
+ , _modeFlags( modeFlags )
{
- // y2debug( "YPackageSelector" );
-
- // Derived classes need to check opt.shrinkable!
+ y2milestone( "YPackageSelector flags: 0x%lx", modeFlags );
setDefaultStretchable( YD_HORIZ, true );
setDefaultStretchable( YD_VERT, true );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelector.h Wed Jun 27 17:58:34 2007
@@ -24,18 +24,25 @@
class YMacroRecorder;
-/**
- * @short Implementation of the SelectionBox widget.
- **/
+#define YPkg_TestMode 1 << 0
+#define YPkg_OnlineUpdateMode 1 << 1
+#define YPkg_UpdateMode 1 << 2
+#define YPkg_SearchMode 1 << 3
+#define YPkg_SummaryMode 1 << 4
+#define YPkg_InstSourcesMode 1 << 5
+
+
class YPackageSelector : public YWidget
{
public:
/**
- * Constructor
- * @param opt the widget options
+ * Constructor.
+ *
+ * 'modeFlags' are flags determining which modes to use, ORed together:
+ * YPkg_OnlineUpdateMode | YPkg_TestMode
**/
- YPackageSelector( const YWidgetOpt & opt );
+ YPackageSelector( YWidget * parent, long modeFlags = 0 );
/**
* Returns a descriptive name of this widget class for logging,
@@ -43,7 +50,18 @@
**/
virtual const char * widgetClass() { return "YPackageSelector"; }
+ /**
+ * Check for the various modes.
+ **/
+ bool testMode() const { return _modeFlags & YPkg_TestMode; }
+ bool onlineUpdateMode() const { return _modeFlags & YPkg_OnlineUpdateMode; }
+ bool updateMode() const { return _modeFlags & YPkg_UpdateMode; }
+ bool searchMode() const { return _modeFlags & YPkg_SearchMode; }
+ bool summaryMode() const { return _modeFlags & YPkg_SummaryMode; }
+ bool instSourcesMode() const { return _modeFlags & YPkg_InstSourcesMode; }
+protected:
+ long _modeFlags;
};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelectorPlugin.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelectorPlugin.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPackageSelectorPlugin.h Wed Jun 27 17:58:34 2007
@@ -21,9 +21,9 @@
#define YPackageSelectorPlugin_h
#include "YUIPlugin.h"
-#include "YWidgetOpt.h"
class YWidget;
+class YPackageSelector;
/**
@@ -53,8 +53,7 @@
* 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 YWidget * createPackageSelector( YWidget * parent,
- YWidgetOpt & opt ) = 0;
+ virtual YPackageSelector * createPackageSelector( YWidget * parent, long modeFlags = 0 ) = 0;
};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Wed Jun 27 17:58:34 2007
@@ -456,7 +456,6 @@
virtual YWidget *createTable( YWidget *parent, YWidgetOpt & opt, vector<string> header ) = 0;
virtual YWidget *createProgressBar( YWidget *parent, YWidgetOpt & opt, const YCPString & label, const YCPInteger & maxprogress, const YCPInteger & progress ) = 0;
virtual YWidget *createIntField( YWidget *parent, YWidgetOpt & opt, const YCPString & label, int minValue, int maxValue, int initialValue ) = 0;
- virtual YWidget *createPackageSelector( YWidget *parent, YWidgetOpt & opt, const YCPString & floppyDevice ) = 0;
// FIXME: Obsolete
// FIXME: Obsolete
// FIXME: Obsolete
@@ -580,21 +579,6 @@
virtual bool hasPartitionSplitter() { return false; }
- /**
- * Creates a pattern selector.
- **/
- virtual YWidget *createPatternSelector( YWidget *parent, YWidgetOpt & opt );
-
- virtual bool hasPatternSelector() { return false; }
-
-
- /**
- * Creates a simple patch selector.
- **/
- virtual YWidget *createSimplePatchSelector( YWidget *parent, YWidgetOpt & opt );
-
- virtual bool hasSimplePatchSelector() { return false; }
-
/**
* Creates a Wizard frame.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h Wed Jun 27 17:58:34 2007
@@ -731,6 +731,21 @@
};
+/**
+ * Exception class for plugin load failure
+ **/
+class YUIPluginException: public YUIException
+{
+public:
+ YUIPluginException( const string & pluginName )
+ : YUIException( string( "Couldn't load plug-in " ) + pluginName )
+ {}
+
+ virtual ~YUIPluginException() throw()
+ {}
+};
+
+
//
// Helper templates
//
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc Wed Jun 27 17:58:34 2007
@@ -87,9 +87,9 @@
else if ( symbol == YUISpecialWidget_HMultiProgressMeter ) hasWidget = hasMultiProgressMeter();
else if ( symbol == YUISpecialWidget_VMultiProgressMeter ) hasWidget = hasMultiProgressMeter();
else if ( symbol == YUISpecialWidget_Slider ) hasWidget = hasSlider();
- else if ( symbol == YUISpecialWidget_PatternSelector ) hasWidget = hasPatternSelector();
+ else if ( symbol == YUISpecialWidget_PatternSelector ) hasWidget = fact->hasPatternSelector();
else if ( symbol == YUISpecialWidget_PartitionSplitter ) hasWidget = hasPartitionSplitter();
- else if ( symbol == YUISpecialWidget_SimplePatchSelector ) hasWidget = hasSimplePatchSelector();
+ else if ( symbol == YUISpecialWidget_SimplePatchSelector ) hasWidget = fact->hasSimplePatchSelector();
else if ( symbol == YUISpecialWidget_Wizard ) hasWidget = hasWizard();
else if ( symbol == YUISpecialWidget_Date ) hasWidget = hasDate();
else if ( symbol == YUISpecialWidget_Time ) hasWidget = hasTime();
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI_special_widgets.cc Wed Jun 27 17:58:34 2007
@@ -144,26 +144,6 @@
}
-YWidget * YUI::createPatternSelector( YWidget * parent,
- YWidgetOpt & opt )
-{
- y2error( "Default createPatternSelector() method called - "
- "forgot to call HasSpecialWidget()?" );
-
- return 0;
-}
-
-
-YWidget * YUI::createSimplePatchSelector( YWidget * parent,
- YWidgetOpt & opt )
-{
- y2error( "Default createSimplePatchSelector() method called - "
- "forgot to call HasSpecialWidget()?" );
-
- return 0;
-}
-
-
YWidget * YUI::createWizard( YWidget *parent, YWidgetOpt & opt,
const YCPValue & backButtonId, const YCPString & backButtonLabel,
const YCPValue & abortButtonId, const YCPString & abortButtonLabel,
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h Wed Jun 27 17:58:34 2007
@@ -115,8 +115,8 @@
virtual YLogView * createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 ) = 0;
virtual YSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label ) = 0;
- virtual YPackageSelector * createPackageSelector ( YWidget * parent ) = 0;
- virtual YWidget * createPkgSpecial ( YWidget * parent, const string & subwidgetName ) = 0; // NCurses only
+ virtual YPackageSelector * createPackageSelector ( YWidget * parent, long ModeFlags = 0 ) = 0;
+ virtual YWidget * createPkgSpecial ( YWidget * parent, const string & subwidgetName ) = 0; // NCurses only
//
// Layout Helpers
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetOpt.h Wed Jun 27 17:58:34 2007
@@ -153,11 +153,6 @@
YBoolOpt countShowDelta; // YPartitionSplitter
YLongOpt key_Fxx; // YPushButton: No. of F-Key (1..24), 0 if none
- YBoolOpt searchMode; // YPackageSelector
- YBoolOpt summaryMode; // YPackageSelector
- YBoolOpt updateMode; // YPackageSelector
- YBoolOpt youMode; // YPackageSelector
- YBoolOpt instSourcesMode; // YPackageSelector
YBoolOpt stepsEnabled; // YWizard
YBoolOpt treeEnabled; // YWizard
Modified: branches/tmp/sh/mod-ui/qt/src/YQImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQImage.…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQImage.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQImage.cc Wed Jun 27 17:58:34 2007
@@ -66,7 +66,7 @@
}
else
{
- y2debug( "Loading animation from %s (%d x %d)", imageFileName().c_str() );
+ y2debug( "Loading animation from %s", imageFileName().c_str() );
QLabel::setMovie( movie );
}
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQOption…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.cc Wed Jun 27 17:58:34 2007
@@ -17,7 +17,9 @@
/-*/
#include "YQOptionalWidgetFactory.h"
+#include "YQUI.h"
#include "YUIException.h"
+#include "YQPackageSelectorPlugin.h"
#define THROW_UNSUPPORTED( WIDGET_TYPE ) \
@@ -123,26 +125,36 @@
bool YQOptionalWidgetFactory::hasPatternSelector()
{
- return false;
+ return true;
}
YQPatternSelector *
-YQOptionalWidgetFactory::createPatternSelector( YWidget * parent )
+YQOptionalWidgetFactory::createPatternSelector( YWidget * parent, long modeFlags )
{
- THROW_UNSUPPORTED( "YQPatternSelector" );
+ YQPackageSelectorPlugin * plugin = YQUI::ui()->packageSelectorPlugin();
+
+ if ( plugin )
+ return plugin->createPatternSelector( parent, modeFlags );
+ else
+ return 0;
}
bool YQOptionalWidgetFactory::hasSimplePatchSelector()
{
- return false;
+ return true;
}
YQSimplePatchSelector *
-YQOptionalWidgetFactory::createSimplePatchSelector( YWidget * parent )
+YQOptionalWidgetFactory::createSimplePatchSelector( YWidget * parent, long modeFlags )
{
- THROW_UNSUPPORTED( "YQSimplePatchSelector" );
+ YQPackageSelectorPlugin * plugin = YQUI::ui()->packageSelectorPlugin();
+
+ if ( plugin )
+ return plugin->createSimplePatchSelector( parent, modeFlags );
+ else
+ return 0;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQOption…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQOptionalWidgetFactory.h Wed Jun 27 17:58:34 2007
@@ -84,10 +84,10 @@
virtual YQBarGraph * createBarGraph ( YWidget * parent, list<int> values, list<string> labels );
virtual bool hasPatternSelector();
- virtual YQPatternSelector * createPatternSelector ( YWidget * parent );
+ virtual YQPatternSelector * createPatternSelector ( YWidget * parent, long modeFlags = 0 );
virtual bool hasSimplePatchSelector();
- virtual YQSimplePatchSelector * createSimplePatchSelector( YWidget * parent );
+ virtual YQSimplePatchSelector * createSimplePatchSelector( YWidget * parent, long modeFlags = 0 );
virtual bool hasMultiProgressMeter();
virtual YQMultiProgressMeter * createHMultiProgressMeter( YWidget * parent, const string & label, list<int> maxValues );
Modified: branches/tmp/sh/mod-ui/qt/src/YQPackageSelectorPlugin.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQPackag…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQPackageSelectorPlugin.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQPackageSelectorPlugin.cc Wed Jun 27 17:58:34 2007
@@ -24,6 +24,7 @@
#include "YQPackageSelector.h"
#include "YQPatternSelector.h"
#include "YQSimplePatchSelector.h"
+#include "YUIException.h"
#define PLUGIN_BASE_NAME "qt_pkg"
@@ -36,6 +37,8 @@
y2milestone( "Loaded %s plugin successfully from %s",
PLUGIN_BASE_NAME, pluginLibFullPath().c_str() );
}
+ else
+ YUI_THROW( YUIPluginException( PLUGIN_BASE_NAME ) );
}
@@ -45,18 +48,17 @@
}
-YWidget *
-YQPackageSelectorPlugin::createPackageSelector( YWidget * parent,
- YWidgetOpt & opt )
+YQPackageSelector *
+YQPackageSelectorPlugin::createPackageSelector( YWidget * parent, long modeFlags )
{
if ( error() )
return 0;
- YWidget * packageSelector = 0;
+ YQPackageSelector * packageSelector = 0;
try
{
- packageSelector = new YQPackageSelector( (QWidget *) ( parent->widgetRep() ), opt );
+ packageSelector = new YQPackageSelector( parent, modeFlags );
}
catch (const std::exception & e)
{
@@ -68,23 +70,24 @@
y2error( "Caught unspecified exception." );
y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
}
+
+ YUI_CHECK_NEW( packageSelector );
return packageSelector;
}
-YWidget *
-YQPackageSelectorPlugin::createPatternSelector( YWidget * parent,
- YWidgetOpt & opt )
+YQPatternSelector *
+YQPackageSelectorPlugin::createPatternSelector( YWidget * parent, long modeFlags )
{
if ( error() )
return 0;
- YWidget * patternSelector = 0;
+ YQPatternSelector * patternSelector = 0;
try
{
- patternSelector = new YQPatternSelector( (QWidget *) ( parent->widgetRep() ), opt );
+ patternSelector = new YQPatternSelector( parent, modeFlags );
}
catch (const std::exception & e)
{
@@ -96,23 +99,24 @@
y2error( "Caught unspecified exception." );
y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
}
+
+ YUI_CHECK_NEW( patternSelector );
return patternSelector;
}
-YWidget *
-YQPackageSelectorPlugin::createSimplePatchSelector( YWidget * parent,
- YWidgetOpt & opt )
+YQSimplePatchSelector *
+YQPackageSelectorPlugin::createSimplePatchSelector( YWidget * parent, long modeFlags )
{
if ( error() )
return 0;
- YWidget * simplePatchSelector = 0;
+ YQSimplePatchSelector * simplePatchSelector = 0;
try
{
- simplePatchSelector = new YQSimplePatchSelector( (QWidget *) ( parent->widgetRep() ), opt );
+ simplePatchSelector = new YQSimplePatchSelector( parent, modeFlags );
}
catch (const std::exception & e)
{
@@ -124,6 +128,8 @@
y2error( "Caught unspecified exception." );
y2error( "This is a libzypp problem. Do not file a bug against the UI!" );
}
+
+ YUI_CHECK_NEW( simplePatchSelector );
return simplePatchSelector;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQPackageSelectorPlugin.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQPackag…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQPackageSelectorPlugin.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQPackageSelectorPlugin.h Wed Jun 27 17:58:34 2007
@@ -21,6 +21,9 @@
#define YQPackageSelectorPlugin_h
#include <YPackageSelectorPlugin.h>
+#include "YQPackageSelector.h"
+#include "YQPatternSelector.h"
+#include "YQSimplePatchSelector.h"
/**
@@ -48,8 +51,8 @@
* 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 YWidget * createPackageSelector( YWidget * parent,
- YWidgetOpt & opt );
+ virtual YQPackageSelector * createPackageSelector ( YWidget * parent,
+ long modeFlags = 0 );
/**
* Create a pattern selector.
@@ -57,16 +60,16 @@
* 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 YWidget * createPatternSelector( YWidget * parent,
- YWidgetOpt & opt );
+ virtual YQPatternSelector * createPatternSelector ( YWidget * parent,
+ long modeFlags = 0 );
/**
* Create a simple patch selector.
*
* 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 YWidget * createSimplePatchSelector( YWidget * parent,
- YWidgetOpt & opt );
+ virtual YQSimplePatchSelector * createSimplePatchSelector( YWidget * parent,
+ long modeFlags = 0 );
};
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI.h?r…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Wed Jun 27 17:58:34 2007
@@ -230,6 +230,12 @@
bool autoActivateDialogs() const { return _auto_activate_dialogs; }
/**
+ * Change automatic dialog activation
+ **/
+ void setAutoActivateDialogs( bool activate )
+ { _auto_activate_dialogs = activate; }
+
+ /**
* Are we running embedded into another application, e.g., inside the KDE
* control center?
**/
@@ -449,7 +455,6 @@
YWidget * createLogView ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, int visibleLines, int maxLines );
YWidget * createMultiLineEdit ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, const YCPString & text);
YWidget * createProgressBar ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, const YCPInteger & maxProgress, const YCPInteger & currentProgress );
- YWidget * createPackageSelector ( YWidget * parent, YWidgetOpt & opt, const YCPString & floppyDevice );
YWidget * createMenuButton ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createMultiSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
@@ -514,14 +519,6 @@
const YCPString & freeFieldLabel,
const YCPString & newPartFieldLabel );
- bool hasPatternSelector();
- YWidget * createPatternSelector ( YWidget * parent,
- YWidgetOpt & opt );
-
- bool hasSimplePatchSelector();
- YWidget * createSimplePatchSelector( YWidget * parent,
- YWidgetOpt & opt );
-
bool hasWizard();
YWidget * createWizard ( YWidget * parent, YWidgetOpt & opt,
const YCPValue & backButtonId, const YCPString & backButtonLabel,
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI_wid…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Wed Jun 27 17:58:34 2007
@@ -35,7 +35,6 @@
#include "YQMultiProgressMeter.h"
#include "YQMultiSelectionBox.h"
#include "YQPackageSelectorPlugin.h"
-#include "YQPackageSelector.h"
#include "YQPartitionSplitter.h"
#include "YQPatternSelector.h"
#include "YQSimplePatchSelector.h"
@@ -106,25 +105,6 @@
}
-YWidget * YQUI::createPackageSelector ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & floppyDevice )
-{
- _auto_activate_dialogs = false;
- YWidget * packageSelector = 0;
-
- YQPackageSelectorPlugin * plugin = packageSelectorPlugin();
-
- if ( plugin )
- {
- packageSelector = plugin->createPackageSelector( parent, opt );
- }
-
- return packageSelector;
-}
-
-
-
YWidget * YQUI::createMenuButton ( YWidget * parent,
YWidgetOpt & opt,
const YCPString & label )
@@ -322,49 +302,6 @@
-bool YQUI::hasPatternSelector()
-{
- return true;
-}
-
-
-YWidget * YQUI::createPatternSelector( YWidget * parent,
- YWidgetOpt & opt )
-{
- YWidget * patternSelector = 0;
- YQPackageSelectorPlugin * plugin = packageSelectorPlugin();
-
- if ( plugin )
- {
- patternSelector = plugin->createPatternSelector( parent, opt );
- }
-
- return patternSelector;
-}
-
-
-bool YQUI::hasSimplePatchSelector()
-{
- return true;
-}
-
-
-YWidget * YQUI::createSimplePatchSelector( YWidget * parent,
- YWidgetOpt & opt )
-{
- YWidget * simplePatchSelector = 0;
- YQPackageSelectorPlugin * plugin = packageSelectorPlugin();
-
- if ( plugin )
- {
- simplePatchSelector = plugin->createSimplePatchSelector( parent, opt );
- }
-
- return simplePatchSelector;
-}
-
-
-
bool YQUI::hasWizard()
{
return true;
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidget…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc Wed Jun 27 17:58:34 2007
@@ -18,7 +18,9 @@
#include "YQWidgetFactory.h"
+#include "YQUI.h"
#include "YUIException.h"
+#include "YQPackageSelectorPlugin.h"
#include <string>
@@ -254,9 +256,16 @@
YQPackageSelector *
-YQWidgetFactory::createPackageSelector( YWidget * parent )
+YQWidgetFactory::createPackageSelector( YWidget * parent, long modeFlags )
{
- return 0; // FIXME: TO DO
+ YQUI::ui()->setAutoActivateDialogs( false );
+
+ YQPackageSelectorPlugin * plugin = YQUI::ui()->packageSelectorPlugin();
+
+ if ( plugin )
+ return plugin->createPackageSelector( parent, modeFlags );
+ else
+ return 0;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidget…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h Wed Jun 27 17:58:34 2007
@@ -105,7 +105,7 @@
virtual YQLogView * createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 );
virtual YQSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label );
- virtual YQPackageSelector * createPackageSelector ( YWidget * parent );
+ virtual YQPackageSelector * createPackageSelector ( YWidget * parent, long modeFlags = 0 );
virtual YWidget * createPkgSpecial ( YWidget * parent, const string & name ); // NCurses only, will throw exception in the Qt UI
//
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPa…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelector.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelector.cc Wed Jun 27 17:58:34 2007
@@ -97,9 +97,9 @@
-YQPackageSelector::YQPackageSelector( QWidget * parent,
- const YWidgetOpt & opt )
- : YQPackageSelectorBase( parent, opt )
+YQPackageSelector::YQPackageSelector( YWidget * parent,
+ long modeFlags )
+ : YQPackageSelectorBase( parent, modeFlags )
{
_showChangesDialog = true;
_autoDependenciesCheckBox = 0;
@@ -126,14 +126,9 @@
_excludeDevelPkgs = 0;
_excludeDebugInfoPkgs = 0;
- _searchMode = opt.searchMode.value();
- _testMode = opt.testMode.value();
- _updateMode = opt.updateMode.value();
- _summaryMode = opt.summaryMode.value();
- _instSourcesMode = opt.instSourcesMode.value();
- if ( _youMode ) y2milestone( "YOU mode" );
- if ( _updateMode ) y2milestone( "Update mode" );
+ if ( onlineUpdateMode() ) y2milestone( "Online update mode" );
+ if ( updateMode() ) y2milestone( "Update mode" );
basicLayout();
@@ -144,7 +139,7 @@
if ( _pkgList )
_pkgList->clear();
- if ( _patchFilterView && _youMode )
+ if ( _patchFilterView && onlineUpdateMode() )
{
if ( _filters && _patchFilterView && _patchList )
{
@@ -152,7 +147,7 @@
_patchList->filter();
}
}
- else if ( _instSrcFilterView && _instSourcesMode )
+ else if ( _instSrcFilterView && instSourcesMode() )
{
if ( YQPkgInstSrcList::countEnabledSources() > 1 )
{
@@ -173,13 +168,13 @@
_updateProblemFilterView->filter();
}
- else if ( _searchMode && _searchFilterView )
+ else if ( searchMode() && _searchFilterView )
{
_filters->showPage( _searchFilterView );
_searchFilterView->filter();
QTimer::singleShot( 0, _searchFilterView, SLOT( setFocus() ) );
}
- else if ( _summaryMode && _statusFilterView )
+ else if ( summaryMode() && _statusFilterView )
{
_filters->showPage( _statusFilterView );
_statusFilterView->filter();
@@ -204,7 +199,7 @@
#if CHECK_DEPENDENCIES_ON_STARTUP
- if ( ! _testMode && ! _youMode )
+ if ( ! testMode() && ! onlineUpdateMode() )
{
// Fire up the first dependency check in the main loop.
// Don't do this right away - wait until all initializations are finished.
@@ -265,10 +260,10 @@
// Update problem view
//
- if ( _updateMode )
+ if ( updateMode() )
{
if ( YQPkgUpdateProblemFilterView::haveProblematicPackages()
- || _testMode )
+ || testMode() )
{
_updateProblemFilterView = new YQPkgUpdateProblemFilterView( parent );
CHECK_PTR( _updateProblemFilterView );
@@ -281,7 +276,7 @@
// Patches view
//
- if ( _youMode
+ if ( onlineUpdateMode()
#if ALWAYS_SHOW_PATCHES_VIEW_IF_PATCHES_AVAILABLE
|| ! zyppPool().empty<zypp::Patch>()
#endif
@@ -293,7 +288,7 @@
// Patterns view
//
- if ( ! zyppPool().empty<zypp::Pattern>() || _testMode )
+ if ( ! zyppPool().empty<zypp::Pattern>() || testMode() )
{
_patternList = new YQPkgPatternList( parent, true );
CHECK_PTR( _patternList );
@@ -317,7 +312,7 @@
// Selections view
//
- if ( ! zyppPool().empty<zypp::Selection>() || _testMode )
+ if ( ! zyppPool().empty<zypp::Selection>() || testMode() )
{
_selList = new YQPkgSelList( parent, true );
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPa…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelector.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelector.h Wed Jun 27 17:58:34 2007
@@ -16,7 +16,6 @@
/-*/
-// -*- c++ -*-
#ifndef YQPackageSelector_h
#define YQPackageSelector_h
@@ -66,10 +65,9 @@
public:
- YQPackageSelector( QWidget * parent,
- const YWidgetOpt & opt );
-
+ YQPackageSelector( YWidget * parent, long modeFlags = 0 );
+
public slots:
/**
@@ -293,12 +291,6 @@
// Data members
- bool _searchMode;
- bool _testMode;
- bool _updateMode;
- bool _summaryMode;
- bool _instSourcesMode;
-
QCheckBox * _autoDependenciesCheckBox;
QPushButton * _checkDependenciesButton;
QTabWidget * _detailsViews;
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorBase.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPa…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorBase.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorBase.cc Wed Jun 27 17:58:34 2007
@@ -45,10 +45,10 @@
using std::string;
-YQPackageSelectorBase::YQPackageSelectorBase( QWidget * parent,
- const YWidgetOpt & opt )
- : QVBox( parent )
- , YPackageSelector( opt )
+YQPackageSelectorBase::YQPackageSelectorBase( YWidget * parent,
+ long modeFlags )
+ : QVBox( (QWidget *) parent->widgetRep() )
+ , YPackageSelector( parent, modeFlags )
{
setWidgetRep( this );
@@ -56,7 +56,6 @@
_pkgConflictDialog = 0;
_diskUsageList = 0;
_pkgConflictDialog = 0;
- _youMode = opt.youMode.value();
YQUI::setTextdomain( "packages-qt" );
setFont( YQUI::ui()->currentFont() );
@@ -298,7 +297,7 @@
bool allConfirmed = true;
- if ( _youMode )
+ if ( onlineUpdateMode() )
allConfirmed = showPendingLicenseAgreements( zyppPatchesBegin(), zyppPatchesEnd() );
allConfirmed = showPendingLicenseAgreements( zyppPkgBegin(), zyppPkgEnd() ) && allConfirmed;
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorBase.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPa…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorBase.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorBase.h Wed Jun 27 17:58:34 2007
@@ -16,7 +16,6 @@
/-*/
-// -*- c++ -*-
#ifndef YQPackageSelectorBase_h
#define YQPackageSelectorBase_h
@@ -48,7 +47,7 @@
* Will initialize package and selection managers and create conflict
* dialogs.
**/
- YQPackageSelectorBase( QWidget * parent, const YWidgetOpt & opt );
+ YQPackageSelectorBase( YWidget * parent, long modeFlags = 0 );
/**
* Destructor
@@ -194,7 +193,6 @@
// Data members
- bool _youMode;
bool _showChangesDialog;
YQPkgConflictDialog * _pkgConflictDialog;
YQPkgDiskUsageList * _diskUsageList;
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorHelp.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPa…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorHelp.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPackageSelectorHelp.cc Wed Jun 27 17:58:34 2007
@@ -42,7 +42,7 @@
html += para( _( "<b>Note:</b> This is a just a short overview."
" Refer to the manual for details." ) );
- if ( _youMode )
+ if ( onlineUpdateMode() )
{
// Help specific to online update mode
@@ -66,7 +66,7 @@
" from <b>Filter</b> at the upper left:" ) );
html += "<ul>";
}
- else // ! _youMode
+ else // ! _onlineUpdateMode
{
// Help specific to normal (non-online-update) mode
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPatternSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPa…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPatternSelector.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPatternSelector.cc Wed Jun 27 17:58:34 2007
@@ -53,9 +53,8 @@
#define MARGIN 6
-YQPatternSelector::YQPatternSelector( QWidget * parent,
- const YWidgetOpt & opt )
- : YQPackageSelectorBase( parent, opt )
+YQPatternSelector::YQPatternSelector( YWidget * parent, long modeFlags )
+ : YQPackageSelectorBase( parent, modeFlags )
{
_patternList = 0;
_selList = 0;
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPatternSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPa…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPatternSelector.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPatternSelector.h Wed Jun 27 17:58:34 2007
@@ -16,7 +16,6 @@
/-*/
-// -*- c++ -*-
#ifndef YQPatternSelector_h
#define YQPatternSelector_h
@@ -42,7 +41,7 @@
public:
- YQPatternSelector( QWidget * parent, const YWidgetOpt & opt );
+ YQPatternSelector( YWidget * parent, long modeFlags );
protected slots:
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgChangeLogView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgChangeLogView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgChangeLogView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgChangeLogView_h
#define YQPkgChangeLogView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgChangesDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgChangesDialog.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgChangesDialog.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgChangesDialog_h
#define YQPkgChangesDialog_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgConflictDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgConflictDialog.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgConflictDialog.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgConflictDialog_h
#define YQPkgConflictDialog_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgConflictList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgConflictList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgConflictList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgConflictList_h
#define YQPkgConflictList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDependenciesView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDependenciesView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDependenciesView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgDependenciesView_h
#define YQPkgDependenciesView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDescriptionDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDescriptionDialog.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDescriptionDialog.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgDescriptionDialog_h
#define YQPkgDescriptionDialog_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDescriptionView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDescriptionView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDescriptionView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgDescriptionView_h
#define YQPkgDescriptionView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDiskUsageList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDiskUsageList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDiskUsageList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgDiskUsageList_h
#define YQPkgDiskUsageList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDiskUsageWarningDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDiskUsageWarningDialog.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgDiskUsageWarningDialog.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgDiskUsageWarningDialog_h
#define YQPkgDiskUsageWarningDialog_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgFileListView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgFileListView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgFileListView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgFileListView_h
#define YQPkgFileListView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgGenericDetailsView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgGenericDetailsView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgGenericDetailsView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgGenericDetailsView_h
#define YQPkgGenericDetailsView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgInstSrcFilterView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgInstSrcFilterView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgInstSrcFilterView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgInstSrcFilterView_h
#define YQPkgInstSrcFilterView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgInstSrcList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgInstSrcList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgInstSrcList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgInstSrcList_h
#define YQPkgInstSrcList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgLangList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgLangList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgLangList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgLangList_h
#define YQPkgLangList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgList_h
#define YQPkgList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgObjList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgObjList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgObjList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgObjList_h
#define YQPkgObjList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatchFilterView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatchFilterView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatchFilterView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgPatchFilterView_h
#define YQPkgPatchFilterView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatchList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatchList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatchList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgPatchList_h
#define YQPkgPatchList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatternList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatternList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgPatternList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgPatternList_h
#define YQPkgPatternList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgProductDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgProductDialog.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgProductDialog.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgProductDialog_h
#define YQPkgProductDialog_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgProductList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgProductList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgProductList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgProductList_h
#define YQPkgProductList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgRpmGroupTagsFilterView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgRpmGroupTagsFilterView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgRpmGroupTagsFilterView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgRpmGroupTagsFilterView_h
#define YQPkgRpmGroupTagsFilterView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSearchFilterView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSearchFilterView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSearchFilterView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgSearchFilterView_h
#define YQPkgSearchFilterView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelDescriptionView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelDescriptionView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelDescriptionView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgSelDescriptionView_h
#define YQPkgSelDescriptionView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelList.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelList.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgSelList_h
#define YQPkgSelList_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelMapper.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelMapper.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgSelMapper.h Wed Jun 27 17:58:34 2007
@@ -16,7 +16,6 @@
/-*/
-// -*- c++ -*-
#ifndef YQPkgSelMapper_h
#define YQPkgSelMapper_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgStatusFilterView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgStatusFilterView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgStatusFilterView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgStatusFilterView_h
#define YQPkgStatusFilterView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgTechnicalDetailsView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgTechnicalDetailsView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgTechnicalDetailsView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgTechnicalDetailsView_h
#define YQPkgTechnicalDetailsView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgTextDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgTextDialog.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgTextDialog.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgTextDialog_h
#define YQPkgTextDialog_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgUpdateProblemFilterView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgUpdateProblemFilterView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgUpdateProblemFilterView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgUpdateProblemFilterView_h
#define YQPkgUpdateProblemFilterView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgVersionsView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQPk…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgVersionsView.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQPkgVersionsView.h Wed Jun 27 17:58:34 2007
@@ -16,8 +16,6 @@
/-*/
-// -*- c++ -*-
-
#ifndef YQPkgVersionsView_h
#define YQPkgVersionsView_h
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQSimplePatchSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQSi…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQSimplePatchSelector.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQSimplePatchSelector.cc Wed Jun 27 17:58:34 2007
@@ -53,9 +53,8 @@
-YQSimplePatchSelector::YQSimplePatchSelector( QWidget * parent,
- const YWidgetOpt & opt )
- : YQPackageSelectorBase( parent, opt )
+YQSimplePatchSelector::YQSimplePatchSelector( YWidget * parent, long modeFlags )
+ : YQPackageSelectorBase( parent, modeFlags )
{
_patchFilterView = 0;
_patchList = 0;
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQSimplePatchSelector.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQSi…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQSimplePatchSelector.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQSimplePatchSelector.h Wed Jun 27 17:58:34 2007
@@ -16,7 +16,6 @@
/-*/
-// -*- c++ -*-
#ifndef YQSimplePatchSelector_h
#define YQSimplePatchSelector_h
@@ -41,7 +40,7 @@
public:
- YQSimplePatchSelector( QWidget * parent, const YWidgetOpt & opt );
+ YQSimplePatchSelector( YWidget * parent, long modeFlags );
protected slots:
Modified: branches/tmp/sh/mod-ui/qt/src/pkg/YQZypp.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/pkg/YQZy…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/pkg/YQZypp.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/pkg/YQZypp.h Wed Jun 27 17:58:34 2007
@@ -16,7 +16,6 @@
/-*/
-// -*- c++ -*-
#ifndef YQZypp_h
#define YQZypp_h
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39058 - in /branches/tmp/dmacvicar/ruby-yast: examples/ruby/ src/ruby/
by dmacvicar@svn.opensuse.org 27 Jun '07
by dmacvicar@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: dmacvicar
Date: Wed Jun 27 17:52:19 2007
New Revision: 39058
URL: http://svn.opensuse.org/viewcvs/yast?rev=39058&view=rev
Log:
SCR calls dont crash anymore
Modified:
branches/tmp/dmacvicar/ruby-yast/examples/ruby/Bar.rb
branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.ycp
branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb
branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.h
branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc
Modified: branches/tmp/dmacvicar/ruby-yast/examples/ruby/Bar.rb
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/Bar.rb (original)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/Bar.rb Wed Jun 27 17:52:19 2007
@@ -3,6 +3,6 @@
module Bar
def self.try
m = YaST::Module.new("SCR")
- return m.Read(".proc.modules")
+ return m.Read(".proc.modules").class.to_s
end
end
Modified: branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.ycp (original)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.ycp Wed Jun 27 17:52:19 2007
@@ -1,4 +1,3 @@
-
{
import "Bar";
string result = (string) Bar::try();
Modified: branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb (original)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb Wed Jun 27 17:52:19 2007
@@ -1,5 +1,22 @@
require 'yast'
+m = YaST::Module.new("SCR")
+m.Read(".proc.modules")
+
+exit
+m = YaST::Module.new("Timezone")
+zonemap = m.get_zonemap()
+puts zonemap.class
+zonemap.each do | element |
+ element.each do | key, value |
+ value.each do | k, v |
+ puts "#{k} #{v}"
+ end
+ end
+end
+
+
+exit
m = YaST::Module.new("Arch")
puts m.sparc32
puts m.arch_short
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.cc Wed Jun 27 17:52:19 2007
@@ -9,6 +9,9 @@
#include <ycp/YCPInteger.h>
#include <ycp/YCPFloat.h>
#include <ycp/YCPElement.h>
+#include <ycp/YCPSymbol.h>
+#include <ycp/YCPPath.h>
+#include <ycp/YCPVoid.h>
#include <ycp/Import.h>
#include "Y2RubyTypeConv.h"
@@ -65,6 +68,11 @@
}
return rblist;
}
+ else if (ycpval->isSymbol())
+ {
+ YCPSymbol symbol = ycpval->asSymbol();
+ return rb_intern(symbol->symbol_cstr());
+ }
rb_raise( rb_eRuntimeError, "Conversion of YCP type %s not supported", ycpval->toString().c_str() );
return Qnil;
}
@@ -73,9 +81,12 @@
YCPValue
rbvalue_2_ycpvalue( VALUE value )
{
+ y2internal("type: '%d'", TYPE(value));
// TODO conver integers, and add support for lists, ah, and boleans!
switch (TYPE(value))
{
+ case T_NIL:
+ return YCPVoid();
case T_STRING:
return YCPString(RSTRING (value)->ptr);
break;
@@ -99,6 +110,11 @@
// FIXME
return YCPValue();
break;
+ case T_SYMBOL:
+ y2internal("mira un mono!!!");
+ //return YCPSymbol(RSTRING(rb_funcall(value, rb_intern("to_s"), 0))->ptr);
+ return YCPSymbol(rb_id2name(rb_to_id(value)));
+
case T_DATA:
rb_raise( rb_eRuntimeError, "Object");
break;
@@ -108,3 +124,10 @@
return YCPValue();
}
}
+
+YCPValue
+rbvalue_2_ycppath( VALUE value )
+{
+ VALUE stringrep = rb_funcall(value, rb_intern("to_s"), 0);
+ return YCPPath(RSTRING(stringrep)->ptr);
+}
\ No newline at end of file
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.h (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.h Wed Jun 27 17:52:19 2007
@@ -19,5 +19,8 @@
YCPValue
rbvalue_2_ycpvalue( VALUE value );
+YCPValue
+rbvalue_2_ycppath( VALUE value );
+
#endif
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.cc Wed Jun 27 17:52:19 2007
@@ -143,7 +143,7 @@
// the func name (1st argument, is a symbol
// lets convert it to string
VALUE symbol_str = rb_funcall(symbol, rb_intern("to_s"), 0);
- y2internal("Function: [%s::%s] params: [%d]\n", RSTRING(namespace_name)->ptr, RSTRING(symbol_str)->ptr, argc);
+ y2internal("Dynamic Proxy: [%s::%s] with [%d] params\n", RSTRING(namespace_name)->ptr, RSTRING(symbol_str)->ptr, argc);
//Check_Type(argv[0], T_STRING);
//y2internal(RSTRING (symbol)->ptr);
@@ -158,10 +158,11 @@
// this is a hack before the builtin namespaces get a uniform interface:
if (! strcmp (RSTRING (namespace_name)->ptr, "SCR"))
{
+ y2internal("Dynamic Proxy: [%s::%s] is a call to SCR\n", RSTRING(namespace_name)->ptr, RSTRING(symbol_str)->ptr);
YCPValue res;
res = ycp_call_builtin( RSTRING(namespace_name)->ptr, RSTRING(symbol_str)->ptr, argc, argv);
- //return ycpvalue_2_rbvalue(res);
- return Qnil;
+ return ycpvalue_2_rbvalue(res);
+ //return Qnil;
}
Y2Component *c;
@@ -241,6 +242,7 @@
string qualified_name_s = module_name + "::" + func_name;
const char *qualified_name = qualified_name_s.c_str ();
+ y2milestone("Qualified name '%s'", qualified_name);
/*
this does not work across namespaces
TableEntry *bi_te = static_declarations.symbolTable ()->find (qualified_name);
@@ -261,7 +263,7 @@
y2error ("No such builtin '%s'", qualified_name);
return YCPNull ();
}
-
+ y2milestone("builtin '%s' found.", module_name.c_str());
// construct a builtin call using the proper overloaded builtin
YEBuiltin *bi_call = new YEBuiltin (bi_dt);
@@ -275,12 +277,21 @@
// go through the actual parameters
unsigned j;
- for (j = 0; j < argc; ++j)
+ for (j = 1; j < argc; ++j)
{
+ y2milestone("builtin param '%d'", j-1);
// convert the value according to the expected type:
constTypePtr param_tp = (j == 0)? Type::Path : Type::Any;
-
- YCPValue param_v = rbvalue_2_ycpvalue(argv[j] /*, param_tp */);
+ y2milestone("builtin param '%d' 1", j-1);
+
+ // convert the first argument to a path
+ YCPValue param_v;
+ if ( j == 1 )
+ param_v = rbvalue_2_ycppath(argv[j]);
+ else
+ param_v = rbvalue_2_ycpvalue(argv[j] /*, param_tp */);
+
+ y2milestone("builtin param '%d' 2", j-1);
if (param_v.isNull ())
{
// an error has already been reported, now refine it.
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc Wed Jun 27 17:52:19 2007
@@ -92,7 +92,7 @@
*/
virtual bool appendParameter (const YCPValue& arg)
{
- y2milestone("Adding parameter to function %s::%s of type %s", m_module_name.c_str(), m_local_name.c_str(), arg->valuetype_str());
+ y2internal("Adding parameter to function %s::%s of type %s", m_module_name.c_str(), m_local_name.c_str(), arg->valuetype_str());
m_call->add (arg);
return true;
}
@@ -222,7 +222,7 @@
signature += ",";
}
signature += ")";
- y2milestone("going to parse signature: '%s'", signature.c_str());
+ y2internal("going to parse signature: '%s'", signature.c_str());
sym_tp = Type::fromSignature(signature);
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39057 - in /branches/tmp/dmacvicar/ruby-yast: ./ cmake/modules/ examples/ruby/ src/ruby/
by dmacvicar@svn.opensuse.org 27 Jun '07
by dmacvicar@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: dmacvicar
Date: Wed Jun 27 16:36:42 2007
New Revision: 39057
URL: http://svn.opensuse.org/viewcvs/yast?rev=39057&view=rev
Log:
fixes, scr half working
fix load path
Added:
branches/tmp/dmacvicar/ruby-yast/examples/ruby/Bar.rb
branches/tmp/dmacvicar/ruby-yast/examples/ruby/Foo.rb
branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.rb
branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.ycp
Removed:
branches/tmp/dmacvicar/ruby-yast/examples/ruby/Duncan.rb
Modified:
branches/tmp/dmacvicar/ruby-yast/CMakeLists.txt
branches/tmp/dmacvicar/ruby-yast/cmake/modules/FindYast.cmake
branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp_2.ycp
branches/tmp/dmacvicar/ruby-yast/src/ruby/CMakeLists.txt
branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
Modified: branches/tmp/dmacvicar/ruby-yast/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/CMake…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/CMakeLists.txt (original)
+++ branches/tmp/dmacvicar/ruby-yast/CMakeLists.txt Wed Jun 27 16:36:42 2007
@@ -1,5 +1,8 @@
PROJECT(yast2-bindings)
+SET( CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -O3 -Wall -Woverloaded-virtual" )
+SET( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -O3 -Wall" )
+
# Library
IF ( DEFINED LIB )
SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
Modified: branches/tmp/dmacvicar/ruby-yast/cmake/modules/FindYast.cmake
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/cmake…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/cmake/modules/FindYast.cmake (original)
+++ branches/tmp/dmacvicar/ruby-yast/cmake/modules/FindYast.cmake Wed Jun 27 16:36:42 2007
@@ -30,7 +30,14 @@
FIND_LIBRARY(YAST_PLUGIN_WFM_LIBRARY NAMES py2wfm
PATHS
- /usr/lib/YaST2/plugin
+ ${YAST_PLUGIN_DIR}
+ /usr/lib
+ /usr/local/lib
+)
+
+FIND_LIBRARY(YAST_PLUGIN_SCR_LIBRARY NAMES py2scr
+ PATHS
+ ${YAST_PLUGIN_DIR}
/usr/lib
/usr/local/lib
)
Added: branches/tmp/dmacvicar/ruby-yast/examples/ruby/Bar.rb
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/Bar.rb (added)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/Bar.rb Wed Jun 27 16:36:42 2007
@@ -0,0 +1,8 @@
+require 'yast'
+
+module Bar
+ def self.try
+ m = YaST::Module.new("SCR")
+ return m.Read(".proc.modules")
+ end
+end
Added: branches/tmp/dmacvicar/ruby-yast/examples/ruby/Foo.rb
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
(empty)
Modified: branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp_2.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp_2.ycp (original)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp_2.ycp Wed Jun 27 16:36:42 2007
@@ -1,8 +1,8 @@
{
- import "Duncan";
- //integer result = (integer) Duncan::multiply_by_eight(6);
- integer result2 = (integer) Duncan::sum(2,3);
+ import "Foo";
+ //integer result = (integer) Foo::multiply_by_eight(6);
+ integer result2 = (integer) Foo::sum(2,3);
UI::OpenDialog(
`VBox(
`Label(sformat("%1", result2)),
Added: branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.rb
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.rb (added)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.rb Wed Jun 27 16:36:42 2007
@@ -0,0 +1,5 @@
+require 'yast'
+
+m = YaST::Module.new("SCR")
+puts m.bar
+exit
\ No newline at end of file
Added: branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.ycp (added)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/scr.ycp Wed Jun 27 16:36:42 2007
@@ -0,0 +1,13 @@
+
+{
+ import "Bar";
+ string result = (string) Bar::try();
+ UI::OpenDialog(
+ `VBox(
+ `Label(result),
+ `PushButton("OK")
+ )
+ );
+ UI::UserInput();
+ UI::CloseDialog();
+}
\ No newline at end of file
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/CMakeLists.txt (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/CMakeLists.txt Wed Jun 27 16:36:42 2007
@@ -32,6 +32,7 @@
TARGET_LINK_LIBRARIES( yast ${YAST_LIBRARY} )
TARGET_LINK_LIBRARIES( yast ${YAST_YCP_LIBRARY} )
TARGET_LINK_LIBRARIES( yast ${YAST_PLUGIN_WFM_LIBRARY} )
+TARGET_LINK_LIBRARIES( yast ${YAST_PLUGIN_SCR_LIBRARY} )
TARGET_LINK_LIBRARIES( yast ${RUBY_LIBRARY} )
INSTALL(TARGETS yast LIBRARY DESTINATION ${RUBY_ARCH_DIR} )
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.cc Wed Jun 27 16:36:42 2007
@@ -43,7 +43,7 @@
VALUE rbhash;
rbhash = rb_hash_new();
YCPMap map = ycpval->asMap();
- y2internal("map size %d\n", map.size());
+ y2internal("map size %d\n", (int) map.size());
for ( YCPMapIterator it = map.begin(); it != map.end(); ++it )
{
@@ -93,13 +93,16 @@
break;
case T_ARRAY:
// FIXME
+ return YCPValue();
break;
case T_HASH:
// FIXME
+ return YCPValue();
break;
case T_DATA:
rb_raise( rb_eRuntimeError, "Object");
break;
+ default:
std::cout << TYPE(value) << std::endl;
rb_raise( rb_eRuntimeError, "Conversion of Ruby type not supported");
return YCPValue();
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.cc Wed Jun 27 16:36:42 2007
@@ -66,6 +66,20 @@
return ns;
}
+void init_wfm ()
+{
+ y2milestone("init_wfm");
+// if (Y2WFMComponent::instance () == 0)
+// {
+ y2milestone("WFM init");
+ owned_wfmc = Y2ComponentBroker::createClient ("wfm");
+ if (owned_wfmc == 0)
+ {
+ y2error ("Cannot create WFM component");
+ }
+// }
+}
+
typedef struct brokerinfo
{
Y2Component *component;
@@ -100,31 +114,57 @@
{
Check_Type(param_ns_name, T_STRING);
rb_iv_set(self, "@namespace_name", param_ns_name);
+ init_wfm ();
return self;
}
+
+VALUE
+yast_module_name( VALUE self )
+{
+ return rb_iv_get(self, "@namespace_name");
+}
+
VALUE
yast_module_methods( VALUE self )
{
return Qnil;
}
+//forward declaration
+YCPValue ycp_call_builtin ( const string &module_name, const string &func_name, int argc, VALUE *argv );
+
VALUE
yast_module_proxy_method( int argc, VALUE *argv, VALUE self )
{
VALUE symbol = argv[0];
+ VALUE namespace_name = rb_iv_get(self, "@namespace_name");
+
// the func name (1st argument, is a symbol
// lets convert it to string
VALUE symbol_str = rb_funcall(symbol, rb_intern("to_s"), 0);
- y2internal("Function: [%s] params: [%d]\n", RSTRING(symbol_str)->ptr, argc);
+ y2internal("Function: [%s::%s] params: [%d]\n", RSTRING(namespace_name)->ptr, RSTRING(symbol_str)->ptr, argc);
//Check_Type(argv[0], T_STRING);
//y2internal(RSTRING (symbol)->ptr);
//Data_Get_Struct( self, class Y2Namespace, ns );
//ns = gNameSpaces[self];
+ // get the name of the module
+ //VALUE namespace_name = rb_funcall(self, rb_intern("name"), 0);
+
+
+ // SCR
+ // this is a hack before the builtin namespaces get a uniform interface:
+ if (! strcmp (RSTRING (namespace_name)->ptr, "SCR"))
+ {
+ YCPValue res;
+ res = ycp_call_builtin( RSTRING(namespace_name)->ptr, RSTRING(symbol_str)->ptr, argc, argv);
+ //return ycpvalue_2_rbvalue(res);
+ return Qnil;
+ }
+
Y2Component *c;
- VALUE namespace_name = rb_iv_get(self, "@namespace_name");
c = Y2ComponentBroker::getNamespaceComponent(RSTRING (namespace_name)->ptr);
if (c == NULL)
{
@@ -194,6 +234,105 @@
return Qnil;
}
+YCPValue ycp_call_builtin ( const string &module_name, const string &func_name, int argc, VALUE *argv )
+{
+ // access directly the statically declared builtins
+ extern StaticDeclaration static_declarations;
+ string qualified_name_s = module_name + "::" + func_name;
+ const char *qualified_name = qualified_name_s.c_str ();
+
+ /*
+ this does not work across namespaces
+ TableEntry *bi_te = static_declarations.symbolTable ()->find (qualified_name);
+ if (bi_te == NULL)
+ {
+ y2error ("No such builtin %s",qualified_name);
+ return YCPNull ();
+ }
+
+ SymbolEntry *bi_se = bi_te->sentry ();
+ assert (bi_se != NULL);
+ assert (bi_se->isBuiltin ());
+ declaration_t bi_dt = bi_se->declaration ();
+ */
+ declaration_t *bi_dt = static_declarations.findDeclaration (qualified_name);
+ if (bi_dt == NULL)
+ {
+ y2error ("No such builtin '%s'", qualified_name);
+ return YCPNull ();
+ }
+
+ // construct a builtin call using the proper overloaded builtin
+ YEBuiltin *bi_call = new YEBuiltin (bi_dt);
+
+ // attach the parameters:
+
+ // we would like to know the destination type so that we could
+ // convert eg a Ruby scalar to a YCP symbol, but because the
+ // builtins may be overloaded, let's say we want Any
+
+ // maybe a special exceptional hack to make Path for the 1st argument?
+
+ // go through the actual parameters
+ unsigned j;
+ for (j = 0; j < argc; ++j)
+ {
+ // convert the value according to the expected type:
+ constTypePtr param_tp = (j == 0)? Type::Path : Type::Any;
+
+ YCPValue param_v = rbvalue_2_ycpvalue(argv[j] /*, param_tp */);
+ if (param_v.isNull ())
+ {
+ // an error has already been reported, now refine it.
+ // Can't know parameter name?
+ y2error ("... when passing parameter #%u to builtin %s",
+ j, qualified_name);
+ return YCPNull ();
+ }
+ // Such YConsts without a specific type produce invalid
+ // bytecode. (Which is OK here)
+ // The actual parameter's YCode becomes owned by the function call?
+ YConst *param_c = new YConst (YCode::ycConstant, param_v);
+ // for attaching the parameter, must get the real type so that it matches
+ constTypePtr act_param_tp = Type::vt2type (param_v->valuetype ());
+ // Attach the parameter
+ // Returns NULL if OK, Type::Error if excessive argument
+ // Other errors (bad code, bad type) shouldn't happen
+ constTypePtr err_tp = bi_call->attachParameter (param_c, act_param_tp);
+ if (err_tp != NULL)
+ {
+ if (err_tp->isError ())
+ {
+ // TODO really need to know the place in Ruby code
+ // where we were called from.
+ y2error ("Excessive parameter to builtin %s", qualified_name);
+ }
+ else
+ {
+ y2internal ("attachParameter returned %s", err_tp->toString ().c_str ());
+ }
+ return YCPNull ();
+ }
+ } // for each actual parameter
+
+ // now must check if we got fewer parameters than needed
+ // or there was another error while resolving the overload
+ constTypePtr err_tp = bi_call->finalize (RubyLogger::instance ());
+ if (err_tp != NULL)
+ {
+ // apparently the error was already reported?
+ y2error ("Error type %s when finalizing builtin %s",
+ err_tp->toString ().c_str (), qualified_name);
+ return YCPNull ();
+ }
+
+ // go call it now!
+ y2debug ("Ruby is calling builtin %s", qualified_name);
+ YCPValue ret_yv = bi_call->evaluate (false /* no const subexpr elim */);
+ delete bi_call;
+
+ return ret_yv;
+}
extern "C"
{
@@ -202,7 +341,6 @@
{
YCPPathSearch::initialize ();
-
for ( list<string>::const_iterator it = YCPPathSearch::searchListBegin (YCPPathSearch::Module); it != YCPPathSearch::searchListEnd (YCPPathSearch::Module) ; ++it )
{
y2internal("%s\n", (*it).c_str() );
@@ -219,461 +357,6 @@
rb_define_alloc_func(rb_cBroker, yast_module_allocate);
rb_define_method(rb_cBroker, "initialize", RB_METHOD(yast_module_initialize), 1);
rb_define_method( rb_cBroker, "method_missing", RB_METHOD(yast_module_proxy_method), -1);
+ rb_define_method( rb_cBroker, "name", RB_METHOD(yast_module_name), -1);
}
}
-
-
-// forward declaration
-//YCPValue YCP_call_SCR (pTHX_ const char * func_name, const vector<SV *>& args);
-//YCPValue YCP_getset_variable (pTHX_ const char * ns_name, SymbolEntryPtr var_se, const vector<SV *>& args);
-
-// XS(XS_YCP_y2_logger); /* prototype to pass -Wmissing-prototypes */
-// XS(XS_YCP_y2_logger)
-// {
-// // defines "items", the number of arguments
-// dXSARGS;
-// if (items != 6)
-// {
-// y2internal ("y2_logger must have 6 arguments");
-// XSRETURN_EMPTY;
-// }
-// loglevel_t level = (loglevel_t) SvIV (ST (0));
-// const char * comp = SvPV_nolen (ST (1));
-// const char * file = SvPV_nolen (ST (2));
-// int line = SvIV (ST (3));
-// const char * function = SvPV_nolen (ST (4));
-// const char * message = SvPV_nolen (ST (5));
-// y2_logger (level, comp, file, line, function, "%s", message);
-// XSRETURN_EMPTY;
-// }
-
-// XS(XS_YCP_call_ycp); /* prototype to pass -Wmissing-prototypes */
-// XS(XS_YCP_call_ycp)
-// {
-// // defines "items", the number of arguments
-// dXSARGS; // must be called only once per xsub because it calls POPMARK
-//
-// /*
-// * Plan:
-// * get the namespace name
-// * get the function name
-// * get the ns from the component broker (importing it, if necessary)
-// * find the function
-// * check its declaration, trying to convert the actual parameters
-// * to the desired ones
-// * call it
-// * pass the return value - if it's a list and perl wanted a list, so be it
-// */
-//
-// // calling convention:
-// // namespace name (without trailing ::)
-// // function name
-// // function arguments
-// if (items < 2 || !SvPOK (ST (0)) || !SvPOK (ST (1)))
-// {
-// y2internal ("Ruby called YCP without specifying a namespace and a name");
-// XSRETURN_EMPTY;
-// }
-//
-// const char * ns_name = SvPV_nolen (ST (0));
-// const char * func_name = SvPV_nolen (ST (1));
-//
-// // The perl interpreter must not get reinitialized.
-// // Therefore we push what we got (aTHX) to YRuby so that it does
-// // not try to construct its own.
-// YRuby::acceptInterpreter (aTHX); // access the singleton object
-// YRuby *yperl = YRuby::yRuby (); // access the singleton object
-//
-// YCPValue ret_yv = YCPNull ();
-//
-// // access the parameters via a vector because using dXSARGS more
-// // than once per XSUB call messes up Ruby call stacks
-// vector<SV *> args;
-// args.reserve (items - 2);
-// I32 i;
-// for (i = 2; i < items; ++i)
-// {
-// args.push_back (ST (i));
-// }
-//
-// // this is a hack before the builtin namespaces get a uniform interface:
-// if (! strcmp (ns_name, "SCR"))
-// {
-// ret_yv = YCP_call_SCR (aTHX_ func_name, args);
-// }
-// else
-// {
-// Y2Namespace *ns = getNs (ns_name, func_name);
-// if (ns == NULL)
-// {
-// XSRETURN_EMPTY;
-// }
-//
-// // we want either a function or a variable
-// // so find a symbol of an unspecified category
-// TableEntry *sym_te = ns->table ()->find (func_name);
-//
-// if (sym_te == NULL)
-// {
-// y2error ("No such symbol %s::%s", ns_name, func_name);
-// XSRETURN_EMPTY;
-// }
-//
-// if (sym_te->sentry ()->isVariable () ||
-// sym_te->sentry ()->isReference ())
-// {
-// ret_yv = YCP_getset_variable (aTHX_ ns_name, sym_te->sentry (), args);
-// }
-// else
-// { // no indent yet
-//
-// Y2Function *func_call = ns->createFunctionCall (func_name, NULL);
-// if (func_call == NULL)
-// {
-// y2error ("No such function %s::%s", ns_name, func_name);
-// XSRETURN_EMPTY;
-// }
-//
-// // before we attach the parameters, we have to convert them
-// // from Ruby to YCP. That means knowing the destination type beforehand.
-// // (Later if we get overloading, this will become messy)
-//
-// // go through the actual parameters
-// unsigned j;
-// for (j = 0; j < args.size (); ++j)
-// {
-// // convert the value according to the expected type:
-//
-// constTypePtr param_tp = func_call->wantedParameterType ();
-//
-// YCPValue param_v = yperl->fromRubyScalar (args[j], param_tp);
-// if (param_v.isNull ())
-// {
-// // an error has already been reported, now refine it.
-// y2error ("... when passing parameter #%u to %s::%s",
-// j, ns_name, func_name);
-// XSRETURN_EMPTY;
-// }
-//
-// // Attach the parameter
-// bool ok = func_call->appendParameter (param_v);
-// if (!ok)
-// {
-// // TODO really need to know the place in Ruby code
-// // where we were called from.
-// XSRETURN_EMPTY;
-// }
-// } // for each actual parameter
-//
-// bool ok = func_call->finishParameters ();
-// if (!ok)
-// {
-// // TODO really need to know the place in Ruby code
-// // where we were called from.
-// XSRETURN_EMPTY;
-// }
-// // go call it now!
-// y2debug ("Ruby is calling %s::%s", ns_name, func_name);
-// ret_yv = func_call->evaluateCall ();
-// delete func_call;
-//
-// } // if not variable
-// }
-//
-// if (ret_yv.isNull ())
-// {
-// XSRETURN_EMPTY;
-// }
-//
-// y2debug ("YCP returned %s", ret_yv->toString ().c_str ());
-//
-// I32 context = GIMME_V; // what context were we called in?
-// if (context == G_VOID)
-// {
-// y2debug ("void context, returning nothing");
-// XSRETURN_EMPTY;
-// }
-// #if 0
-// // disabled to be consistent with YRuby::call - disregard array context
-// else if (context == G_ARRAY && ret_yv->isList ())
-// {
-// y2debug ("returning a list");
-// // return a list iff they want a list and we have it
-// YCPList ret_lv = ret_yv->asList ();
-// int ret_len = ret_lv->size ();
-//
-// SP -= items; // reset stack pointer (declared by dXSARGS)
-// EXTEND (SP, ret_len); // make room for the list
-// for (int i = 0; i < ret_len; ++i)
-// {
-// // put return values, no need to XPUSHs
-// PUSHs (sv_2mortal (yperl->newRubyScalar (ret_lv->value (i), false)));
-// }
-// XSRETURN (ret_len);
-// }
-// #endif
-// else
-// {
-// y2debug ("returning a scalar");
-// ST (0) = sv_2mortal (yperl->newRubyScalar (ret_yv, false));
-// XSRETURN (1);
-// }
-// }
-//
-//
-// YCPValue YCP_call_SCR (pTHX_ const char * func_name, const vector<SV *>& args)
-// {
-// // access directly the statically declared builtins
-// extern StaticDeclaration static_declarations;
-// string qualified_name_s = string ("SCR::") + func_name;
-// const char *qualified_name = qualified_name_s.c_str ();
-//
-// /*
-// this does not work across namespaces
-// TableEntry *bi_te = static_declarations.symbolTable ()->find (qualified_name);
-// if (bi_te == NULL)
-// {
-// y2error ("No such builtin %s",qualified_name);
-// return YCPNull ();
-// }
-//
-// SymbolEntry *bi_se = bi_te->sentry ();
-// assert (bi_se != NULL);
-// assert (bi_se->isBuiltin ());
-// declaration_t bi_dt = bi_se->declaration ();
-// */
-// declaration_t *bi_dt = static_declarations.findDeclaration (qualified_name);
-// if (bi_dt == NULL)
-// {
-// y2error ("No such builtin '%s'", qualified_name);
-// return YCPNull ();
-// }
-//
-// // construct a builtin call using the proper overloaded builtin
-// YEBuiltin *bi_call = new YEBuiltin (bi_dt);
-//
-// // attach the parameters:
-//
-// // we would like to know the destination type so that we could
-// // convert eg a Ruby scalar to a YCP symbol, but because the
-// // builtins may be overloaded, let's say we want Any
-//
-// // maybe a special exceptional hack to make Path for the 1st argument?
-//
-// YRuby::acceptInterpreter (aTHX); // access the singleton object
-// YRuby *yperl = YRuby::yRuby (); // access the singleton object
-// // go through the actual parameters
-// unsigned j;
-// for (j = 0; j < args.size (); ++j)
-// {
-// // convert the value according to the expected type:
-// constTypePtr param_tp = (j == 0)? Type::Path : Type::Any;
-//
-// YCPValue param_v = yperl->fromRubyScalar (args[j], param_tp);
-// if (param_v.isNull ())
-// {
-// // an error has already been reported, now refine it.
-// // Can't know parameter name?
-// y2error ("... when passing parameter #%u to builtin %s",
-// j, qualified_name);
-// return YCPNull ();
-// }
-// // Such YConsts without a specific type produce invalid
-// // bytecode. (Which is OK here)
-// // The actual parameter's YCode becomes owned by the function call?
-// YConst *param_c = new YConst (YCode::ycConstant, param_v);
-// // for attaching the parameter, must get the real type so that it matches
-// constTypePtr act_param_tp = Type::vt2type (param_v->valuetype ());
-// // Attach the parameter
-// // Returns NULL if OK, Type::Error if excessive argument
-// // Other errors (bad code, bad type) shouldn't happen
-// constTypePtr err_tp = bi_call->attachParameter (param_c, act_param_tp);
-// if (err_tp != NULL)
-// {
-// if (err_tp->isError ())
-// {
-// // TODO really need to know the place in Ruby code
-// // where we were called from.
-// y2error ("Excessive parameter to builtin %s",
-// qualified_name);
-// }
-// else
-// {
-// y2internal ("attachParameter returned %s",
-// err_tp->toString ().c_str ());
-// }
-// return YCPNull ();
-// }
-// } // for each actual parameter
-//
-// // now must check if we got fewer parameters than needed
-// // or there was another error while resolving the overload
-// constTypePtr err_tp = bi_call->finalize (RubyLogger::instance ());
-// if (err_tp != NULL)
-// {
-// // apparently the error was already reported?
-// y2error ("Error type %s when finalizing builtin %s",
-// err_tp->toString ().c_str (), qualified_name);
-// return YCPNull ();
-// }
-//
-// // go call it now!
-// y2debug ("Ruby is calling builtin %s", qualified_name);
-// YCPValue ret_yv = bi_call->evaluate (false /* no const subexpr elim */);
-// delete bi_call;
-//
-// return ret_yv;
-// }
-//
-// /*
-// * If we got no arguments, return the variable value.
-// * If we got one argument, set the variable value (return YCPVoid).
-// * Otherwise error (and return YCPNull)
-// * ns_name is for error reporting
-// */
-// YCPValue YCP_getset_variable (pTHX_ const char * ns_name, SymbolEntryPtr var_se, const vector<SV *>& args)
-// {
-// YCPValue ret_yv = YCPNull ();
-// unsigned n = args.size ();
-// // first two args are the namespace and variable name
-// if (n == 0)
-// {
-// // get
-// ret_yv = var_se->value ();
-// }
-// else if (n == 1)
-// {
-// // set
-// YRuby::acceptInterpreter (aTHX); // access the singleton object
-// YRuby *yperl = YRuby::yRuby (); // access the singleton object
-// YCPValue val_yv = yperl->fromRubyScalar (args[0], var_se->type ());
-// if (val_yv.isNull ())
-// {
-// // an error has already been reported, now refine it.
-// y2error ("... when setting value of %s::%s",
-// ns_name, var_se->name ());
-// return YCPNull ();
-// }
-// ret_yv = var_se->setValue (val_yv);
-// }
-// else
-// {
-// y2error ("Variable %s: don't know what to do, %u arguments",
-// var_se->name (), n);
-// }
-// return ret_yv;
-// }
-//
-// // XS_YCP_close_ui is called in END to close the ncurses window
-// // if the ui was created in Ruby
-// Y2Component *owned_uic = 0;
-// Y2Component *owned_wfmc = 0;
-//
-// // creates a ui component, if not already there, and returns the name
-// // of the one that will be used
-// XS(XS_YCP_init_ui); /* prototype to pass -Wmissing-prototypes */
-// XS(XS_YCP_init_ui)
-// {
-// dXSARGS;
-//
-// const char *ui_name = "ncurses";
-//
-// if (items == 1)
-// {
-// ui_name = SvPV_nolen (ST (0));
-// }
-// else if (items != 0)
-// {
-// y2error ("Zero or one arguments required (ui name, default %s", ui_name);
-// XSRETURN_EMPTY;
-// }
-//
-// Y2Component *c = YUIComponent::uiComponent ();
-// if (c == 0)
-// {
-// y2debug ("UI component not created yet, creating %s", ui_name);
-//
-// c = Y2ComponentBroker::createServer (ui_name);
-// if (c == 0)
-// {
-// y2error ("Cannot create component %s", ui_name);
-// XSRETURN_EMPTY;
-// }
-//
-// if (YUIComponent::uiComponent () == 0)
-// {
-// y2error ("Component %s is not a UI", ui_name);
-// XSRETURN_EMPTY;
-// }
-// else
-// {
-// // got it - initialize, remember
-// c->setServerOptions (0, NULL);
-// owned_uic = c;
-// }
-// }
-// else
-// {
-// y2debug ("UI component already present: %s", c->name ().c_str ());
-// }
-//
-// ST (0) = sv_2mortal (newSVpv (c->name ().c_str (), 0));
-// XSRETURN (1);
-// }
-
-void init_wfm ()
-{
- if (Y2WFMComponent::instance () == 0)
- {
- owned_wfmc = Y2ComponentBroker::createClient ("wfm");
- if (owned_wfmc == 0)
- {
- y2error ("Cannot create WFM component");
- }
- }
-}
-
-// XS(XS_YCP_close_components); /* prototype to pass -Wmissing-prototypes */
-// XS(XS_YCP_close_components)
-// {
-// dXSARGS;
-// // get rid of warning: unused variable `I32 items'
-// I32 __attribute__ ((unused)) foo = items;
-//
-// if (owned_uic != 0)
-// {
-// delete owned_uic;
-// owned_uic = 0;
-// }
-//
-// if (owned_wfmc != 0)
-// {
-// delete owned_wfmc;
-// owned_wfmc = 0;
-// }
-//
-// XSRETURN_YES;
-// }
-//
-// /* called by XSLoader::load ('YaST::YCP') */
-// #ifdef __cplusplus
-// extern "C"
-// #endif
-// XS(boot_YaST__YCP); /* prototype to pass -Wmissing-prototypes */
-// XS(boot_YaST__YCP)
-// {
-// dXSARGS;
-// // get rid of warning: unused variable `I32 items'
-// I32 __attribute__ ((unused)) foo = items;
-// char* file = __FILE__;
-//
-// XS_VERSION_BOOTCHECK ;
-//
-// init_wfm ();
-//
-// newXS("YaST::YCP::call_ycp", XS_YCP_call_ycp, file);
-// newXS("YaST::YCP::close_components", XS_YCP_close_components, file);
-// newXS("YaST::YCP::init_ui", XS_YCP_init_ui, file);
-// newXS("YaST::YCP::y2_logger", XS_YCP_y2_logger, file);
-// XSRETURN_YES;
-// }
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc Wed Jun 27 16:36:42 2007
@@ -60,6 +60,7 @@
ruby_init();
//ruby_options(argc - 1, ++argv);
ruby_script("yast");
+ ruby_init_loadpath();
}
YRuby::~YRuby()
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39056 - in /branches/tmp/sh/mod-ui: core/libyui/doc/examples/ core/libyui/src/ qt/src/
by sh-sh-sh@svn.opensuse.org 27 Jun '07
by sh-sh-sh@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: sh-sh-sh
Date: Wed Jun 27 15:56:28 2007
New Revision: 39056
URL: http://svn.opensuse.org/viewcvs/yast?rev=39056&view=rev
Log:
ported YImage
Removed:
branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-local.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-tiled.ycp
Modified:
branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-animated.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-scaled.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image1.ycp
branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YImage.cc
branches/tmp/sh/mod-ui/core/libyui/src/YImage.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/YQDialog.cc
branches/tmp/sh/mod-ui/qt/src/YQImage.cc
branches/tmp/sh/mod-ui/qt/src/YQImage.h
branches/tmp/sh/mod-ui/qt/src/YQUI.h
branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-animated.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-animated.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-animated.ycp Wed Jun 27 15:56:28 2007
@@ -1,16 +1,15 @@
-/**
- * Example for an animated image
- **/
+// Animated image example
{
- global define void MovieDemo(byteblock movie) ``{
- UI::OpenDialog(
- `VBox(
- `Image(`opt(`animated), movie, "Movie"),
- `PushButton("&OK")));
- UI::UserInput();
- UI::CloseDialog();
- };
- byteblock movie = (byteblock) SCR::Read( .target.byte, "/usr/share/splash/keys.mng" );
- MovieDemo( movie );
+ UI::OpenDialog(
+ `VBox(
+ `MinSize( 30, 10,
+ `Image(`opt(`animated), "/usr/lib/qt3/doc/examples/widgets/trolltech.gif" )
+ ),
+ `PushButton(`opt(`default), "&OK")
+ )
+ );
+
+ UI::UserInput();
+ UI::CloseDialog();
}
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-scaled.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-scaled.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image-scaled.ycp Wed Jun 27 15:56:28 2007
@@ -1,31 +1,16 @@
-/**
- * Advanced Image widget features:
- * Load image from local file and scale it to fit the available space.
- **/
+// Animated image example
{
-
- if ( ! lookup( UI::GetDisplayInfo(), "HasLocalImageSupport", false ) )
- {
- UI::OpenDialog(
- `VBox(
- `Label("Loading images from local files not supported!"),
- `PushButton(`opt(`default), "&OK")
- )
- );
- UI::UserInput();
- UI::CloseDialog();
-
- return;
- }
-
- UI::OpenDialog( `opt(`defaultsize),
+ UI::OpenDialog(
`VBox(
- `Image( `opt(`scaleToFit), "/usr/share/doc/susetour/img/games0.png", "Games" ),
- `Right( `Label( "Resize the window to scale the image" ) ),
+ `MinSize( 30, 10,
+ `Image(`opt(`scaleToFit ),
+ "/usr/share/wallpapers/alta-badia.jpg" )
+ ),
`PushButton(`opt(`default), "&OK")
)
);
+
UI::UserInput();
UI::CloseDialog();
}
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image1.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/doc…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image1.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/Image1.ycp Wed Jun 27 15:56:28 2007
@@ -1,17 +1,12 @@
-/**
- * Example for simple images:
- * Creates one standard (predefined) image and a user-defined image.
- **/
-{
- global define void ImageDemo(byteblock pixels) ``{
- UI::OpenDialog(
- `VBox(
- `Image(pixels, "Image 1"),
- `PushButton("&OK")));
- UI::UserInput();
- UI::CloseDialog();
- };
-
- byteblock image_data = (byteblock) SCR::Read( .target.byte, "image1.png" );
- ImageDemo( image_data );
+// Simple image example
+{
+
+ UI::OpenDialog(
+ `VBox(
+ `Image( "/usr/share/YaST2/theme/current/wallpapers/welcome.jpg" ),
+ `PushButton(`opt(`default), "&OK")
+ )
+ );
+ UI::UserInput();
+ UI::CloseDialog();
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog Wed Jun 27 15:56:28 2007
@@ -266,3 +266,12 @@
- bool shrinkable() const;
- void setShrinkable( bool shrinkable = true );
+
+2007-06-27 14:45 sh(a)suse.de
+
+* YImage:
+
+ * Dropped support for creating an image from a YCPByteblock
+ * Dropped support for fallback label (was never used in NCurses anyway)
+ * Dropped support for `opt(`tiled)
+ * Moved YWidgetOpt stuff to YImage methods
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc Wed Jun 27 15:56:28 2007
@@ -48,6 +48,7 @@
#include "YEmpty.h"
#include "YFrame.h"
#include "YInputField.h"
+#include "YImage.h"
#include "YLabel.h"
#include "YLayoutBox.h"
#include "YMenuButton.h"
@@ -797,7 +798,7 @@
/**
* @widgets HSquash VSquash HVSquash
* @id Squash
- * @short Layout aid: Minimize widget to its nice size
+ * @short Layout aid: Minimize widget to its preferred size
* @class YSquash
* @arg term child the child widget
* @usage HSquash( `InputField( "Name:" ) )
@@ -2211,82 +2212,82 @@
* @widget Image
* @short Pixmap image
* @class YImage
- * @arg symbol|string image specification which image to display
- * @arg string label label or default text of the image
- * @option tiled tile pixmap: repeat it as often as needed to fill all available space
- * @option scaleToFit scale the pixmap so it fits the available space: zoom in or out as needed
- * @option zeroWidth make widget report a nice width of 0
- * @option zeroHeight make widget report a nice height of 0
- * @option animated image data contain an animated image (e.g. MNG)
- * @example Image1.ycp Image-animated.ycp Image-local.ycp Image-scaled.ycp Image-tiled.ycp
+ * @arg string imageFileName file name (with path) of the image to display
+ * @option animated show an animated image (MNG, animated GIF)
+ * @option scaleToFit scale the pixmap so it fits the available space: zoom in or out as needed
+ * @option zeroWidth make widget report a preferred width of 0
+ * @option zeroHeight make widget report a preferred height of 0
+ * @example Image1.ycp Image-animated.ycp
*
* @description
*
- * Displays an image - if the respective UI is capable of that. If not, it is
- * up to the UI to decide whether or not to display the specified default text
- * instead (e.g. with the NCurses UI).
+ * Displays an image if the respective UI is capable of that.
*
* Use <tt>`opt( `zeroWidth )</tt> and / or <tt>`opt( `zeroHeight )</tt>
- * if the real size of the
- * image widget is determined by outside factors, e.g. by the size of
- * neighboring widgets. With those options you can override the default "nice
- * size" of the image widget and make it show just a part of the image.
- * If more screen space is available, more of the image is shown, if not, the
- * layout engine doesn't complain about the image widget not getting its nice size.
- *
- * `opt( `tiled ) will make the image repeat endlessly in both dimensions to fill
- * up any available space. You might want to add `opt( `zeroWidth ) or
- * `opt( `zeroHeight ) ( or both ), too to make use of this feature.
+ * if the real size of the image widget is determined by outside factors, e.g. by the size
+ * of neighboring widgets. With those options you can override the preferred size of
+ * the image widget and make it show just a part of the image. If more screen space is
+ * available, more of the image is shown, if not, the layout engine doesn't complain about
+ * the image widget not getting its preferred size.
*
* `opt( `scaleToFit ) scales the image to fit into the available space, i.e. the
* image will be zoomed in or out as needed.
*
* This option implicitly sets `opt( `zeroWidth ) and `opt( zeroHeight ),
- * too since there is no useful default size for such an image.
+ * too since there is no useful default size for such an image. Use MinSize()
+ * or other layout helpers to explicitly set a size on such a widget.
*
* Please note that setting both `opt( `tiled ) and `opt( `scaleToFit ) at once
* doesn't make any sense.
- *
**/
YWidget *
YCPDialogParser::parseImage( YWidget * parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr )
{
- if ( term->size() - argnr != 2
- || ( ! term->value( argnr )->isSymbol() &&
- ! term->value( argnr )->isString() &&
- ! term->value( argnr )->isByteblock() )
- || ! term->value( argnr+1 )->isString())
+ int argCount = term->size() - argnr;
+
+ bool ok = ( argCount == 1 && term->value( argnr )->isString() ); // 1 string arg
+
+ ok = ( ok || ( argCount == 2 // 2 string args (old style)
+ && term->value( argnr )->isString()
+ && term->value( argnr+1 )->isString() ) );
+
+ if ( ! ok )
{
y2error( "Invalid arguments for the Image widget: %s",
term->toString().c_str() );
return 0;
}
+ string imageFileName = term->value( argnr )->asString()->value();
+ bool zeroWidth = false;
+ bool zeroHeight = false;
+ bool animated = false;
+ bool autoScale = false;
+
for ( int o=0; o < optList->size(); o++ )
{
- if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_zeroWidth ) opt.zeroWidth.setValue( true );
- else if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_zeroHeight ) opt.zeroHeight.setValue( true );
- else if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_animated ) opt.animated.setValue( true );
- else if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_tiled ) opt.tiled.setValue( true );
- else if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_scaleToFit ) opt.scaleToFit.setValue( true );
+ if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_zeroWidth ) zeroWidth = true;
+ else if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_zeroHeight ) zeroHeight = true;
+ else if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_animated ) animated = true;
+ else if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_scaleToFit ) autoScale = true;
else logUnknownOption( term, optList->value(o) );
}
- if ( opt.scaleToFit.value() )
+ if ( autoScale )
{
- opt.zeroWidth.setValue( true );
- opt.zeroHeight.setValue( true );
+ zeroWidth = true;
+ zeroHeight = true;
}
- if ( term->value( argnr )->isByteblock() )
- return YUI::ui()->createImage( parent, opt, term->value( argnr )->asByteblock(), term->value( argnr+1 )->asString() );
+ YImage * image = YUI::widgetFactory()->createImage( parent, imageFileName, animated );
- if ( term->value( argnr )->isString() )
- return YUI::ui()->createImage( parent, opt, term->value( argnr )->asString(), term->value( argnr+1 )->asString() );
+ if ( zeroWidth ) image->setZeroSize( YD_HORIZ, true );
+ if ( zeroHeight ) image->setZeroSize( YD_VERT , true );
+ if ( autoScale ) image->setAutoScale( true );
- return 0;
+ return image;
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YImage.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YImage.cc Wed Jun 27 15:56:28 2007
@@ -18,9 +18,91 @@
#include "YImage.h"
+#include "YBothDim.h"
-YImage::YImage( const YWidgetOpt & opt )
- : YWidget( opt )
+
+struct YImagePrivate
+{
+ /**
+ * Constructor.
+ **/
+ YImagePrivate( const string & imageFileName, bool animated )
+ : imageFileName( imageFileName )
+ , animated( animated )
+ , autoScale( false )
+ {
+ zeroSize.hor = false;
+ zeroSize.vert = false;
+ }
+
+
+ string imageFileName;
+ bool animated;
+ YBothDim<bool> zeroSize;
+ bool autoScale;
+};
+
+
+
+
+YImage::YImage( YWidget * parent,
+ const string & imageFileName,
+ bool animated )
+ : YWidget( parent )
+ , priv( new YImagePrivate( imageFileName, animated ) )
+{
+ YUI_CHECK_NEW( priv );
+}
+
+
+YImage::~YImage()
{
+ // NOP
}
+
+string YImage::imageFileName() const
+{
+ return priv->imageFileName;
+}
+
+
+bool YImage::animated() const
+{
+ return priv->animated;
+}
+
+
+void YImage::setImage( const string & imageFileName, bool animated )
+{
+ priv->imageFileName = imageFileName;
+ priv->animated = animated;
+}
+
+
+bool YImage::hasZeroSize( YUIDimension dim ) const
+{
+ return priv->zeroSize[ dim ];
+}
+
+
+void YImage::setZeroSize( YUIDimension dim, bool zeroSize )
+{
+ priv->zeroSize[ dim ] = zeroSize;
+ setStretchable( dim, zeroSize );
+}
+
+
+bool YImage::autoScale() const
+{
+ return priv->autoScale;
+}
+
+
+void YImage::setAutoScale( bool autoScale )
+{
+ priv->autoScale = autoScale;
+}
+
+
+
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YImage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YImage.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YImage.h Wed Jun 27 15:56:28 2007
@@ -20,7 +20,12 @@
#define YImage_h
#include "YWidget.h"
-#include <ycp/YCPString.h>
+#include <string>
+
+using std::string;
+
+class YImagePrivate;
+
/**
* @short Implementation of the Image widget
@@ -29,15 +34,88 @@
{
public:
/**
- * Constructor
+ * Constructor.
+ *
+ * 'animated' indicates if 'imageFileName' is an animated image format
+ * (e.g., MNG).
**/
- YImage( const YWidgetOpt & opt );
+ YImage( YWidget * parent,
+ const string & imageFileName,
+ bool animated = false );
+
+ /**
+ * Destructor.
+ **/
+ virtual ~YImage();
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
**/
virtual const char * widgetClass() { return "YImage"; }
+
+ /**
+ * Return the file name of this widget's image.
+ **/
+ string imageFileName() const;
+
+ /**
+ * Returns 'true' if the current image is an animated image format (e.g.,
+ * MNG).
+ **/
+ bool animated() const;
+
+ /**
+ * Set and display a new image (or movie if animated is 'true').
+ *
+ * Derived classes should overwrite this, but call this base class function
+ * in the new function.
+ **/
+ virtual void setImage( const string & imageFileName, bool animated = false );
+
+ /**
+ * Set and display a movie (an animated image).
+ **/
+ void setMovie( const string & movieFileName )
+ { setImage( movieFileName, true ); }
+
+ /**
+ * Return 'true' if the image widget should be stretchable with a default
+ * width of 0 in the specified dimension. This is useful if the widget
+ * width is determined by outside constraints, like the width of a
+ * neighbouring widget.
+ **/
+ bool hasZeroSize( YUIDimension dim ) const;
+
+ /**
+ * Make the image widget stretchable with a default size of 0 in the
+ * specified dimension. This is useful if the widget width is determined by
+ * outside constraints, like the width of a neighbouring widget.
+ *
+ * This function is intentionally not virtual because it is only relevant
+ * during the next geometry update, in which case the derived class has to
+ * check this value anyway.
+ **/
+ void setZeroSize( YUIDimension dim, bool zeroSize = true );
+
+ /**
+ * Return 'true' if the image should be scaled to fit into the available
+ * space.
+ **/
+ bool autoScale() const;
+
+ /**
+ * Make the image fit into the available space.
+ *
+ * Derived classes should overwrite this, but call this base class function
+ * in the new function.
+ **/
+ virtual void setAutoScale( bool autoScale = true );
+
+
+private:
+
+ ImplPtr<YImagePrivate> priv;
};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Wed Jun 27 15:56:28 2007
@@ -455,8 +455,6 @@
virtual YWidget *createTree( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
virtual YWidget *createTable( YWidget *parent, YWidgetOpt & opt, vector<string> header ) = 0;
virtual YWidget *createProgressBar( YWidget *parent, YWidgetOpt & opt, const YCPString & label, const YCPInteger & maxprogress, const YCPInteger & progress ) = 0;
- virtual YWidget *createImage( YWidget *parent, YWidgetOpt & opt, YCPByteblock imagedata, YCPString defaulttext ) = 0;
- virtual YWidget *createImage( YWidget *parent, YWidgetOpt & opt, YCPString file_name, YCPString defaulttext ) = 0;
virtual YWidget *createIntField( YWidget *parent, YWidgetOpt & opt, const YCPString & label, int minValue, int maxValue, int initialValue ) = 0;
virtual YWidget *createPackageSelector( YWidget *parent, YWidgetOpt & opt, const YCPString & floppyDevice ) = 0;
// FIXME: Obsolete
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h Wed Jun 27 15:56:28 2007
@@ -111,7 +111,7 @@
virtual YMenuButton * createMenuButton ( YWidget * parent, const string & label ) = 0;
virtual YMultiLineEdit * createMultiLineEdit ( YWidget * parent, const string & label ) = 0;
- virtual YImage * createImage ( YWidget * parent, const string & imagePath ) = 0;
+ virtual YImage * createImage ( YWidget * parent, const string & imageFileName, bool animated = false ) = 0;
virtual YLogView * createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 ) = 0;
virtual YSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label ) = 0;
Modified: branches/tmp/sh/mod-ui/qt/src/YQDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQDialog…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQDialog.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQDialog.cc Wed Jun 27 15:56:28 2007
@@ -182,20 +182,10 @@
void YQDialog::setSize( int newWidth, int newHeight )
{
if ( newWidth > qApp->desktop()->width() )
- {
- y2warning( "Limiting dialog width to screen width (%d) instead of %d - check the layout!",
- qApp->desktop()->width(), newWidth );
-
newWidth = qApp->desktop()->width();
- }
if ( newHeight > qApp->desktop()->height() )
- {
- y2warning( "Limiting dialog height to screen height (%d) instead of %d - check the layout!",
- qApp->desktop()->height(), newHeight );
-
newHeight = qApp->desktop()->height();
- }
if ( hasChildren() )
{
Modified: branches/tmp/sh/mod-ui/qt/src/YQImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQImage.…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQImage.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQImage.cc Wed Jun 27 15:56:28 2007
@@ -28,114 +28,98 @@
-YQImage::YQImage( QWidget * parent,
- const YWidgetOpt & opt,
- const YCPByteblock & byteblock )
- : QLabel( parent )
- , YImage( opt )
-{
- init( parent, opt );
-
- if ( _animated )
- {
- QMovie movie( byteblock->size() );
- movie.pushData( byteblock->value(), byteblock->size() );
- setMovie( movie );
- }
- else
- {
- QPixmap pixmap;
- pixmap.loadFromData( byteblock->value(), byteblock->size() );
- yqSetPixmap( pixmap );
- }
+YQImage::YQImage( YWidget * parent,
+ const string & imageFileName,
+ bool animated )
+ : QLabel( (QWidget *) parent->widgetRep() )
+ , YImage( parent, imageFileName, animated )
+{
+ setWidgetRep( this );
+ setAlignment( Qt::AlignLeft | Qt::AlignTop );
+
+ setScaledContents( false );
+ _pixmapHeight = 0;
+ _pixmapWidth = 0;
+
+ setImage( imageFileName, animated );
}
-YQImage::YQImage( QWidget * parent,
- const YWidgetOpt & opt,
- const YCPString & ycp_file_name )
- : QLabel( parent )
- , YImage( opt )
+YQImage::~YQImage()
{
- init( parent, opt );
- QString file_name = fromUTF8( ycp_file_name->value() );
- y2debug( "Loading image from %s", (const char *) file_name );
+ // NOP
+}
+
- if ( _animated )
+void
+YQImage::setImage( const string & fileName, bool animated )
+{
+ YImage::setImage( fileName, animated );
+
+ if ( animated )
{
- QMovie movie( file_name );
+ QMovie movie( fromUTF8( imageFileName() ) );
- if ( movie .isNull() )
+ if ( movie.isNull() )
{
- y2error( "Couldn't load animation from %s", (const char *) file_name );
+ y2error( "Couldn't load animation from %s", imageFileName().c_str() );
}
else
{
- setMovie( movie );
+ y2debug( "Loading animation from %s (%d x %d)", imageFileName().c_str() );
+ QLabel::setMovie( movie );
}
}
else
{
- QPixmap pixmap( file_name );
+ QPixmap pixmap( fromUTF8( imageFileName() ) );
if ( pixmap.isNull() )
{
- y2error( "Couldn't load pixmap from %s", (const char *) file_name );
+ y2error( "Couldn't load pixmap from %s", imageFileName().c_str() );
}
else
{
- yqSetPixmap( pixmap );
+ if ( autoScale() )
+ {
+ _pixmapWidth = 0;
+ _pixmapHeight = 0;
+ }
+ else
+ {
+ _pixmapWidth = pixmap.size().width();
+ _pixmapHeight = pixmap.size().height();
+ }
+
+ y2debug( "Loading image from %s (%d x %d)",
+ imageFileName().c_str(),
+ pixmap.size().width(),
+ pixmap.size().height() );
+
+ QLabel::setPixmap( pixmap );
}
}
}
-
-void
-YQImage::init( QWidget * parent, const YWidgetOpt & opt )
+void YQImage::setAutoScale( bool newAutoScale )
{
- setWidgetRep( this );
- setAlignment( Qt::AlignLeft | Qt::AlignTop );
+ if ( autoScale() == newAutoScale )
+ return;
- _zeroWidth = opt.zeroWidth.value();
- _zeroHeight = opt.zeroHeight.value();
- _animated = opt.animated.value();
- _tiled = opt.tiled.value();
- setScaledContents( opt.scaleToFit.value() );
- _pixmapHeight = 0;
- _pixmapWidth = 0;
+ YImage::setAutoScale( newAutoScale );
+ setScaledContents( newAutoScale );
- if ( _zeroWidth )
- setStretchable( YD_HORIZ, true );
-
- if ( _zeroHeight )
- setStretchable( YD_VERT, true );
-}
-
-
-void
-YQImage::yqSetPixmap( const QPixmap & pixmap )
-{
- if ( hasScaledContents() )
- {
- _pixmapWidth = 0;
- _pixmapHeight = 0;
- }
- else
- {
- _pixmapWidth = pixmap.size().width();
- _pixmapHeight = pixmap.size().height();
- }
-
- QLabel::setPixmap( pixmap );
+ // Trigger image re-display
+ setImage( imageFileName(), animated() );
}
int YQImage::preferredWidth()
{
- if ( _zeroWidth )
+ if ( hasZeroSize( YD_HORIZ ) )
return 0;
-
- if ( _animated )
+
+ if ( animated() )
{
// a QMovie doesn't have a size() method, thus use sizeHint() instead.
@@ -154,10 +138,10 @@
int YQImage::preferredHeight()
{
- if ( _zeroHeight )
+ if ( hasZeroSize( YD_VERT ) )
return 0;
-
- if ( _animated )
+
+ if ( animated() )
{
// a QMovie doesn't have a size() method, thus use sizeHint() instead.
Modified: branches/tmp/sh/mod-ui/qt/src/YQImage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQImage.…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQImage.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQImage.h Wed Jun 27 15:56:28 2007
@@ -21,7 +21,7 @@
#define YQImage_h
#include <qlabel.h>
-#include <ycp/YCPString.h>
+#include <qmovie.h>
#include "YImage.h"
#include "YUI.h"
@@ -33,10 +33,33 @@
public:
/**
- * Constructors
+ * Constructor.
+ *
+ * 'animated' indicates if 'imageFileName' is an animated image format
+ * (e.g., MNG).
+ **/
+ YQImage( YWidget * parent,
+ const string & imageFileName,
+ bool animated = false );
+
+ /**
+ * Destructor.
**/
- YQImage( QWidget * parent, const YWidgetOpt & opt, const YCPByteblock & byteblock );
- YQImage( QWidget * parent, const YWidgetOpt & opt, const YCPString & file_name );
+ virtual ~YQImage();
+
+ /**
+ * Set and display a new image.
+ *
+ * Reimplemented from YImage.
+ **/
+ virtual void setImage( const string & imageFileName, bool animated = false );
+
+ /**
+ * Make the image fit into the available space.
+ *
+ * Reimplemented from YImage.
+ **/
+ virtual void setAutoScale( bool autoScale = true );
/**
* Preferred width of the widget.
@@ -61,29 +84,8 @@
protected:
- /**
- * Common init method for all constructors
- **/
- void init( QWidget * parent, const YWidgetOpt & opt );
-
- /**
- * Set the pixmap contents. That weird name is to prevent overwriting a
- * QLabel virtual method of the same name.
- **/
- void yqSetPixmap( const QPixmap &pixmap );
-
-
- //
- // Data members
- //
-
- bool _zeroWidth; // override preferred width with 0
- bool _zeroHeight; // override preferred height with 0
- bool _tiled; // tile image ( repeat endlessly )
- bool _animated; // animation, no static image
-
- int _pixmapWidth; // pixmap or movie width
- int _pixmapHeight; // pixmap or movie height
+ int _pixmapWidth;
+ int _pixmapHeight;
};
#endif // YQImage_h
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI.h?r…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Wed Jun 27 15:56:28 2007
@@ -445,8 +445,6 @@
/*** Widget creation methods, all reimplemented from YUI ***/
YWidget * createComboBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
- YWidget * createImage ( YWidget * parent, YWidgetOpt & opt, YCPByteblock imageData, YCPString fallbackText );
- YWidget * createImage ( YWidget * parent, YWidgetOpt & opt, YCPString fileName, YCPString fallbackText );
YWidget * createIntField ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, int minValue, int maxValue, int initialValue);
YWidget * createLogView ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, int visibleLines, int maxLines );
YWidget * createMultiLineEdit ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, const YCPString & text);
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI_wid…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Wed Jun 27 15:56:28 2007
@@ -28,7 +28,6 @@
#include "YQDialog.h"
#include "YQDownloadProgress.h"
#include "YQDumbTab.h"
-#include "YQImage.h"
#include "YQIntField.h"
#include "YQLogView.h"
#include "YQMenuButton.h"
@@ -187,23 +186,6 @@
}
-YWidget * YQUI::createImage ( YWidget * parent,
- YWidgetOpt & opt,
- YCPByteblock imagedata,
- YCPString default_text )
-{
- return new YQImage( (QWidget *) ( parent->widgetRep() ), opt, imagedata );
-}
-
-YWidget * YQUI::createImage ( YWidget * parent,
- YWidgetOpt & opt,
- YCPString file_name,
- YCPString default_text )
-{
- return new YQImage( (QWidget *) ( parent->widgetRep() ), opt, file_name );
-}
-
-
YWidget * YQUI::createIntField ( YWidget * parent,
YWidgetOpt & opt,
const YCPString & label,
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidget…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc Wed Jun 27 15:56:28 2007
@@ -85,7 +85,7 @@
{
YQPushButton * pushButton = new YQPushButton( parent, label );
YUI_CHECK_NEW( pushButton );
-
+
return pushButton;
}
@@ -99,7 +99,7 @@
{
YQLabel * label = new YQLabel( parent, text, isHeading, isOutputField );
YUI_CHECK_NEW( label );
-
+
return label;
}
@@ -136,7 +136,7 @@
// Register radio button with its button group.
// This has to be done after all constructors are done so virtual functions
// can be used.
-
+
if ( radioButton->buttonGroup() )
radioButton->buttonGroup()->addRadioButton( radioButton );
@@ -226,9 +226,12 @@
YQImage *
-YQWidgetFactory::createImage( YWidget * parent, const string & imagePath )
+YQWidgetFactory::createImage( YWidget * parent, const string & imageFileName, bool animated )
{
- return 0; // FIXME: TO DO
+ YQImage * image = new YQImage( parent, imageFileName, animated );
+ YUI_CHECK_NEW( image );
+
+ return image;
}
@@ -275,7 +278,7 @@
{
YQSpacing * spacing = new YQSpacing( parent, dim, stretchable, size );
YUI_CHECK_NEW( spacing );
-
+
return spacing;
}
@@ -298,7 +301,7 @@
{
YQAlignment * alignment = new YQAlignment( parent, horAlignment, vertAlignment );
YUI_CHECK_NEW( alignment );
-
+
return alignment;
}
@@ -319,7 +322,7 @@
{
YQFrame * frame = new YQFrame( parent, label );
YUI_CHECK_NEW( frame );
-
+
return frame;
}
@@ -330,7 +333,7 @@
{
YQCheckBoxFrame * checkBoxFrame = new YQCheckBoxFrame( parent, label, checked );
YUI_CHECK_NEW( checkBoxFrame );
-
+
return checkBoxFrame;
}
@@ -341,7 +344,7 @@
{
YQRadioButtonGroup * radioButtonGroup = new YQRadioButtonGroup( parent );
YUI_CHECK_NEW( radioButtonGroup );
-
+
return radioButtonGroup;
}
@@ -352,7 +355,7 @@
{
YQReplacePoint * replacePoint = new YQReplacePoint( parent );
YUI_CHECK_NEW( replacePoint );
-
+
return replacePoint;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidget…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h Wed Jun 27 15:56:28 2007
@@ -101,7 +101,7 @@
virtual YQIntField * createIntField ( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal );
virtual YQMenuButton * createMenuButton ( YWidget * parent, const string & label );
virtual YQMultiLineEdit * createMultiLineEdit ( YWidget * parent, const string & label );
- virtual YQImage * createImage ( YWidget * parent, const string & imagePath );
+ virtual YQImage * createImage ( YWidget * parent, const string & imageFileName, bool animated = false );
virtual YQLogView * createLogView ( YWidget * parent, const string & label, int visibleLines, int storedLines = 0 );
virtual YQSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label );
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39055 - in /trunk/live-installer: configure.in.in testsuite/tests/LiveInstaller.out testsuite/tests/LiveInstaller.ycp yast2-live-installer.spec.in
by jsrain@svn.opensuse.org 27 Jun '07
by jsrain@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: jsrain
Date: Wed Jun 27 15:46:41 2007
New Revision: 39055
URL: http://svn.opensuse.org/viewcvs/yast?rev=39055&view=rev
Log:
build fixes
Modified:
trunk/live-installer/configure.in.in
trunk/live-installer/testsuite/tests/LiveInstaller.out
trunk/live-installer/testsuite/tests/LiveInstaller.ycp
trunk/live-installer/yast2-live-installer.spec.in
Modified: trunk/live-installer/configure.in.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/configure.in.in?r…
==============================================================================
--- trunk/live-installer/configure.in.in (original)
+++ trunk/live-installer/configure.in.in Wed Jun 27 15:46:41 2007
@@ -8,5 +8,8 @@
@YAST2-CHECKS-COMMON@
@YAST2-CHECKS-YCP@
+## Nasty hack: xgettext doesn't work for XML files, so let's symlink it
+( cd src/control; ln -sf firstboot.xml firstboot.glade )
+
## and generate the output...
@YAST2-OUTPUT@
Modified: trunk/live-installer/testsuite/tests/LiveInstaller.out
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/testsuite/tests/L…
==============================================================================
--- trunk/live-installer/testsuite/tests/LiveInstaller.out (original)
+++ trunk/live-installer/testsuite/tests/LiveInstaller.out Wed Jun 27 15:46:41 2007
@@ -1,2 +0,0 @@
-Dump LiveInstaller::Modified
-Return false
Modified: trunk/live-installer/testsuite/tests/LiveInstaller.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/testsuite/tests/L…
==============================================================================
--- trunk/live-installer/testsuite/tests/LiveInstaller.ycp (original)
+++ trunk/live-installer/testsuite/tests/LiveInstaller.ycp Wed Jun 27 15:46:41 2007
@@ -7,7 +7,4 @@
import "LiveInstaller";
-DUMP("LiveInstaller::Modified");
-TEST(``(LiveInstaller::Modified()), [], nil);
-
}
Modified: trunk/live-installer/yast2-live-installer.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/yast2-live-instal…
==============================================================================
--- trunk/live-installer/yast2-live-installer.spec.in (original)
+++ trunk/live-installer/yast2-live-installer.spec.in Wed Jun 27 15:46:41 2007
@@ -21,11 +21,8 @@
%files
%defattr(-,root,root)
-%dir @yncludedir@/live-installer
-@yncludedir@/live-installer/*
-@clientdir@/live-installer.ycp
-@clientdir@/live-installer_*.ycp
+@clientdir@/*.ycp
@moduledir@/LiveInstaller.*
-@moduledir@/LiveInstaller2.*
@desktopdir@/live-installer.desktop
+/etc/YaST2/live-install.xml
%doc @docdir@
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39054 - in /branches/tmp/sh/mod-ui/ncurses/src: ./ pkg/
by gs@svn.opensuse.org 27 Jun '07
by gs@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: gs
Date: Wed Jun 27 15:04:22 2007
New Revision: 39054
URL: http://svn.opensuse.org/viewcvs/yast?rev=39054&view=rev
Log:
adapt NCPushButton, NCRadioButton, NCLabel, NCSpacing,
NCTextEntry, NCAlignment, NCCheckBox to new API
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.cc
branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc
branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h
branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc
branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.cc
branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.h
branches/tmp/sh/mod-ui/ncurses/src/NCFrame.cc
branches/tmp/sh/mod-ui/ncurses/src/NCFrame.h
branches/tmp/sh/mod-ui/ncurses/src/NCImage.cc
branches/tmp/sh/mod-ui/ncurses/src/NCImage.h
branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc
branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h
branches/tmp/sh/mod-ui/ncurses/src/NCLabel.cc
branches/tmp/sh/mod-ui/ncurses/src/NCLabel.h
branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc
branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.h
branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.cc
branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.h
branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.cc
branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.h
branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.cc
branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.h
branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc
branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.cc
branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.h
branches/tmp/sh/mod-ui/ncurses/src/NCSquash.cc
branches/tmp/sh/mod-ui/ncurses/src/NCSquash.h
branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCA…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.cc Wed Jun 27 15:04:22 2007
@@ -31,7 +31,7 @@
NCAlignment::NCAlignment( NCWidget * parent,
YAlignmentType halign,
YAlignmentType valign )
- : YAlignment( halign, valign )
+ : YAlignment( (YWidget *)parent, halign, valign )
, NCWidget( parent )
{
WIDDBG << endl;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCA…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAskForDirectory.cc Wed Jun 27 15:04:22 2007
@@ -29,6 +29,8 @@
#include "NCFrame.h"
#include "NCi18n.h"
+#include "YWidgetID.h"
+
#include <sys/types.h>
#include <unistd.h>
#include <dirent.h>
@@ -102,17 +104,15 @@
opt.notifyMode.setValue( false );
- //the headline
- opt.isHeading.setValue( true );
-
- NCLabel * head = new NCLabel( split, opt, headline );
+ // the headline
+ NCLabel * head = new NCLabel( split, headline->toString(), true, false ); // isHeading = true
split->addChild( head );
- split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, false, 0.4 ) );
opt.isHStretchable.setValue( true );
- NCFrame * frame = new NCFrame( split, opt, YCPString("" ) );
+ NCFrame * frame = new NCFrame( split, "" );
NCSplit * vSplit = new NCSplit( frame, opt, YD_VERT );
opt.isEditable.setValue( false );
@@ -123,7 +123,7 @@
dirName->setId( YCPString(idDirName->name()) );
- vSplit->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) );
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, false, 0.6 ) );
split->addChild( frame );
@@ -132,15 +132,18 @@
split->addChild( hSplit );
// label for checkbox
detailed = new NCCheckBox( hSplit, opt, YCPString(_( "&Detailed View" )), false );
- detailed->setId( YCPString(idDetails->name()) );
+ YStringWidgetID * detailsID = YStringWidgetID( idDetails->name() );
+ detailed->setId( detailsID );
- hSplit->addChild( new NCSpacing( hSplit, opt, 0.1, true, false ) );
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.1, true, false ) );
+ hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.1 ) ); // stretchable = true
hSplit->addChild( detailed );
// add the list of directories
dirList = new NCDirectoryTable( split, opt, NCFileTable::T_Overview, iniDir );
- dirList->setId( YCPString(idDirList->name()) );
+ YStringWidgetID * dirListID = new YStringWidgetID( idDirList->name() );
+ dirList->setId( dirListID );
split->addChild( dirList );
split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
@@ -149,26 +152,31 @@
NCSplit * hSplit1 = new NCSplit( split, opt, YD_HORIZ );
split->addChild( hSplit1 );
opt.isHStretchable.setValue( true );
- hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.2, true, false ) );
+ //hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.2, true, false ) );
+ hSplit1->addChild( new NCSpacing( hSplit1, YD_HORIZ, true, 0.2 ) ); // stretchable = true
// add the OK button
opt.key_Fxx.setValue( 10 );
// the label of an OK button
- okButton = new NCPushButton( hSplit1, opt, YCPString(_( "&OK" )) );
- okButton->setId( YCPString(idOk->name()) );
+ okButton = new NCPushButton( hSplit1, _( "&OK" ) );
+ YStringWidgetID * okID = new YStringWidgetID (idOk->name() );
+ okButton->setId( okID );
hSplit1->addChild( okButton );
- hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.4, true, false ) );
+ //hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.4, true, false ) );
+ hSplit1->addChild( new NCSpacing( hSplit1, YD_HORIZ, true, 0.4 ) );
// add the Cancel button
opt.key_Fxx.setValue( 9 );
// the label of the Cancel button
- cancelButton = new NCPushButton( hSplit1, opt, YCPString(_( "&Cancel" )) );
- cancelButton->setId( YCPString(idCancel->name()) );
+ cancelButton = new NCPushButton( hSplit1, _( "&Cancel" ) );
+ YStringWidgetID * cancelID = new YStringWidgetID (idCancel->name() );
+ cancelButton->setId( cancelID );
hSplit1->addChild( cancelButton );
- hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.2, true, false ) );
+ //hSplit1->addChild( new NCSpacing( hSplit1, opt, 0.2, true, false ) );
+ hSplit1->addChild( new NCSpacing( hSplit1, YD_HORIZ, true, 0.2 ) );
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc Wed Jun 27 15:04:22 2007
@@ -28,9 +28,9 @@
//
// DESCRIPTION :
//
-NCCheckBoxFrame::NCCheckBoxFrame( NCWidget * parent, const YWidgetOpt & opt,
- const YCPString & nlabel, bool checked )
- : YCheckBoxFrame( opt, nlabel )
+NCCheckBoxFrame::NCCheckBoxFrame( NCWidget * parent, const string & nlabel,
+ bool checked )
+ : YCheckBoxFrame( (YWidget *)parent, nlabel, checked )
, NCWidget( parent )
{
WIDDBG << endl;
@@ -38,7 +38,8 @@
framedim.Pos = wpos( 1 );
framedim.Sze = wsze( 2 );
- setLabel( getLabel() );
+ //setLabel( getLabel() );
+ setLabel( YCheckBoxFrame::label() );
hotlabel = &label;
if ( invertAutoEnable() )
@@ -75,8 +76,10 @@
//space to add - keep vertical dim, add horizontal space
//for checkbox
wpair plussize = wpair(0,4);
- defsze = wsze( YContainerWidget::child(0)->nicesize( YD_VERT ),
- YContainerWidget::child(0)->nicesize( YD_HORIZ ) );
+ //defsze = wsze( YContainerWidget::child(0)->nicesize( YD_VERT ),
+ // YContainerWidget::child(0)->nicesize( YD_HORIZ ) );
+ defsze = wsze( firstChild()->preferredWidth(),
+ firstChild()->preferredHeight() );
if ( label.width() > (unsigned)defsze.W )
defsze.W = label.width();
defsze += framedim.Sze + plussize;
@@ -97,7 +100,8 @@
wsze csze( newheight, newwidth );
wRelocate( wpos( 0 ), csze );
csze = wsze::max( 0, csze - framedim.Sze );
- YContainerWidget::child(0)->setSize( csze.W, csze.H );
+ //YContainerWidget::child(0)->setSize( csze.W, csze.H );
+ firstChild()->setSize( csze.W, csze.H );
}
///////////////////////////////////////////////////////////////////
@@ -108,11 +112,11 @@
//
// DESCRIPTION :
//
-void NCCheckBoxFrame::setLabel( const YCPString & nlabel )
+void NCCheckBoxFrame::setLabel( const string & nlabel )
{
YCheckBoxFrame::setLabel( nlabel );
- label = NCstring( getLabel() );
+ label = NCstring( YCheckBoxFrame::label() );
label.stripHotkey();
Redraw();
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h Wed Jun 27 15:04:22 2007
@@ -55,8 +55,8 @@
public:
- NCCheckBoxFrame( NCWidget * parent, const YWidgetOpt & opt,
- const YCPString & label, bool checked );
+ NCCheckBoxFrame( NCWidget * parent, const string & label,
+ bool checked );
virtual ~NCCheckBoxFrame();
virtual long nicesize( YUIDimension dim );
@@ -68,7 +68,7 @@
**/
virtual void setSize( int newWidth, int newHeight );
- virtual void setLabel( const YCPString & nlabel );
+ virtual void setLabel( const string & nlabel );
virtual void setEnabling( bool do_bv );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCD…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc Wed Jun 27 15:04:22 2007
@@ -197,12 +197,14 @@
//
long NCDialog::nicesize( YUIDimension dim )
{
- if ( hasDefaultSize() || !numChildren() ) {
+ if ( hasDefaultSize() || !childrenCount() ) {
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
- wsze csze( child( 0 )->nicesize( YD_VERT ),
- child( 0 )->nicesize( YD_HORIZ ) );
+ //wsze csze( child( 0 )->nicesize( YD_VERT ),
+ // child( 0 )->nicesize( YD_HORIZ ) );
+ wsze csze( firstChild()->preferredHeight(),
+ firstChild()->preferredWidth() );
csze = wsze::min( wGetDefsze(),
wsze::max( csze, wsze( 1 ) ) );
@@ -1382,11 +1384,14 @@
{
// Retrieve the widget's "shortcut property" that describes
// whatever it is - regardless of widget type (PushButton, ...)
- YCPSymbol propertyName( w->shortcutProperty() );
- YCPValue propertyValue = w->queryWidget( propertyName );
-
+ //YCPSymbol propertyName( w->shortcutProperty() );
+ //YCPValue propertyValue = w->queryWidget( propertyName );
// Get rid of unwanted '&' shortcut markers
- string desc = YShortcut::cleanShortcutString( propertyValue->asString()->value() );
+ //string desc = YShortcut::cleanShortcutString( propertyValue->asString()->value() );
+
+ // FIXME ??? correct string ???
+ string desc = w->debugLabel();
+
int no = fkey - KEY_F(1) + 1;
if ( no == 1 )
{
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCE…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.cc Wed Jun 27 15:04:22 2007
@@ -28,8 +28,8 @@
//
// DESCRIPTION :
//
-NCEmpty::NCEmpty( NCWidget * parent, const YWidgetOpt & opt )
- : YEmpty( opt )
+NCEmpty::NCEmpty( NCWidget * parent )
+ : YEmpty( (YWidget *)parent )
, NCWidget( parent )
{
WIDDBG << endl;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCE…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.h Wed Jun 27 15:04:22 2007
@@ -47,7 +47,7 @@
public:
- NCEmpty( NCWidget * parent, const YWidgetOpt & opt );
+ NCEmpty( NCWidget * parent );
virtual ~NCEmpty();
// virtual long nicesize( YUIDimension dim ){ return YEmpty::nicesize( dim ); }
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCF…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCFrame.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCFrame.cc Wed Jun 27 15:04:22 2007
@@ -28,16 +28,16 @@
//
// DESCRIPTION :
//
-NCFrame::NCFrame( NCWidget * parent, const YWidgetOpt & opt,
- const YCPString & nlabel )
- : YFrame( opt, nlabel )
+NCFrame::NCFrame( NCWidget * parent, const string & nlabel )
+ : YFrame( (YWidget *)parent, nlabel )
, NCWidget( parent )
{
WIDDBG << endl;
wstate = NC::WSdumb;
framedim.Pos = wpos( 1 );
framedim.Sze = wsze( 2 );
- setLabel( getLabel() );
+ //setLabel( getLabel() );
+ setLabel( YFrame::label() );
hotlabel = &label;
}
@@ -64,8 +64,11 @@
//
long NCFrame::nicesize( YUIDimension dim )
{
- defsze = wsze( YContainerWidget::child(0)->nicesize( YD_VERT ),
- YContainerWidget::child(0)->nicesize( YD_HORIZ ) );
+ //defsze = wsze( YContainerWidget::child(0)->nicesize( YD_VERT ),
+ // YContainerWidget::child(0)->nicesize( YD_HORIZ ) );
+ defsze = wsze( firstChild()->preferredWidth(),
+ firstChild()->preferredHeight() );
+
if ( label.width() > (unsigned)defsze.W )
defsze.W = label.width();
defsze += framedim.Sze;
@@ -86,7 +89,8 @@
wsze csze( newheight, newwidth );
wRelocate( wpos( 0 ), csze );
csze = wsze::max( 0, csze - framedim.Sze );
- YContainerWidget::child(0)->setSize( csze.W, csze.H );
+ //YContainerWidget::child(0)->setSize( csze.W, csze.H );
+ firstChild()->setSize( csze.W, csze.H );
}
///////////////////////////////////////////////////////////////////
@@ -97,10 +101,11 @@
//
// DESCRIPTION :
//
-void NCFrame::setLabel( const YCPString & nlabel )
+void NCFrame::setLabel( const string & nlabel )
{
YFrame::setLabel( nlabel );
- label = NCstring( getLabel() );
+ //label = NCstring( getLabel() );
+ label = NCstring( YFrame::label() );
label.stripHotkey();
Redraw();
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCF…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCFrame.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCFrame.h Wed Jun 27 15:04:22 2007
@@ -53,8 +53,7 @@
public:
- NCFrame( NCWidget * parent, const YWidgetOpt & opt,
- const YCPString & label );
+ NCFrame( NCWidget * parent, const string & label );
virtual ~NCFrame();
virtual long nicesize( YUIDimension dim );
@@ -66,7 +65,7 @@
**/
virtual void setSize( int newWidth, int newHeight );
- virtual void setLabel( const YCPString & nlabel );
+ virtual void setLabel( const string & nlabel );
//virtual void setEnabling( bool do_bv );
//Use setEnabling() from the parent, it should work out (#256707) :-)
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCI…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCImage.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCImage.cc Wed Jun 27 15:04:22 2007
@@ -66,6 +66,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCImage::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCImage::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCImage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCI…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCImage.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCImage.h Wed Jun 27 15:04:22 2007
@@ -54,6 +54,9 @@
virtual long nicesize( YUIDimension dim );
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
/**
* Set the new size of the widget.
*
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCI…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc Wed Jun 27 15:04:22 2007
@@ -89,6 +89,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCIntField::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCIntField::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCI…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h Wed Jun 27 15:04:22 2007
@@ -78,6 +78,9 @@
virtual long nicesize( YUIDimension dim );
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
/**
* Set the new size of the widget.
*
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCLabel.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCL…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCLabel.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCLabel.cc Wed Jun 27 15:04:22 2007
@@ -28,11 +28,11 @@
//
// DESCRIPTION :
//
-NCLabel::NCLabel( NCWidget * parent, const YWidgetOpt & opt,
- const YCPString & nlabel )
- : YLabel( opt, nlabel )
+NCLabel::NCLabel( NCWidget * parent, const string & nlabel,
+ bool isHeading, bool isOutputField )
+ : YLabel( (YWidget *)parent, nlabel, isHeading, isOutputField )
, NCWidget( parent )
- , heading( opt.isHeading.value() )
+ , heading( isHeading )
{
WIDDBG << endl;
setLabel( nlabel );
@@ -98,7 +98,7 @@
//
// DESCRIPTION :
//
-void NCLabel::setLabel( const YCPString & nlabel )
+void NCLabel::setLabel( const string & nlabel )
{
label = NCstring( nlabel );
NCDBG << "LABEL: " << NCstring(nlabel) << " Longest line: " << label.width()<< endl;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCLabel.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCL…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCLabel.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCLabel.h Wed Jun 27 15:04:22 2007
@@ -52,8 +52,8 @@
public:
- NCLabel( NCWidget * parent, const YWidgetOpt & opt,
- const YCPString & text );
+ NCLabel( NCWidget * parent, const string & text,
+ bool isHeading, bool isOutputField );
virtual ~NCLabel();
virtual long nicesize( YUIDimension dim );
@@ -65,7 +65,7 @@
**/
virtual void setSize( int newWidth, int newHeight );
- virtual void setLabel( const YCPString & nlabel );
+ virtual void setLabel( const string & nlabel );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
virtual int preferredWidth();
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCM…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc Wed Jun 27 15:04:22 2007
@@ -21,6 +21,8 @@
#include "NCMenuButton.h"
#include "NCPopupMenu.h"
+#include "YWidgetID.h"
+
///////////////////////////////////////////////////////////////////
//
//
@@ -193,7 +195,10 @@
return NCursesEvent::none;
NCursesEvent ret = NCursesEvent::menu;
- ret.selection = indexToId( selection );
+ // FIXME
+ YCPValue value = indexToId( selection );
+ YStringWidgetID * selectionID = new YStringWidgetID( value->toString());
+ ret.selection = selectionID;
return ret;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCM…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc Wed Jun 27 15:04:22 2007
@@ -66,7 +66,7 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
-int NCMultiLineEditC::preferredWidth()
+int NCMultiLineEdit::preferredWidth()
{
defsze.W = ( 5 > labelWidht() ? 5 : labelWidht() ) + 2
return wGetDefsze().W;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorPlugin.cc Wed Jun 27 15:04:22 2007
@@ -109,7 +109,7 @@
else
{
NCERR << "PkgSpecial( " << subwidget->toString() << " ) not found - take default `Label" << endl;
- w = new NCLabel( dynamic_cast<NCWidget *>( parent ), opt, subwidget );
+ w = new NCLabel( dynamic_cast<NCWidget *>( parent ), subwidget->toString(), false, false );
}
return w;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc Wed Jun 27 15:04:22 2007
@@ -97,7 +97,7 @@
NCDBG << "Widget tree of NCPackageSelector created" << endl;
// get the widget ID of the package table
- YWidget * pkg = YDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Packages() );
+ YWidget * pkg = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Packages() );
pkgList = dynamic_cast<NCPkgTable *>(pkg);
if ( pkgList )
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPkgTable.cc Wed Jun 27 15:04:22 2007
@@ -437,7 +437,10 @@
packager->fillPatchList( "installable" ); // default: installable patches
// set the visible info to long description
- packager->setVisibleInfo ( NCPkgNames::PatchDescr() );
+ //packager->setVisibleInfo ( NCPkgNames::PatchDescr() );
+ YStringWidgetID * descrID = new YStringWidgetID( "patchdescr" );
+ packager->setVisibleInfo ( descrID );
+
// show the package description of the current item
showInformation ();
break;
@@ -447,7 +450,9 @@
{
packager->fillUpdateList();
// set the visible info to package description
- packager->setVisibleInfo ( NCPkgNames::PkgInfo() );
+ //packager->setVisibleInfo ( NCPkgNames::PkgInfo() );
+ YStringWidgetID * infoID = new YStringWidgetID( "pkginfo");
+ packager->setVisibleInfo ( infoID );
// show the package description of the current item
showInformation ();
break;
@@ -462,7 +467,9 @@
defaultGroup );
// set the visible info to package description
- packager->setVisibleInfo ( NCPkgNames::PkgInfo() );
+ //packager->setVisibleInfo ( NCPkgNames::PkgInfo() );
+ YStringWidgetID * infoID = new YStringWidgetID( "pkginfo");
+ packager->setVisibleInfo ( infoID );
// show the package description of the current item
showInformation ();
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc Wed Jun 27 15:04:22 2007
@@ -28,18 +28,17 @@
//
// DESCRIPTION :
//
-NCPushButton::NCPushButton( NCWidget * parent, const YWidgetOpt & opt,
- YCPString nlabel )
- : YPushButton( opt, nlabel )
+NCPushButton::NCPushButton( NCWidget * parent, const string & nlabel )
+ : YPushButton( (YWidget *)parent, nlabel )
, NCWidget( parent )
{
WIDDBG << endl;
setLabel( nlabel );
hotlabel = &label;
- if ( opt.isDefaultButton.value() )
+ if ( isDefaultButton() )
setKeyboardFocus();
-
- setFunctionHotkey( opt );
+ // FIXME !!!
+ //setFunctionHotkey( opt );
}
///////////////////////////////////////////////////////////////////
@@ -120,7 +119,7 @@
//
// DESCRIPTION :
//
-void NCPushButton::setLabel( const YCPString & nlabel )
+void NCPushButton::setLabel( const string & nlabel )
{
label = NCstring( nlabel );
label.stripHotkey();
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.h Wed Jun 27 15:04:22 2007
@@ -51,8 +51,7 @@
public:
- NCPushButton( NCWidget * parent, const YWidgetOpt & opt,
- YCPString label );
+ NCPushButton( NCWidget * parent, const string & label );
virtual ~NCPushButton();
virtual long nicesize( YUIDimension dim );
@@ -69,7 +68,7 @@
virtual NCursesEvent wHandleInput( wint_t key );
- virtual void setLabel( const YCPString & nlabel );
+ virtual void setLabel( const string & nlabel );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
virtual bool setKeyboardFocus() {
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.cc Wed Jun 27 15:04:22 2007
@@ -32,8 +32,8 @@
// DESCRIPTION :
//
NCRadioButton::NCRadioButton( NCWidget * parent,
- const YCPString & nlabel )
- : YRadioButton( parent, nlabel )
+ const string & nlabel )
+ : YRadioButton( dynamic_cast<YWidget *>(parent), nlabel )
, NCWidget( parent )
, checked( false )
{
@@ -101,7 +101,7 @@
//
// DESCRIPTION :
//
-void NCRadioButton::setLabel( const YCPString & nlabel )
+void NCRadioButton::setLabel( const string & nlabel )
{
label = NCstring( nlabel );
label.stripHotkey();
@@ -110,6 +110,7 @@
Redraw();
}
+#if 0
///////////////////////////////////////////////////////////////////
//
//
@@ -122,6 +123,7 @@
{
setValue( newval->value() );
}
+#endif
///////////////////////////////////////////////////////////////////
//
@@ -131,7 +133,7 @@
//
// DESCRIPTION :
//
-void NCRadioButton::setValue( const bool & newval )
+void NCRadioButton::setValue( bool newval )
{
if ( newval != checked ) {
checked = newval;
@@ -142,6 +144,7 @@
}
}
+#if 0
///////////////////////////////////////////////////////////////////
//
//
@@ -154,6 +157,7 @@
{
return YCPBoolean( checked );
}
+#endif
///////////////////////////////////////////////////////////////////
//
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.h Wed Jun 27 15:04:22 2007
@@ -48,14 +48,14 @@
virtual const char * location() const { return "NCRadioButton"; }
- virtual void setValue( const bool & checked );
+ // virtual void setValue( const bool & checked );
virtual void wRedraw();
public:
NCRadioButton( NCWidget * parent,
- const YCPString & label );
+ const string & label );
virtual ~NCRadioButton();
virtual long nicesize( YUIDimension dim );
@@ -70,12 +70,12 @@
**/
virtual void setSize( int newWidth, int newHeight );
- virtual void setLabel( const YCPString & nlabel );
+ virtual void setLabel( const string & nlabel );
// virtual void setValue( const YCPBoolean & newval );
// virtual YCPBoolean getValue();
- virtual void setValue ( bool newval ){ checked = newval; }
+ virtual void setValue ( bool newval );
virtual bool value() { return checked; }
virtual NCursesEvent wHandleInput( wint_t key );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.cc Wed Jun 27 15:04:22 2007
@@ -28,8 +28,8 @@
//
// DESCRIPTION :
//
-NCRadioButtonGroup::NCRadioButtonGroup( NCWidget * parent, const YWidgetOpt & opt )
- : YRadioButtonGroup( opt )
+NCRadioButtonGroup::NCRadioButtonGroup( NCWidget * parent )
+ : YRadioButtonGroup( dynamic_cast<YWidget *>(parent) )
, NCWidget( parent )
, focusId( 0 )
{
@@ -100,6 +100,8 @@
//
void NCRadioButtonGroup::focusNextButton( )
{
+ // FIXME
+#if 0
if ( focusId < buttonlist.size() -1 )
focusId++;
else if ( focusId == buttonlist.size() -1 )
@@ -107,7 +109,8 @@
NCRadioButton * button = dynamic_cast<NCRadioButton*>(buttonlist[focusId]);
if ( button )
- button->setKeyboardFocus();
+ button->setKeyboardFocus();
+#endif
}
///////////////////////////////////////////////////////////////////
@@ -120,6 +123,7 @@
//
void NCRadioButtonGroup::focusPrevButton()
{
+#if 0
if ( focusId > 0 )
focusId--;
else if ( focusId == 0 )
@@ -128,10 +132,12 @@
NCRadioButton * button = dynamic_cast<NCRadioButton*>(buttonlist[focusId]);
if ( button )
button->setKeyboardFocus();
+#endif
}
void NCRadioButtonGroup::setEnabling( bool do_bv )
{
+#if 0
NCRadioButton * button;
for ( unsigned int i = 0; i < buttonlist.size(); i++ )
@@ -140,4 +146,5 @@
if ( button )
button->setEnabling( enabled=do_bv );
}
+#endif
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.h Wed Jun 27 15:04:22 2007
@@ -49,7 +49,7 @@
public:
- NCRadioButtonGroup( NCWidget * parent, const YWidgetOpt & opt );
+ NCRadioButtonGroup( NCWidget * parent );
virtual ~NCRadioButtonGroup();
//virtual long nicesize( YUIDimension dim ) { return YRadioButtonGroup::nicesize( dim ); }
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.cc Wed Jun 27 15:04:22 2007
@@ -28,8 +28,8 @@
//
// DESCRIPTION :
//
-NCReplacePoint::NCReplacePoint( NCWidget * parent, const YWidgetOpt & opt )
- : YReplacePoint( opt )
+NCReplacePoint::NCReplacePoint( NCWidget * parent )
+ : YReplacePoint( (YWidget *)parent )
, NCWidget( parent )
{
WIDDBG << endl;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.h Wed Jun 27 15:04:22 2007
@@ -47,7 +47,7 @@
public:
- NCReplacePoint( NCWidget * parent, const YWidgetOpt & opt );
+ NCReplacePoint( NCWidget * parent );
virtual ~NCReplacePoint();
//virtual long nicesize( YUIDimension dim ) { return YReplacePoint::nicesize( dim ); }
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc Wed Jun 27 15:04:22 2007
@@ -23,6 +23,8 @@
#include "stringutil.h"
#include <sstream>
+#include "YWidgetID.h"
+
#if 0
#undef DBG_CLASS
#define DBG_CLASS "_NCRichText_"
@@ -321,7 +323,9 @@
string ycpstr;
NCstring::RecodeFromWchar( anchors[armed].target, "UTF-8", &ycpstr );
NCMIL << "LINK: " << ycpstr << endl;
- ret.selection = YCPString( ycpstr );
+ YStringWidgetID * selectionID = new YCPStringWidgetID( ycpstr );
+ //ret.selection = YCPString( ycpstr );
+ ret.selection = selectionID;
}
break;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.cc Wed Jun 27 15:04:22 2007
@@ -28,12 +28,15 @@
//
// DESCRIPTION :
//
-NCSpacing::NCSpacing( NCWidget * parent, const YWidgetOpt & opt,
- float size, bool horizontal, bool vertical )
- : YSpacing( opt, size, horizontal, vertical )
+NCSpacing::NCSpacing( NCWidget * parent,
+ YUIDimension dim,
+ bool stretchable,
+ YLayoutSize_t layoutUnits )
+ : YSpacing( (YWidget *)parent, dim, stretchable )
, NCWidget( parent )
{
WIDDBG << endl;
+#if 0
if ( horizontal && vertical ) {
l = "NC(B)Spacing";
}
@@ -46,6 +49,15 @@
else {
l = "NC(N)Spacing";
}
+#endif
+
+ if ( dim == YD_VERT )
+ l = "NC(V)Spacing";
+ else if ( dim == YD_HORIZ )
+ l = "NC(H)Spacing";
+ else
+ l = "NC(N)Spacing";
+
wstate = NC::WSdumb;
skipNoDimWin = true;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.h Wed Jun 27 15:04:22 2007
@@ -49,8 +49,8 @@
public:
- NCSpacing( NCWidget * parent, const YWidgetOpt & opt,
- float size, bool horizontal, bool vertical );
+ NCSpacing( NCWidget * parent, YUIDimension dim,
+ bool stretchable, YLayoutSize_t layoutUnits );
virtual ~NCSpacing();
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSquash.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSquash.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSquash.cc Wed Jun 27 15:04:22 2007
@@ -28,9 +28,9 @@
//
// DESCRIPTION :
//
-NCSquash::NCSquash( NCWidget * parent, const YWidgetOpt & opt,
+NCSquash::NCSquash( NCWidget * parent,
bool hsquash, bool vsquash )
- : YSquash( opt, hsquash, vsquash )
+ : YSquash( (YWidget *)parent, hsquash, vsquash )
, NCWidget( parent )
{
WIDDBG << endl;
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSquash.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSquash.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSquash.h Wed Jun 27 15:04:22 2007
@@ -47,8 +47,7 @@
public:
- NCSquash( NCWidget * parent, const YWidgetOpt & opt,
- bool hsquash, bool vsquash );
+ NCSquash( NCWidget * parent, bool hsquash, bool vsquash );
virtual ~NCSquash();
//virtual long nicesize( YUIDimension dim ) { return YSquash::nicesize( dim ); }
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc Wed Jun 27 15:04:22 2007
@@ -37,15 +37,15 @@
//
// DESCRIPTION :
//
-NCTextEntry::NCTextEntry( NCWidget * parent, const YWidgetOpt & opt,
- const YCPString & nlabel,
- const YCPString & ntext,
+NCTextEntry::NCTextEntry( NCWidget * parent,
+ const string & nlabel,
+ bool passwordMode,
unsigned maxInput,
unsigned maxFld )
- : YTextEntry( opt, nlabel )
+ : YTextEntry( dynamic_cast<YWidget *>(parent), nlabel, passwordMode )
, NCWidget( parent )
, mayedit( true )
- , passwd( opt.passwordMode.value() )
+ , passwd( passwordMode )
, lwin( 0 )
, twin( 0 )
, maxFldLength ( maxFld )
@@ -67,7 +67,8 @@
setLabel( nlabel );
hotlabel = &label;
- setText( ntext );
+ // not longer on params
+ //setText( ntext );
}
@@ -200,7 +201,7 @@
//
// DESCRIPTION :
//
-void NCTextEntry::setLabel( const YCPString & nlabel )
+void NCTextEntry::setLabel( const string & nlabel )
{
label = NCstring( nlabel );
label.stripHotkey();
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h Wed Jun 27 15:04:22 2007
@@ -90,9 +90,9 @@
public:
- NCTextEntry( NCWidget * parent, const YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & text,
+ NCTextEntry( NCWidget * parent,
+ const string & label,
+ bool passwordMode,
unsigned maxInput = 0,
unsigned maxFld = 0 );
virtual ~NCTextEntry();
@@ -112,7 +112,7 @@
**/
virtual void setSize( int newWidth, int newHeight );
- virtual void setLabel( const YCPString & nlabel );
+ virtual void setLabel( const string & nlabel );
virtual void setText( const YCPString & ntext );
virtual YCPString getText();
@@ -120,7 +120,7 @@
virtual void setValue( const std::string & ntext ); // new for setText()
virtual string value(); // new for getText()
- virtual void setValidChars( const YCPString & validchars );
+ virtual void setValidChars( const string & validchars );
virtual NCursesEvent wHandleInput( wint_t key );
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc Wed Jun 27 15:04:22 2007
@@ -355,10 +355,10 @@
dimension );
}
-YSingleChildContainerWidget * YNCursesUI::createReplacePoint( YWidget * parent, YWidgetOpt & opt )
+YSingleChildContainerWidget * YNCursesUI::createReplacePoint( YWidget * parent )
{
ONCREATE;
- return new NCReplacePoint( dynamic_cast<NCWidget *>( parent ), opt );
+ return new NCReplacePoint( dynamic_cast<NCWidget *>( parent ) );
}
YSingleChildContainerWidget * YNCursesUI::createAlignment( YWidget * parent,
@@ -370,29 +370,27 @@
halign, valign );
}
-YSingleChildContainerWidget * YNCursesUI::createSquash( YWidget * parent, YWidgetOpt & opt,
- bool hsquash,
- bool vsquash )
+YSingleChildContainerWidget * YNCursesUI::createSquash( YWidget * parent,
+ bool hsquash,
+ bool vsquash )
{
ONCREATE;
- return new NCSquash( dynamic_cast<NCWidget *>( parent ), opt,
+ return new NCSquash( dynamic_cast<NCWidget *>( parent ),
hsquash, vsquash );
}
-YSingleChildContainerWidget * YNCursesUI::createFrame( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label )
+YSingleChildContainerWidget * YNCursesUI::createFrame( YWidget * parent,
+ const string & label )
{
ONCREATE;
- return new NCFrame( dynamic_cast<NCWidget *>( parent ), opt,
- label );
+ return new NCFrame( dynamic_cast<NCWidget *>( parent ), label );
}
-YSingleChildContainerWidget * YNCursesUI::createCheckBoxFrame( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label, bool checked )
+YSingleChildContainerWidget * YNCursesUI::createCheckBoxFrame( YWidget * parent,
+ const string & label, bool checked )
{
ONCREATE;
- return new NCCheckBoxFrame( dynamic_cast<NCWidget *>( parent ), opt,
- label, checked );
+ return new NCCheckBoxFrame( dynamic_cast<NCWidget *>( parent ), label, checked );
}
///////////////////////////////////////////////////////////////////
@@ -401,28 +399,29 @@
//
///////////////////////////////////////////////////////////////////
-YWidget * YNCursesUI::createEmpty( YWidget * parent, YWidgetOpt & opt )
+YWidget * YNCursesUI::createEmpty( YWidget * parent )
{
ONCREATE;
- return new NCEmpty( dynamic_cast<NCWidget *>( parent ), opt );
+ return new NCEmpty( dynamic_cast<NCWidget *>( parent ) );
}
-YWidget * YNCursesUI::createSpacing( YWidget * parent, YWidgetOpt & opt,
- float size,
- bool horizontal, bool vertical )
+YWidget * YNCursesUI::createSpacing( YWidget * parent,
+ YUIDimension dim,
+ bool stretchable,
+ YLayoutSize_t layoutUnits )
{
ONCREATE;
- return new NCSpacing( dynamic_cast<NCWidget *>( parent ), opt,
- size, horizontal, vertical );
+ return new NCSpacing( dynamic_cast<NCWidget *>( parent ), dim,
+ stretchable, layoutUnits );
}
-YWidget * YNCursesUI::createLabel( YWidget * parent, YWidgetOpt & opt,
- const YCPString & text )
+YWidget * YNCursesUI::createLabel( YWidget * parent, const string & text,
+ bool isHeading, bool isOutputField )
{
ONCREATE;
- return new NCLabel( dynamic_cast<NCWidget *>( parent ), opt,
- text );
+ return new NCLabel( dynamic_cast<NCWidget *>( parent ), text,
+ isHeading, isOutputField );
}
YWidget * YNCursesUI::createRichText( YWidget * parent, YWidgetOpt & opt,
@@ -443,12 +442,11 @@
label, visibleLines, maxLines );
}
-YWidget * YNCursesUI::createPushButton( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label )
+YWidget * YNCursesUI::createPushButton( YWidget * parent,
+ const string & label )
{
ONCREATE;
- return new NCPushButton( dynamic_cast<NCWidget *>( parent ), opt,
- label );
+ return new NCPushButton( dynamic_cast<NCWidget *>( parent ), label );
}
YWidget * YNCursesUI::createMenuButton( YWidget * parent, YWidgetOpt & opt,
@@ -460,7 +458,7 @@
}
YWidget * YNCursesUI::createRadioButton( YWidget * parent,
- const YCPString & label )
+ const string & label )
{
ONCREATE;
return new NCRadioButton( dynamic_cast<NCWidget *>( parent ),
@@ -476,13 +474,13 @@
label, checked );
}
-YWidget * YNCursesUI::createTextEntry( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & text )
+YWidget * YNCursesUI::createTextEntry( YWidget * parent,
+ const string & label,
+ bool passwordMode )
{
ONCREATE;
- return new NCTextEntry( dynamic_cast<NCWidget *>( parent ), opt,
- label, text );
+ return new NCTextEntry( dynamic_cast<NCWidget *>( parent ),
+ label, passwordMode );
}
YWidget *YNCursesUI::createMultiLineEdit( YWidget * parent, YWidgetOpt & opt,
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Wed Jun 27 15:04:22 2007
@@ -120,7 +120,7 @@
/**
* Creates a replace point.
*/
- virtual YSingleChildContainerWidget * createReplacePoint( YWidget * parent, YWidgetOpt & opt );
+ virtual YSingleChildContainerWidget * createReplacePoint( YWidget * parent );
/**
* Creates an alignment widget
@@ -132,9 +132,9 @@
/**
* Creates a squash widget
*/
- virtual YSingleChildContainerWidget * createSquash( YWidget * parent, YWidgetOpt & opt,
- bool hsquash,
- bool vsquash );
+ virtual YSingleChildContainerWidget * createSquash( YWidget * parent,
+ bool hsquash,
+ bool vsquash );
/**
* Creates a radio button group.
@@ -144,11 +144,11 @@
/**
* Creates a frame widget
*/
- virtual YSingleChildContainerWidget * createFrame( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label );
+ virtual YSingleChildContainerWidget * createFrame( YWidget * parent,
+ const string & label );
- virtual YSingleChildContainerWidget * createCheckBoxFrame( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label,
+ virtual YSingleChildContainerWidget * createCheckBoxFrame( YWidget * parent,
+ const string & label,
bool checked );
//
// Widget creation functions - leaf widgets
@@ -157,15 +157,15 @@
/**
* Creates an empty widget
*/
- virtual YWidget * createEmpty( YWidget * parent, YWidgetOpt & opt );
+ virtual YWidget * createEmpty( YWidget * parent );
/**
* Creates a spacing widget
*/
- virtual YWidget * createSpacing( YWidget * parent, YWidgetOpt & opt,
- float size,
- bool horizontal,
- bool vertical );
+ virtual YWidget * createSpacing( YWidget * parent,
+ YUIDimension dim,
+ bool stretchable,
+ YLayoutSize_t layoutUnits );
/**
* Creates a label.
@@ -173,8 +173,8 @@
* @param heading true if the label is a Heading()
* @param output_field true if the label should look like an output field (3D look)
*/
- virtual YWidget * createLabel( YWidget * parent, YWidgetOpt & opt,
- const YCPString & text );
+ virtual YWidget * createLabel( YWidget * parent, const string & text,
+ bool isHeading, bool isOutputField );
/**
* Creates a rich text widget
@@ -208,8 +208,8 @@
* @param label Label of the button
* @param default_button true if the button should be the dialogs default button
*/
- virtual YWidget * createPushButton( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label );
+ virtual YWidget * createPushButton( YWidget * parent,
+ const string & label );
/**
* Creates a menu button.
@@ -224,7 +224,7 @@
* @param rbg the radio button group the new button will belong to
*/
virtual YWidget * createRadioButton( YWidget * parent,
- const YCPString & label );
+ const string & label );
/**
* Creates a check box
@@ -238,9 +238,9 @@
/**
* Creates a text entry or password entry field.
*/
- virtual YWidget * createTextEntry( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & text );
+ virtual YWidget * createTextEntry( YWidget * parent,
+ const string & label,
+ bool passwordMode );
/**
* Creates a selection box
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPackageSelector.cc Wed Jun 27 15:04:22 2007
@@ -635,7 +635,7 @@
YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
- static_cast<NCLabel *>(filterLabel)->setLabel( label );
+ static_cast<NCLabel *>(filterLabel)->setLabel( label->toString() );
}
}
@@ -731,7 +731,7 @@
YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
- static_cast<NCLabel *>(filterLabel)->setLabel( YCPString(NCPkgNames::SearchResults()) );
+ static_cast<NCLabel *>(filterLabel)->setLabel( NCPkgNames::SearchResults() );
}
return true;
@@ -783,7 +783,7 @@
if ( filterLabel )
{
- static_cast<NCLabel *>(filterLabel)->setLabel( YCPString(NCPkgNames::SearchResults()) );
+ static_cast<NCLabel *>(filterLabel)->setLabel( NCPkgNames::SearchResults() );
}
return true;
@@ -842,15 +842,15 @@
if ( filter == "installable" )
{
// show common label "Online Update Patches"
- static_cast<NCLabel *>(filterLabel)->setLabel( YCPString(NCPkgNames::YOUPatches()) );
+ static_cast<NCLabel *>(filterLabel)->setLabel( NCPkgNames::YOUPatches() );
}
else if ( filter == "installed" )
{
- static_cast<NCLabel *>(filterLabel)->setLabel( YCPString(NCPkgNames::InstPatches()) );
+ static_cast<NCLabel *>(filterLabel)->setLabel( NCPkgNames::InstPatches() );
}
else
{
- static_cast<NCLabel *>(filterLabel)->setLabel( YCPString(NCPkgNames::Patches()) );
+ static_cast<NCLabel *>(filterLabel)->setLabel( NCPkgNames::Patches() );
}
}
@@ -905,7 +905,7 @@
YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
- static_cast<NCLabel *>(filterLabel)->setLabel( YCPString(NCPkgNames::UpdateProblem()) );
+ static_cast<NCLabel *>(filterLabel)->setLabel( NCPkgNames::UpdateProblem() );
}
return true;
@@ -1156,7 +1156,7 @@
YWidget * filterLabel = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Filter() );
if ( filterLabel )
{
- static_cast<NCLabel *>(filterLabel)->setLabel( label );
+ static_cast<NCLabel *>(filterLabel)->setLabel( label->toString() );
}
}
@@ -3058,7 +3058,7 @@
YWidget * diskSpace = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Diskspace() );
if ( diskSpace )
{
- static_cast<NCLabel *>(diskSpace)->setLabel( label );
+ static_cast<NCLabel *>(diskSpace)->setLabel( label->toString() );
}
// check whether required diskspace enters the warning range
@@ -3147,7 +3147,7 @@
YWidget * diskSpace = YCPDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Diskspace() );
if ( diskSpace )
{
- static_cast<NCLabel *>(diskSpace)->setLabel( label );
+ static_cast<NCLabel *>(diskSpace)->setLabel( label->toString() );
}
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc Wed Jun 27 15:04:22 2007
@@ -127,15 +127,17 @@
opt.notifyMode.setValue( true );
- vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, true, 0.8 ) );
- // FIXME: add the headline
// opt.isHeading.setValue( true );
+ //head = new NCLabel( vSplit, opt, YCPString("") );
- head = new NCLabel( vSplit, opt, YCPString("") );
+ head = new NCLabel( vSplit, "", true, false ); // isHeading = true
vSplit->addChild( head );
- vSplit->addChild( new NCSpacing( vSplit, opt, 0.4, false, true ) );
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.4, false, true ) );
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, true, 0.4 ) );
// add the list containing packages with unresolved dependencies
problemw = new NCProblemSelectionBox( vSplit, opt,
@@ -147,14 +149,16 @@
// opt.isHeading.setValue( false );
//vSplit->addChild( new NCSpacing( vSplit, opt, 0.2, false, true ) );
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, true, 0.2 ) ); // stretchable = true
details = new NCTextEntry( vSplit, opt,
YCPString( "" ), YCPString( "" ),
200, 200 );
vSplit->addChild( details );
- vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
-
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, true, 0.8 ) ); // stretchable = true
+
// add the package list containing the dependencies
solutionw = new NCSolutionSelectionBox ( vSplit, opt,
_("P&ossible Solutions"),
@@ -165,7 +169,8 @@
// FIXME
//opt.isHeading.setValue( true );
- vSplit->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) );
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) );
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, false, 0.6 ) ); // stretchable = false
NCSplit * hSplit = new NCSplit( vSplit, opt, YD_HORIZ );
vSplit->addChild( hSplit );
@@ -174,17 +179,18 @@
// add the solve button
opt.key_Fxx.setValue( 10 );
- solveButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::SolveLabel()) );
+ solveButton = new NCPushButton( hSplit, NCPkgNames::SolveLabel() );
//solveButton->setId( NCPkgNames::Solve () );
YStringWidgetID * solveID = new YStringWidgetID("solve");
solveButton->setId( solveID );
hSplit->addChild( solveButton );
- hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
+ hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.2 ) ); // stretchable = true
// add the cancel button
opt.key_Fxx.setValue( 9 );
- cancelButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::CancelLabel()) );
+ cancelButton = new NCPushButton( hSplit, NCPkgNames::CancelLabel() );
// cancelButton->setId( NCPkgNames::Cancel () );
YStringWidgetID * cancelID = new YStringWidgetID("cancel");
cancelButton->setId( cancelID );
@@ -206,7 +212,7 @@
// set headline and table type
if ( head )
- head->setLabel( YCPString(NCPkgNames::PackageDeps()) );
+ head->setLabel( NCPkgNames::PackageDeps() );
// evaluate the result and fill the list with packages
// which have unresolved deps
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc Wed Jun 27 15:04:22 2007
@@ -32,6 +32,7 @@
#include "NCRichText.h"
#include "NCZypp.h"
+#include "NCi18n.h"
#include "NCPkgPopupDescr.h"
#include "NCPackageSelector.h"
@@ -84,21 +85,22 @@
NCSplit * split = new NCSplit( this, opt, YD_VERT );
addChild( split );
- split->addChild( new NCSpacing( split, opt, 0.8, false, true ) );
+ //split->addChild( new NCSpacing( split, opt, 0.8, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, false, 0.8 ) ); // stretchable = false
- // FIXME - add the headline
- // opt.isHeading.setValue( true );
- headline = new NCLabel( split, opt, YCPString( "" ) );
+ headline = new NCLabel( split, "", true, false ); // isHeading = true
split->addChild( headline );
- split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
+ //split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, false, 0.4 ) );
// add the rich text widget for the package description
opt.isVStretchable.setValue( true );
descrText = new NCRichText( split, opt, YCPString( "" ) );
split->addChild( descrText );
- split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, true, 0.6 ) ); // stretchable = true
// add the package table (use default type T_Packages)
pkgTable = new NCPkgTable( split, opt );
@@ -106,17 +108,21 @@
pkgTable->fillHeader();
split->addChild( pkgTable );
- split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
-
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, true, 0.6 ) );
+
opt.isHStretchable.setValue( false );
- NCLabel * helplb = new NCLabel( split, opt, YCPString(NCPkgNames::DepsHelpLine()) );
+ //NCLabel * helplb = new NCLabel( split, opt, YCPString(NCPkgNames::DepsHelpLine()) );
+ // a help line for the dependency popup
+ NCLabel * helplb = new NCLabel( split, _( " [+] Select [-] Delete [>] Update " ), false, false );
split->addChild( helplb );
- split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, false, 0.6 ) ); // stretchable = false
// add the OK button
opt.key_Fxx.setValue( 10 );
- okButton = new NCPushButton( split, opt, YCPString(NCPkgNames::OKLabel()) );
+ okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
YStringWidgetID * okID = new YStringWidgetID( "ok" );
okButton->setId( okID );
@@ -143,7 +149,7 @@
pkgTable->drawList();
- headline->setLabel( YCPString(pkgPtr->summary()) );
+ headline->setLabel( pkgPtr->summary() );
descrText->setText( YCPString(packager->createDescrText(pkgPtr->description())) );
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc Wed Jun 27 15:04:22 2007
@@ -105,9 +105,10 @@
NCSplit * split = new NCSplit( this, opt, YD_VERT );
addChild( split );
- // FIXME - add the headline
// opt.isHeading.setValue( true );
- head = new NCLabel( split, opt, YCPString( "" ) );
+ //head = new NCLabel( split, opt, YCPString( "" ) );
+
+ head = new NCLabel( split, "", true, false ); // isHeading = true
split->addChild( head );
vector<string> header;
@@ -125,7 +126,7 @@
// add the ok button
opt.key_Fxx.setValue( 10 );
- okButton = new NCPushButton( split, opt, YCPString(NCPkgNames::OKLabel()) );
+ okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
YStringWidgetID * okID = new YStringWidgetID( "ok" );
okButton->setId( okID );
@@ -402,7 +403,7 @@
void NCPkgPopupDiskspace::showInfoPopup( string headline )
{
if ( head )
- head->setLabel( YCPString( headline ) );
+ head->setLabel( headline );
// update values in partition table
fillPartitionTable();
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc Wed Jun 27 15:04:22 2007
@@ -58,9 +58,9 @@
, packager( pkger )
{
if ( !packager->isYouMode() )
- createLayout( YCPString(NCPkgNames::PackageSearch()) );
+ createLayout( _( "Package Search" ) );
else
- createLayout( YCPString( _("Search for Patch Name") ) );
+ createLayout( _("Search for Patch Name") );
}
///////////////////////////////////////////////////////////////////
@@ -83,7 +83,7 @@
//
// DESCRIPTION :
//
-void NCPkgPopupSearch::createLayout( const YCPString & headline )
+void NCPkgPopupSearch::createLayout( const string & headline )
{
YWidgetOpt opt;
@@ -91,19 +91,22 @@
NCSplit * vSplit = new NCSplit( this, opt, YD_VERT );
addChild( vSplit );
- vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, false, 0.8 ) ); // stretchable = false
- // FIXME - add the headline
- // opt.isHeading.setValue( true );
- NCLabel * head = new NCLabel( vSplit, opt, headline );
+ //NCLabel * head = new NCLabel( vSplit, opt, headline );
+ NCLabel * head = new NCLabel( vSplit, headline, true, false ); // isHeading = true
vSplit->addChild( head );
- vSplit->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) );
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) );
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, false, 0.6 ) );
// add the input field (a editable combo box)
opt.isHStretchable.setValue( true );
- NCFrame * frame0 = new NCFrame( vSplit, opt, YCPString("" ) );
+ //NCFrame * frame0 = new NCFrame( vSplit, opt, YCPString("" ) );
+ NCFrame * frame0 = new NCFrame( vSplit, "" );
+
NCSplit * vSplit2 = new NCSplit( frame0, opt, YD_VERT );
opt.isEditable.setValue( true );
@@ -114,7 +117,9 @@
searchExpr->itemAdded( YCPString( "" ), // set initial value
0, // index
false ); // not selected
- vSplit2->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) );
+ //vSplit2->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) );
+ vSplit2->addChild( new NCSpacing( vSplit, YD_VERT, false, 0.6 ) );
+
vSplit->addChild( frame0 );
if ( !packager->isYouMode() )
@@ -123,15 +128,19 @@
NCSplit * hSplit2 = new NCSplit( vSplit, opt, YD_HORIZ );
vSplit->addChild( hSplit2 );
ignoreCase = new NCCheckBox( hSplit2, opt, YCPString(NCPkgNames::IgnoreCase()), true );
- hSplit2->addChild( new NCSpacing( hSplit2, opt, 0.1, true, false ) );
+ //hSplit2->addChild( new NCSpacing( hSplit2, opt, 0.1, true, false ) );
+ hSplit2->addChild( new NCSpacing( hSplit2, YD_HORIZ, true, 0.1 ) );
hSplit2->addChild( ignoreCase );
- vSplit->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) ); // VSpacing
-
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) ); // VSpacing
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, false, 0.6 ) );
+
// add a frame containing the other check boxes
opt.isHStretchable.setValue( true );
opt.isVStretchable.setValue( true );
- NCFrame * frame = new NCFrame( vSplit, opt, YCPString(NCPkgNames::SearchIn()) );
+ //NCFrame * frame = new NCFrame( vSplit, opt, YCPString(NCPkgNames::SearchIn()) );
+ // label of a frame in search popup (without hotkey)
+ NCFrame * frame = new NCFrame( vSplit, _( " Search in " ) );
NCSplit * vSplit3 = new NCSplit( frame, opt, YD_VERT );
opt.isVStretchable.setValue( false );
@@ -150,7 +159,8 @@
frame->addChild( vSplit3 );
vSplit->addChild( frame );
- vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) ); // VSpacing
+ //vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) ); // VSpacing
+ vSplit->addChild( new NCSpacing( vSplit, YD_VERT, false, 0.8 ) );
}
NCSplit * hSplit3 = new NCSplit( vSplit, opt, YD_HORIZ );
@@ -158,22 +168,25 @@
// add the cancel and the ok button
opt.key_Fxx.setValue( 10 );
- okButton = new NCPushButton( hSplit3, opt, YCPString(NCPkgNames::OKLabel()) );
+ okButton = new NCPushButton( hSplit3, NCPkgNames::OKLabel() );
YStringWidgetID * okID = new YStringWidgetID("ok");
okButton->setId( okID );
opt.key_Fxx.setValue( 9 );
opt.isVStretchable.setValue( false );
- cancelButton = new NCPushButton( hSplit3, opt, YCPString(NCPkgNames::CancelLabel()) );
+ cancelButton = new NCPushButton( hSplit3, NCPkgNames::CancelLabel() );
YStringWidgetID * cancelID = new YStringWidgetID("cancel");
cancelButton->setId( cancelID );
opt.isHStretchable.setValue( true );
- hSplit3->addChild( new NCSpacing( hSplit3, opt, 0.2, true, false ) );
+ //hSplit3->addChild( new NCSpacing( hSplit3, opt, 0.2, true, false ) );
+ hSplit3->addChild( new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 ) ); // stretchable = true
hSplit3->addChild( okButton );
- hSplit3->addChild( new NCSpacing( hSplit3, opt, 0.4, true, false ) );
+ //hSplit3->addChild( new NCSpacing( hSplit3, opt, 0.4, true, false ) );
+ hSplit3->addChild( new NCSpacing( hSplit3, YD_HORIZ, true, 0.4 ) );
hSplit3->addChild( cancelButton );
- hSplit3->addChild( new NCSpacing( hSplit3, opt, 0.2, true, false ) );
+ //hSplit3->addChild( new NCSpacing( hSplit3, opt, 0.2, true, false ) );
+ hSplit3->addChild( new NCSpacing( hSplit3, YD_HORIZ, true, 0.2 ) );
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.h Wed Jun 27 15:04:22 2007
@@ -78,7 +78,7 @@
virtual long nicesize(YUIDimension dim);
- void createLayout( const YCPString & headline );
+ void createLayout( const string & headline );
NCursesEvent & showSearchPopup( );
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.cc Wed Jun 27 15:04:22 2007
@@ -28,6 +28,7 @@
#include <zypp/ui/PatternContents.h>
#include "NCZypp.h"
+#include "NCi18n.h"
#ifdef FIXME
#define LOCALE Y2PM::getPreferredLocale()
@@ -54,11 +55,11 @@
{
case S_Pattern:
case S_Selection: {
- createLayout( YCPString(NCPkgNames::SelectionLabel()) );
+ createLayout( NCPkgNames::SelectionLabel() );
break;
}
case S_Language: {
- createLayout( YCPString(NCPkgNames::LanguageLabel()) );
+ createLayout( NCPkgNames::LanguageLabel() );
break;
}
default:
@@ -90,7 +91,7 @@
//
// DESCRIPTION :
//
-void NCPkgPopupSelection::createLayout( const YCPString & label )
+void NCPkgPopupSelection::createLayout( const string & label )
{
YWidgetOpt opt;
@@ -101,10 +102,8 @@
opt.notifyMode.setValue( false );
- // FIXME - the headline
- // opt.isHeading.setValue( true );
-
- NCLabel * head = new NCLabel( split, opt, label );
+ //NCLabel * head = new NCLabel( split, opt, label );
+ NCLabel * head = new NCLabel( split, label, true, false ); // isHeading = true
split->addChild( head );
// add the selection list
@@ -132,22 +131,27 @@
sel->fillHeader();
split->addChild( sel );
+ // FIXME
opt.notifyMode.setValue( true );
- NCLabel * help = new NCLabel( split, opt, YCPString(NCPkgNames::DepsHelpLine()) );
+ //NCLabel * help = new NCLabel( split, opt, YCPString(NCPkgNames::DepsHelpLine()) );
+ // a help line for the dependency popup
+ NCLabel * help = new NCLabel( split, _( " [+] Select [-] Delete [>] Update " ), false, false );
split->addChild( help );
- split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
-
+ //split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, false, 0.4 ) );
+
// add an OK button
opt.key_Fxx.setValue( 10 );
- okButton = new NCPushButton( split, opt, YCPString(NCPkgNames::OKLabel()) );
+ okButton = new NCPushButton( split, NCPkgNames::OKLabel() );
YStringWidgetID * okID = new YStringWidgetID("ok");
okButton->setId( okID );
split->addChild( okButton );
- split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
+ //split->addChild( new NCSpacing( split, opt, 0.4, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, false, 0.4 ) );
}
///////////////////////////////////////////////////////////////////
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.h Wed Jun 27 15:04:22 2007
@@ -69,7 +69,7 @@
virtual long nicesize(YUIDimension dim);
- void createLayout( const YCPString & label );
+ void createLayout( const string & label );
/**
* Fills the list with the available selections (and the status info)
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc Wed Jun 27 15:04:22 2007
@@ -31,6 +31,8 @@
#include "NCPkgTable.h"
#include "NCZypp.h"
+#include "NCi18n.h"
+
#include <zypp/ui/Selectable.h>
#include <zypp/ui/UserWantedPackages.h>
@@ -84,19 +86,26 @@
NCSplit * split = new NCSplit( this, opt, YD_VERT );
addChild( split );
- split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, false, 0.6 ) ); // stretchable = false
- // FIXME - add the headline
- // opt.isHeading.setValue( true );
- NCLabel * head = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeLabel()) );
+ //NCLabel * head = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeLabel()) );
+
+ // the headline of the popup containing a list with packages with status changes
+ NCLabel * head = new NCLabel( split, _( "Automatic Changes" ), true, false ); // isHeading = true
split->addChild( head );
- split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
- // FIXME
- // opt.isHeading.setValue( false );
- NCLabel * lb1 = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeText1()) );
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, false, 0.6 ) );
+
+ //NCLabel * lb1 = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeText1()) );
+ // text part1 of popup with automatic changes (it's a label; text continous)
+ NCLabel * lb1 = new NCLabel( split, _( "In addition to your manual selections, the following" ), false, false );
+
split->addChild( lb1 );
- NCLabel * lb2 = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeText2()) );
+ //NCLabel * lb2 = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeText2()) );
+ // text part2 of popup with automatic changes
+ NCLabel * lb2 = new NCLabel( split, _( "packages have been changed to resolve dependencies:" ), false, false );
split->addChild( lb2 );
// add the package table (use default type T_Packages)
@@ -112,27 +121,31 @@
opt.isHStretchable.setValue( true );
- hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
+ hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.2 ) ); // stretchable = true
// add the OK button
opt.key_Fxx.setValue( 10 );
- okButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::OKLabel()) );
+ okButton = new NCPushButton( hSplit, NCPkgNames::OKLabel() );
YStringWidgetID * okID = new YStringWidgetID( "ok" );
okButton->setId( okID );
hSplit->addChild( okButton );
- hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.4, true, false ) );
+ hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.4 ) );
// add the Cancel button
opt.key_Fxx.setValue( 9 );
- cancelButton = new NCPushButton( hSplit, opt, YCPString(NCPkgNames::CancelLabel()) );
+ cancelButton = new NCPushButton( hSplit, NCPkgNames::CancelLabel() );
YStringWidgetID * cancelID = new YStringWidgetID( "cancel" );
cancelButton->setId( cancelID );
hSplit->addChild( cancelButton );
- hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
+ //hSplit->addChild( new NCSpacing( hSplit, opt, 0.2, true, false ) );
+ hSplit->addChild( new NCSpacing( hSplit, YD_HORIZ, true, 0.2 ) );
- split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ //split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
+ split->addChild( new NCSpacing( split, YD_VERT, false, 0.6 ) );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39053 - in /trunk/live-installer/src: ./ control/
by jsrain@svn.opensuse.org 27 Jun '07
by jsrain@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: jsrain
Date: Wed Jun 27 15:03:00 2007
New Revision: 39053
URL: http://svn.opensuse.org/viewcvs/yast?rev=39053&view=rev
Log:
1st stage (nearly) working (remaining porblem with mkinitrd, product
name hardcoded), 2nd stage WIP
Added:
trunk/live-installer/src/control/Makefile.am
trunk/live-installer/src/inst_live_add_base_repo.ycp
trunk/live-installer/src/inst_live_doit.ycp
- copied unchanged from r39052, trunk/live-installer/src/live_doit.ycp
trunk/live-installer/src/inst_live_sw_select.ycp
trunk/live-installer/src/live_runme_at_boot_finish.ycp
Removed:
trunk/live-installer/src/live_doit.ycp
Modified:
trunk/live-installer/src/Makefile.am
trunk/live-installer/src/control/live-install.xml
trunk/live-installer/src/live-installer.ycp
trunk/live-installer/src/live_copy_files_finish.ycp
Modified: trunk/live-installer/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/Makefile.am?r…
==============================================================================
--- trunk/live-installer/src/Makefile.am (original)
+++ trunk/live-installer/src/Makefile.am Wed Jun 27 15:03:00 2007
@@ -1,10 +1,16 @@
# Makefile.am for live-installer/src
+SUBDIRS = control
+
yncludedir = @yncludedir@/live-installer
client_DATA = \
live-installer.ycp \
- live_doit.ycp
+ inst_live_doit.ycp \
+ inst_live_add_base_repo.ycp \
+ inst_live_sw_select.ycp \
+ live_copy_files_finish.ycp \
+ live_runme_at_boot_finish.ycp
desktop_DATA = \
live-installer.desktop
Added: trunk/live-installer/src/control/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/control/Makef…
==============================================================================
--- trunk/live-installer/src/control/Makefile.am (added)
+++ trunk/live-installer/src/control/Makefile.am Wed Jun 27 15:03:00 2007
@@ -0,0 +1,16 @@
+controldir = /etc/YaST2
+
+control_DATA = \
+ live-install.xml
+
+# Note: The control.glade -> control.xml symlink is required to make xgettext
+# auto-detect the type of this file (glade) so it will extract all
+# <label>..</label> tags. The symlink is created in the toplevel
+# configure.in.in file upon "autoconf" (via "make -f Makefile.cvs").
+# Unfortunately, CVS doesn't support checking in symlinks - it would duplicate
+# the file.
+
+
+EXTRA_DIST = $(control_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Modified: trunk/live-installer/src/control/live-install.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/control/live-…
==============================================================================
--- trunk/live-installer/src/control/live-install.xml (original)
+++ trunk/live-installer/src/control/live-install.xml Wed Jun 27 15:03:00 2007
@@ -42,6 +42,7 @@
<!-- FATE #300898, List of external sources accesible during the installaion time -->
<external_sources_link>http://seven-swords.net/Repos/openSUSE_10.3/testing_list_of_repositories.xml</external_sources_link>
+ <base_repo_url>http://ftp.opensuse.org/pub/opensuse/distribution/SL-OSS-factory/inst-sourc…</base_repo_url>
</software>
<partitioning>
@@ -99,6 +100,7 @@
<inst_finish_stage>
<label>Prepare system for initial boot"</label>
<steps config:type="list">
+ <step>live_runme_at_boot</step>
<!--
copy logs just before 'umount'
keeps maximum logs available after reboot
@@ -157,6 +159,72 @@
</module>
<module>
<label>Perform Installation</label>
+ <name>inst_live_doit</name>
+ <enable_next>no</enable_next>
+ <enable_back>no</enable_back>
+ </module>
+ <module>
+ <label>Perform Installation</label>
+ <name>inst_finish</name>
+ <enable_back>no</enable_back>
+ </module>
+ </modules>
+ </workflow>
+ <workflow>
+ <defaults>
+ <archs>all</archs>
+ <enable_back>yes</enable_back>
+ <enable_next>yes</enable_next>
+ </defaults>
+ <label>Configuration</label>
+ <mode>installation</mode>
+ <stage>continue</stage>
+ <modules config:type="list">
+ <module>
+ <label>Perform Installation</label>
+ <name>inst_netsetup</name>
+ </module>
+ <module>
+ <label>Perform Installation</label>
+ <name>inst_netprobe</name>
+ </module>
+ <module>
+ <label>root Password</label>
+ <name>inst_root</name>
+ </module>
+ <module>
+ <label>Hostname</label>
+ <name>hostname</name>
+ </module>
+ <module>
+ <label>Software Selection</label>
+ <name>inst_live_add_base_repo</name>
+ </module>
+ <module>
+ <label>Software Selection</label>
+ <name>inst_live_sw_select</name>
+ </module>
+ <module>
+ <label>Software Selection</label>
+ <name>inst_rpmcopy</name>
+ </module>
+<!--
+ <module>
+ <label>Perform Installation</label>
+ <name>inst_do_resize</name>
+ <update config:type="boolean">false</update>
+ <archs>i386,x86_64,ia64</archs>
+ </module>
+ <module>
+ <label>Perform Installation</label>
+ <name>inst_prepdisk</name>
+ </module>
+ <module>
+ <label>Perform Installation</label>
+ <name>inst_kickoff</name>
+ </module>
+ <module>
+ <label>Perform Installation</label>
<name>live_doit</name>
<enable_next>no</enable_next>
<enable_back>no</enable_back>
@@ -166,6 +234,7 @@
<name>inst_finish</name>
<enable_back>no</enable_back>
</module>
+-->
</modules>
</workflow>
Added: trunk/live-installer/src/inst_live_add_base_repo.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/inst_live_add…
==============================================================================
--- trunk/live-installer/src/inst_live_add_base_repo.ycp (added)
+++ trunk/live-installer/src/inst_live_add_base_repo.ycp Wed Jun 27 15:03:00 2007
@@ -0,0 +1,26 @@
+/**
+ * Maintainer: Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: firstboot.ycp 36560 2007-02-28 12:40:38Z lslezak $
+ */
+{
+textdomain "live-installer";
+
+import "ProductControl";
+import "ProductFeatures";
+import "PackageCallbacksInit";
+
+PackageCallbacksInit::InitPackageCallbacks ();
+
+// initialize package manager first
+Pkg::TargetInit ("/", false);
+Pkg::SourceStartCache (true);
+
+// add initial source
+string url = ProductFeatures::GetStringFeature ("software", "base_repo_url");
+y2milestone ("Base source URL: %1", url);
+Pkg::SourceCreate (url, "/");
+
+return nil;
+
+} // client end
Added: trunk/live-installer/src/inst_live_sw_select.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/inst_live_sw_…
==============================================================================
--- trunk/live-installer/src/inst_live_sw_select.ycp (added)
+++ trunk/live-installer/src/inst_live_sw_select.ycp Wed Jun 27 15:03:00 2007
@@ -0,0 +1,16 @@
+/**
+ * Maintainer: Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: firstboot.ycp 36560 2007-02-28 12:40:38Z lslezak $
+ */
+{
+textdomain "live-installer";
+
+symbol result = (symbol)WFM::CallFunction ("inst_packages", []);
+y2milestone ("Result: %1", result);
+return nil;
+return result == `accept
+ ? `next
+ : `back;
+
+} // client end
Modified: trunk/live-installer/src/live-installer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/live-installe…
==============================================================================
--- trunk/live-installer/src/live-installer.ycp (original)
+++ trunk/live-installer/src/live-installer.ycp Wed Jun 27 15:03:00 2007
@@ -15,12 +15,16 @@
import "Misc";
import "Installation";
import "Storage";
+ import "Product";
Wizard::OpenNextBackStepsDialog();
Installation::destdir = "/mnt";
Installation::scr_destdir = "/mnt";
+ // FIXME hack because of bootloader - libzypp does not contain product database
+ Product::name = "SUSE Linux";
+
list<map> stage_mode = [$["stage": "initial", "mode": "installation" ]];
y2internal ("SM: %1", stage_mode);
Mode::SetMode ("installation");
Modified: trunk/live-installer/src/live_copy_files_finish.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/live_copy_fil…
==============================================================================
--- trunk/live-installer/src/live_copy_files_finish.ycp (original)
+++ trunk/live-installer/src/live_copy_files_finish.ycp Wed Jun 27 15:03:00 2007
@@ -8,7 +8,7 @@
* Authors:
* Jiri Srain <jsrain(a)suse.cz>
*
- * $Id: copy_files_finish.ycp 38430 2007-06-13 13:50:38Z locilka $
+ * $Id: live_copy_files_finish.ycp 38430 2007-06-13 13:50:38Z locilka $
*
*/
@@ -21,7 +21,8 @@
import "ProductControl";
import "FileUtils";
import "String";
-import "SystemFilesCopy";
+// FIXME don't know why it fails :-(
+// import "SystemFilesCopy";
include "installation/misc.ycp";
@@ -64,7 +65,7 @@
// Copy files from inst-sys to the just installed system
// FATE #301937, items are defined in the control file
- SystemFilesCopy::SaveInstSysContent();
+// SystemFilesCopy::SaveInstSysContent();
// Remove old eula.txt
// bugzilla #208908
Added: trunk/live-installer/src/live_runme_at_boot_finish.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/live_runme_at…
==============================================================================
--- trunk/live-installer/src/live_runme_at_boot_finish.ycp (added)
+++ trunk/live-installer/src/live_runme_at_boot_finish.ycp Wed Jun 27 15:03:00 2007
@@ -0,0 +1,72 @@
+/**
+ * File:
+ * yast_inf_finish.ycp
+ *
+ * Module:
+ * Step of base installation finish
+ *
+ * Authors:
+ * Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: yast_inf_finish.ycp 27936 2006-02-13 20:01:14Z olh $
+ *
+ */
+
+{
+
+textdomain "installation";
+
+import "Mode";
+import "Directory";
+
+include "installation/misc.ycp";
+
+any ret = nil;
+string func = "";
+map param = $[];
+
+/* Check arguments */
+if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
+ func = (string)WFM::Args(0);
+ if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
+ param = (map)WFM::Args(1);
+}
+
+y2milestone ("starting yast_inf_finish");
+y2debug("func=%1", func);
+y2debug("param=%1", param);
+
+if (func == "Info")
+{
+ return (any)$[
+ "steps" : 1,
+ // progress step title
+ "title" : _("Writing YaST Configuration..."),
+ "when" : [ `installation, `update, `autoinst ],
+ ];
+}
+else if (func == "Write")
+{
+ // --------------------------------------------------------------
+ // Tell new boot scripts to launch yast2, once the
+ // new system has done its virgin boot. The Write call
+ // creates any missing directory :-).
+
+ string runme_at_boot = Directory::vardir + "/runme_at_boot";
+ if (!SCR::Write (.target.string, runme_at_boot, ""))
+ {
+ y2error ("Couldn't create target %1", runme_at_boot );
+ }
+}
+else
+{
+ y2error ("unknown function: %1", func);
+ ret = nil;
+}
+
+y2debug("ret=%1", ret);
+y2milestone("yast_inf_finish finished");
+return ret;
+
+
+} /* EOF */
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39052 - /branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YWidget.h
by mvidner@svn.opensuse.org 27 Jun '07
by mvidner@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: mvidner
Date: Wed Jun 27 14:18:25 2007
New Revision: 39052
URL: http://svn.opensuse.org/viewcvs/yast?rev=39052&view=rev
Log:
silence warning about unused param
Modified:
branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YWidget.h
Modified: branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/mvidner/ui-as-namespace/c…
==============================================================================
--- branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YWidget.h (original)
+++ branches/tmp/mvidner/ui-as-namespace/core/libyui/src/YWidget.h Wed Jun 27 14:18:25 2007
@@ -130,7 +130,7 @@
* automatically delete any child widgets if they are deleted
* themselves. This conflicts with destructors that delete child widgets.
*/
- virtual void childDeleted( YWidget *child ) {}
+ virtual void childDeleted( YWidget * /*child*/ ) {}
/**
* Returns true if this is a dialog widget.
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0