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] r39021 - in /branches/tmp/dmacvicar/ruby-yast: cmake/modules/ examples/ruby/ src/ src/ruby/ src/swig/
by dmacvicar@svn.opensuse.org 25 Jun '07
by dmacvicar@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: dmacvicar
Date: Mon Jun 25 18:26:33 2007
New Revision: 39021
URL: http://svn.opensuse.org/viewcvs/yast?rev=39021&view=rev
Log:
lot of progress, ruby -> yast works fine.
yast -> ruby still segfaults when loading the
ruby module, but for one day it is a lot, backup!
Added:
branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp.ycp
branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb
branches/tmp/dmacvicar/ruby-yast/src/ruby/
branches/tmp/dmacvicar/ruby-yast/src/ruby/CMakeLists.txt
branches/tmp/dmacvicar/ruby-yast/src/ruby/Makefile.am
branches/tmp/dmacvicar/ruby-yast/src/ruby/RubyLogger.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/RubyLogger.h
branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2CCRuby.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2CCRuby.h
branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.h
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/YCP.rb
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.h
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.h
branches/tmp/dmacvicar/ruby-yast/src/ruby/YaPI.pm.in
Modified:
branches/tmp/dmacvicar/ruby-yast/cmake/modules/FindYast.cmake
branches/tmp/dmacvicar/ruby-yast/examples/ruby/test1.rb
branches/tmp/dmacvicar/ruby-yast/src/CMakeLists.txt
branches/tmp/dmacvicar/ruby-yast/src/swig/yast.i
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 Mon Jun 25 18:26:33 2007
@@ -9,10 +9,13 @@
set(YAST_YCP_LIBRARY)
FIND_PATH(YAST_INCLUDE_DIR Y2.h
+ ${CMAKE_INSTALL_PREFIX}/include/YaST2
/usr/include/YaST2
/usr/local/include/YaST2
)
+SET(YAST_PLUGIN_DIR ${CMAKE_INSTALL_PREFIX}/lib/YaST2/plugin)
+
FIND_LIBRARY(YAST_LIBRARY NAMES y2
PATHS
/usr/lib
@@ -34,6 +37,7 @@
if(YAST_INCLUDE_DIR AND YAST_LIBRARY AND YAST_YCP_LIBRARY)
MESSAGE( STATUS "YaST2 found: includes in ${YAST_INCLUDE_DIR}, library in ${YAST_LIBRARY}")
+ MESSAGE( STATUS " plugins in ${YAST_PLUGIN_DIR}")
set(YAST_FOUND TRUE)
else(YAST_INCLUDE_DIR AND YAST_LIBRARY AND YAST_YCP_LIBRARY)
MESSAGE( STATUS "YaST2 not found")
Added: branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp.ycp (added)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp.ycp Mon Jun 25 18:26:33 2007
@@ -0,0 +1,13 @@
+
+{
+ import "Duncan";
+ string result = multiply_by_eight(10);
+ UI::OpenDialog(
+ `VBox(
+ `Label(result),
+ `PushButton("OK")
+ )
+ );
+ UI::UserInput();
+ UI::CloseDialog();
+}
\ No newline at end of file
Modified: branches/tmp/dmacvicar/ruby-yast/examples/ruby/test1.rb
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/test1.rb (original)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/test1.rb Mon Jun 25 18:26:33 2007
@@ -13,11 +13,31 @@
component = Y2ComponentBroker.get_namespace_component("Arch");
#puts component.methods
#Y2Namespace *ns = c->import(RSTRING (namespace_name)->ptr);
-ns = get_ns("Arch")
+nsname = "Arch"
+fncname = "sparc32"
+ns = get_ns(nsname)
#/**/
-t = Type.from_signature("bool()")
-puts t
-function = ns.create_function_call("sparc32", t)
+#t = Type.from_signature("bool()")
+#puts t
+sym = ns.table.find(fncname);
+puts sym.class
+if (sym.nil?)
+ raise ("No such symbol #{nsname}::#{fncname}")
+elsif (sym.sentry.is_variable or sym.sentry.reference? )
+ # set the variable
+ #ret_yv = YCP_getset_variable (aTHX_ ns_name, sym_te->sentry (), args);
+else
+ fnccall = ns.create_function_call(fncname, nil)
+ if fnccall.nil?
+ raise("No such function #{nsname}::#{fncname}")
+ end
+end
+exit
+
+h = ns.lookup_symbol("sparc32")
+puts h.class
+exit
+function = ns.create_function_call("sparc32",0)
#call->appendParameter (v);
function.finish_parameters
res = function.evaluate_call
Added: 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 (added)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb Mon Jun 25 18:26:33 2007
@@ -0,0 +1,18 @@
+require 'yast'
+
+# m = YaST::Module.new("Arch")
+# puts m.sparc32
+# puts m.arch_short
+# puts m.is_xen
+
+m = YaST::Module.new("Popup")
+m.Message("Hello")
+
+exit
+m = YaST::Module.new("Storage")
+dp = m.GetDiskPartition("/dev/sda1")
+dp.each do | key, value |
+ puts "#{key} #{value}"
+end
+
+
Modified: branches/tmp/dmacvicar/ruby-yast/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/C…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/CMakeLists.txt (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/CMakeLists.txt Mon Jun 25 18:26:33 2007
@@ -1 +1,2 @@
-ADD_SUBDIRECTORY(swig)
\ No newline at end of file
+ADD_SUBDIRECTORY(swig)
+ADD_SUBDIRECTORY(ruby)
\ No newline at end of file
Added: 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 (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/CMakeLists.txt Mon Jun 25 18:26:33 2007
@@ -0,0 +1,45 @@
+
+ADD_DEFINITIONS(-DY2LOG=\\\"Ruby\\\")
+
+SET(yast_ruby_module_SRCS
+ YCP.cc
+ Y2RubyTypeConv.cc
+ RubyLogger.cc
+ RubyLogger.h
+)
+
+SET(ruby_yast_plugin_SRCS
+ RubyLogger.cc
+ Y2CCRuby.cc
+ Y2RubyComponent.cc
+ YRuby.cc
+ YRubyNamespace.cc
+ Y2RubyTypeConv.cc
+)
+
+SET(ruby_yast_plugin_HEADERS
+ RubyLogger.h
+ Y2CCRuby.h
+ Y2RubyComponent.h
+ YRuby.h
+ YRubyNamespace.h )
+
+INCLUDE_DIRECTORIES( ${RUBY_INCLUDE_PATH} )
+INCLUDE_DIRECTORIES( ${YAST_INCLUDE_DIR} )
+
+ADD_LIBRARY( yast SHARED ${yast_ruby_module_SRCS})
+SET_TARGET_PROPERTIES( yast PROPERTIES PREFIX "" )
+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 ${RUBY_LIBRARY} )
+INSTALL(TARGETS yast LIBRARY DESTINATION ${RUBY_ARCH_DIR} )
+
+ADD_LIBRARY( py2lang_ruby SHARED ${ruby_yast_plugin_SRCS})
+TARGET_LINK_LIBRARIES( py2lang_ruby ${YAST_LIBRARY} )
+TARGET_LINK_LIBRARIES( py2lang_ruby ${YAST_YCP_LIBRARY} )
+TARGET_LINK_LIBRARIES( py2lang_ruby ${YAST_PLUGIN_WFM_LIBRARY} )
+TARGET_LINK_LIBRARIES( py2lang_ruby ${RUBY_LIBRARY} )
+INSTALL(TARGETS py2lang_ruby LIBRARY DESTINATION ${YAST_PLUGIN_DIR} )
+
+#SET_TARGET_PROPERTIES( y2lang_ruby PROPERTIES PREFIX "" )
\ No newline at end of file
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/Makefile.am (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Makefile.am Mon Jun 25 18:26:33 2007
@@ -0,0 +1,93 @@
+#
+# Makefile.am for perl-bindings/src
+#
+
+AM_CXXFLAGS = -DY2LOG=\"Perl\" -DMODULEDIR=\"$(moduledir)\"
+
+MY_PERL_VENDORARCH = $(subst /usr,$(prefix),$(PERL_VENDORARCH))
+perlpmdir = $(MY_PERL_VENDORARCH)/YaST
+perlsodir = $(MY_PERL_VENDORARCH)/auto/YaST/YCP
+
+perlpm_DATA = YCP.pm
+
+# plugin, libtool forces 'lib' prefix
+plugin_LTLIBRARIES = libpy2lang_perl.la
+noinst_LTLIBRARIES = liby2lang_perl.la
+perlso_LTLIBRARIES = libYCP.la
+
+# binary part of the Perl module
+libYCP_la_SOURCES = \
+ $(liby2lang_perl_la_SOURCES) \
+ YCP.cc \
+ PerlLogger.cc PerlLogger.h
+
+
+# are there enough yast libraries?
+# check with y2base, integrate them like y2pm does
+# Originally, of the py2* there was only py2plugin here
+# with the assumption that it would bring in the other plugins.
+# But it does not work.
+libYCP_la_LDFLAGS = $(PERL_LDFLAGS) \
+ -L$(libdir) -L$(plugindir) \
+ -Xlinker --whole-archive \
+ -lpy2scr \
+ -lpy2wfm \
+ -lscr -lyui \
+ -lycp -ly2 \
+ -Xlinker --no-whole-archive \
+ ${ZYPP_LIBS} -ly2util \
+ -version-info 2:0
+
+
+libpy2lang_perl_la_LDFLAGS = -version-info 2:0
+
+liby2lang_perl_la_LDFLAGS = -version-info 2:0
+
+
+# the yast libraries are apparently necessary when we're loaded by perl.
+libpy2lang_perl_la_LIBADD = $(PERL_LDFLAGS) \
+ -L$(libdir) -L$(plugindir) \
+ -lycp -ly2 ${ZYPP_LIBS} -ly2util
+#libpy2lang_perl_la_LIBADD = $(PERL_LDFLAGS)
+
+liby2lang_perl_la_LIBADD = $(PERL_LDFLAGS)
+
+
+liby2lang_perl_la_SOURCES = \
+ YPerl.cc YPerl.h \
+ perlxsi.c
+
+# Auto-generated stub for dynamic loading of Perl modules.
+# And also register the interface to the YCP module
+## which is linked in already and won't be in the standard Perl location.
+#
+# This results in a linker warning:
+# *** Warning: Linking the shared library libpy2lang_perl.la against the
+# *** static library /usr/lib/perl5/.../DynaLoader.a is not portable!
+#
+# According to mls(a)suse.de this warning can safely be disregarded:
+# The SuSE DynaLoader is compiled with -fPIC for just this situation.
+#
+# -- sh(a)suse.de 2003-07-24
+perlxsi.c:
+ perl -MExtUtils::Embed -e xsinit -- -o perlxsi.c -std
+# See "man perlembed"
+
+
+# the plugin adds the liby2 component interface
+
+libpy2lang_perl_la_SOURCES = \
+ $(liby2lang_perl_la_SOURCES) \
+ Y2CCPerl.cc Y2CCPerl.h \
+ YPerlNamespace.cc YPerlNamespace.h \
+ Y2PerlComponent.cc Y2PerlComponent.h
+
+CLEANFILES = \
+ perlxsi.c
+
+INCLUDES = -I$(srcdir)/include -I$(includedir) ${ZYPP_CFLAGS}
+
+# generated from YaPI.pm.in by configure
+nodist_module_DATA = YaPI.pm
+
+EXTRA_DIST = $(perlpm_DATA) $(module_DATA)
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/RubyLogger.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/RubyLogger.cc (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/RubyLogger.cc Mon Jun 25 18:26:33 2007
@@ -0,0 +1,31 @@
+#include "RubyLogger.h"
+#include <ycp/ExecutionEnvironment.h>
+
+extern ExecutionEnvironment ee;
+
+void
+RubyLogger::error (string error_message)
+{
+ y2_logger (LOG_ERROR,"Ruby",ee.filename ().c_str ()
+ ,ee.linenumber (),"","%s", error_message.c_str ());
+}
+
+
+void
+RubyLogger::warning (string warning_message)
+{
+ y2_logger (LOG_ERROR,"Ruby",ee.filename ().c_str ()
+ ,ee.linenumber (),"","%s", warning_message.c_str ());
+}
+
+RubyLogger*
+RubyLogger::instance ()
+{
+ if ( ! m_rubylogger )
+ {
+ m_rubylogger = new RubyLogger ();
+ }
+ return m_rubylogger;
+}
+
+RubyLogger* RubyLogger::m_rubylogger = NULL;
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/RubyLogger.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/RubyLogger.h (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/RubyLogger.h Mon Jun 25 18:26:33 2007
@@ -0,0 +1,23 @@
+#ifndef RubyLogger_h
+#define RubyLogger_h
+
+#include "ycp/y2log.h"
+
+/**
+ * @short A class to provide logging for Ruby bindings errors and warning
+ */
+class RubyLogger : public Logger
+{
+ static RubyLogger* m_rubylogger;
+
+public:
+ void error (string message);
+ void warning (string message);
+
+ static RubyLogger* instance ();
+};
+
+#endif // ifndef RubyLogger_h
+
+
+// EOF
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2CCRuby.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2CCRuby.cc (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2CCRuby.cc Mon Jun 25 18:26:33 2007
@@ -0,0 +1,43 @@
+#include "Y2CCRuby.h"
+#include <ycp/pathsearch.h>
+#define y2log_component "Y2Ruby"
+#include <ycp/y2log.h>
+
+// This is very important: We create one global variable of
+// Y2CCRuby. Its constructor will register it automatically to
+// the Y2ComponentBroker, so that will be able to find it.
+// This all happens before main() is called!
+
+Y2CCRuby g_y2ccruby;
+
+Y2Component *Y2CCRuby::provideNamespace (const char *name)
+{
+ y2debug ("Y2CCRuby::provideNamespace %s", name);
+ if (strcmp (name, "Ruby") == 0)
+ {
+ // low level functions
+
+ // leave implementation to later
+ return 0;
+ }
+ else
+ {
+ // is there a ruby module?
+ // must be the same in Y2CCRuby and Y2RubyComponent
+ string module = YCPPathSearch::find (YCPPathSearch::Module, string (name) + ".rb");
+ y2milestone("Find result '%s'", module.c_str());
+ if (!module.empty ())
+ {
+ if (!cruby)
+ {
+ y2milestone("new ruby component");
+ cruby = new Y2RubyComponent();
+ }
+ y2milestone("returning existing ruby component");
+ return cruby;
+ }
+
+ // let someone else try creating the namespace
+ return 0;
+ }
+}
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2CCRuby.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2CCRuby.h (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2CCRuby.h Mon Jun 25 18:26:33 2007
@@ -0,0 +1,75 @@
+/*-----------------------------------------------------------*- c++ -*-\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| core system |
+| (C) SuSE Linux AG |
+\----------------------------------------------------------------------/
+
+ File: Y2CCRuby.h
+
+ Author: Stefan Hundhammer <sh(a)suse.de>
+
+/-*/
+
+
+#ifndef _Y2CCRuby_h
+#define _Y2CCRuby_h
+
+#include "Y2RubyComponent.h"
+
+/**
+ * @short Y2ComponentCreator that creates Ruby-from-YCP bindings.
+ *
+ * A Y2ComponentCreator is an object that can create components.
+ * It receives a component name and - if it knows how to create
+ * such a component - returns a newly created component of this
+ * type. Y2CCRuby can create components with the name "Ruby".
+ */
+class Y2CCRuby : public Y2ComponentCreator
+{
+private:
+ Y2Component *cruby;
+
+public:
+ /**
+ * Creates a Ruby component creator
+ */
+ Y2CCRuby() : Y2ComponentCreator( Y2ComponentBroker::BUILTIN ),
+ cruby (0) {};
+
+ ~Y2CCRuby () {
+ if (cruby)
+ delete cruby;
+ }
+
+ /**
+ * Returns true, since the Ruby component is a YaST2 server.
+ */
+ bool isServerCreator() const { return true; };
+
+ /**
+ * Creates a new Ruby component.
+ */
+ Y2Component *create( const char * name ) const
+ {
+ // create as many as requested, they all share the static YRuby anyway
+ if ( ! strcmp( name, "ruby") ) return new Y2RubyComponent();
+ else return 0;
+ }
+
+ /**
+ * always returns the same component, deletes it finally
+ */
+ Y2Component *provideNamespace (const char *name);
+
+};
+
+#endif // ifndef _Y2CCRuby_h
+
+
+// EOF
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.cc (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.cc Mon Jun 25 18:26:33 2007
@@ -0,0 +1,54 @@
+#define y2log_component "Y2Ruby"
+#include <ycp/y2log.h>
+#include <ycp/pathsearch.h>
+
+#include "Y2RubyComponent.h"
+#include "YRuby.h"
+#include "YRubyNamespace.h"
+using std::string;
+
+
+Y2RubyComponent::Y2RubyComponent()
+{
+ // Actual creation of a Ruby interpreter is postponed until one of the
+ // YRuby static methods is used. They handle that.
+
+ y2milestone( "Creating Y2RubyComponent" );
+}
+
+
+Y2RubyComponent::~Y2RubyComponent()
+{
+ y2milestone( "Destroying Y2RubyComponent" );
+ YRuby::destroy();
+}
+
+
+void Y2RubyComponent::result( const YCPValue & )
+{}
+
+
+Y2Namespace *Y2RubyComponent::import (const char* name)
+{
+ y2milestone("Creating namespace for import '%s'", name);
+ // TODO where to look for it
+ // must be the same in Y2CCRuby and Y2RubyComponent
+ string module = YCPPathSearch::find (YCPPathSearch::Module, string (name) + ".rb");
+ if (module.empty ())
+ {
+ y2internal ("Couldn't find %s after Y2CCRuby pointed to us", name);
+ return NULL;
+ }
+ y2milestone("Found in '%s'", module.c_str());
+ module.erase (module.size () - 3 /* strlen (".pm") */);
+ YCPList args;
+ args->add (YCPString(/*module*/ name));
+
+ // load it
+ YRuby::loadModule (args);
+ y2milestone("Module '%s' loaded", name);
+ // introspect, create data structures for the interpreter
+ Y2Namespace *ns = new YRubyNamespace (name);
+
+ return ns;
+}
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.h (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.h Mon Jun 25 18:26:33 2007
@@ -0,0 +1,55 @@
+#ifndef Y2RubyComponent_h
+#define Y2RubyComponent_h
+
+#include "Y2.h"
+
+
+/**
+ * @short YaST2 Component: Ruby bindings
+ */
+class Y2RubyComponent : public Y2Component
+{
+public:
+ /**
+ * Constructor.
+ */
+ Y2RubyComponent();
+
+ /**
+ * Destructor.
+ */
+ ~Y2RubyComponent();
+
+ /**
+ * The name of this component.
+ */
+ string name() const { return "perl"; }
+
+ /**
+ * Is called by the generic frontend when the session is finished.
+ */
+ void result( const YCPValue & result );
+
+ /**
+ * Implements the Ruby:: functions.
+ **/
+// not yet, prototype the transparent bindings first
+// YCPValue evaluate( const YCPValue & val );
+
+ /**
+ * Try to import a given namespace. This method is used
+ * for transparent handling of namespaces (YCP modules)
+ * through whole YaST.
+ * @param name_space the name of the required namespace
+ * @return on errors, NULL should be returned. The
+ * error reporting must be done by the component itself
+ * (typically using y2log). On success, the method
+ * should return a proper instance of the imported namespace
+ * ready to be used. The returned instance is still owned
+ * by the component, any other part of YaST will try to
+ * free it. Thus, it's possible to share the instance.
+ */
+ Y2Namespace *import (const char* name);
+};
+
+#endif // Y2RubyComponent_h
Added: 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 (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.cc Mon Jun 25 18:26:33 2007
@@ -0,0 +1,107 @@
+
+#include <ycp/y2log.h>
+
+#include <ycp/YCPValue.h>
+#include <ycp/YCPBoolean.h>
+#include <ycp/YCPList.h>
+#include <ycp/YCPMap.h>
+#include <ycp/YCPString.h>
+#include <ycp/YCPInteger.h>
+#include <ycp/YCPFloat.h>
+#include <ycp/YCPElement.h>
+#include <ycp/Import.h>
+
+#include "Y2RubyTypeConv.h"
+
+/**
+ * Converts a YCPValue into a Ruby Value
+ * Supports neested lists using recursion.
+ */
+extern "C" VALUE
+ycpvalue_2_rbvalue( YCPValue ycpval )
+{
+ // TODO
+ // YT_BYTEBLOCK YT_PATH YT_SYMBOL YT_LIST YT_TERM YT_MAP YT_CODE YT_RETURN YT_BREAK YT_ENTRY YT_ERROR YT_REFERENCE YT_EXTERNA
+ if (ycpval->isVoid())
+ {
+ return Qnil;
+ }
+ else if (ycpval->isBoolean())
+ {
+ return ycpval->asBoolean()->value() ? Qtrue : Qfalse;
+ }
+ else if (ycpval->isString())
+ {
+ return rb_str_new2(ycpval->asString()->value().c_str());
+ }
+ else if (ycpval->isInteger())
+ {
+ return INT2NUM( ycpval->asInteger()->value() );
+ }
+ else if ( ycpval->isMap() )
+ {
+ VALUE rbhash;
+ rbhash = rb_hash_new();
+ YCPMap map = ycpval->asMap();
+ y2internal("map size %d\n", map.size());
+
+ for ( YCPMapIterator it = map.begin(); it != map.end(); ++it )
+ {
+ YCPValue key = it.key();
+ YCPValue value = it.value();
+ rb_hash_aset(rbhash, ycpvalue_2_rbvalue(key), ycpvalue_2_rbvalue(value) );
+ }
+ return rbhash;
+ }
+ else if (ycpval->isList())
+ {
+ VALUE rblist;
+ rblist = rb_ary_new();
+ YCPList list = ycpval->asList();
+ y2internal("list size %d\n",list.size());
+ for (int i=0; i < list.size(); i++)
+ {
+ rb_ary_push( rblist, ycpvalue_2_rbvalue(list.value(i)));
+ }
+ return rblist;
+ }
+ rb_raise( rb_eRuntimeError, "Conversion of YCP type %s not supported", ycpval->toString().c_str() );
+ return Qnil;
+}
+
+// isEmpty size add remove (value n) toString
+YCPValue
+rbvalue_2_ycpvalue( VALUE value )
+{
+ // TODO conver integers, and add support for lists, ah, and boleans!
+ switch (TYPE(value))
+ {
+ case T_STRING:
+ return YCPString(RSTRING (value)->ptr);
+ break;
+ case T_TRUE:
+ return YCPBoolean(true);
+ break;
+ case T_FALSE:
+ return YCPBoolean(false);
+ break;
+ case T_FIXNUM:
+ return YCPInteger(NUM2LONG(value));
+ break;
+ case T_FLOAT:
+ return YCPFloat(NUM2DBL(value));
+ break;
+ case T_ARRAY:
+ // FIXME
+ break;
+ case T_HASH:
+ // FIXME
+ break;
+ case T_DATA:
+ rb_raise( rb_eRuntimeError, "Object");
+ break;
+ std::cout << TYPE(value) << std::endl;
+ rb_raise( rb_eRuntimeError, "Conversion of Ruby type not supported");
+ return YCPValue();
+ }
+}
Added: 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 (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyTypeConv.h Mon Jun 25 18:26:33 2007
@@ -0,0 +1,23 @@
+
+#ifndef Y2RUBYTYPECONV_H
+#define Y2RUBYTYPECONV_H
+
+#include <ycp/YCPValue.h>
+#include "ruby.h"
+
+/**
+ * Converts a YCPValue into a Ruby Value
+ * Supports neested lists using recursion.
+ */
+extern "C" VALUE
+ycpvalue_2_rbvalue( YCPValue ycpval );
+
+/**
+ * Converts a Ruby Value into a YCPValue
+ * Supports neested lists using recursion.
+ */
+YCPValue
+rbvalue_2_ycpvalue( VALUE value );
+
+#endif
+
Added: 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 (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.cc Mon Jun 25 18:26:33 2007
@@ -0,0 +1,679 @@
+// #include <y2/Y2Namespace.h>
+// #include <y2/Y2Component.h>
+#include <y2/Y2ComponentCreator.h>
+
+#include <yui/YUIComponent.h>
+#include <wfm/Y2WFMComponent.h>
+
+#include <y2/Y2ComponentBroker.h>
+#include <y2/Y2Namespace.h>
+#include <y2/Y2Component.h>
+#include <y2/Y2Function.h>
+
+#include <ycp/pathsearch.h>
+#include <ycp/y2log.h>
+#include <ycp/YBlock.h>
+#include <ycp/YExpression.h>
+#include <ycp/YStatement.h>
+#include <ycp/YCPValue.h>
+#include <ycp/YCPBoolean.h>
+#include <ycp/YCPList.h>
+#include <ycp/YCPMap.h>
+#include <ycp/YCPString.h>
+#include <ycp/YCPInteger.h>
+#include <ycp/YCPFloat.h>
+#include <ycp/YCPElement.h>
+#include <ycp/Import.h>
+
+#include "ruby.h"
+
+//#include "YRuby.h"
+#include "RubyLogger.h"
+#include "Y2RubyTypeConv.h"
+
+static VALUE rb_mYaST;
+static VALUE rb_cBroker;
+
+// make the compiler happy when
+// calling rb_define_method()
+typedef VALUE (ruby_method)(...);
+
+// more useful macros
+#define RB_FINALIZER(func) ((void (*)(...))func)
+
+// this macro saves us from typing
+// (ruby_method*) & method_name
+// in rb_define_method
+#define RB_METHOD(func) ((VALUE (*)(...))func)
+
+Y2Component *owned_uic = 0;
+Y2Component *owned_wfmc = 0;
+
+static
+Y2Namespace *
+getNs (const char * ns_name, const char * func_name)
+{
+ Import import(ns_name); // has a static cache
+ Y2Namespace *ns = import.nameSpace();
+ if (ns == NULL)
+ {
+ y2error ("... for a Ruby call of %s", func_name);
+ }
+ else
+ {
+ ns->initialize ();
+ }
+ return ns;
+}
+
+typedef struct brokerinfo
+{
+ Y2Component *component;
+ Y2Namespace *ns;
+}
+BrokerInfo;
+
+// mark for garbage collection
+// NOT USED, ONLY WHEN USING DATA_WRAP_STRUCT
+void
+yast_module_mark( BrokerInfo *info )
+{}
+
+// dispose a namespace
+// NOT USED, ONLY WHEN USING DATA_WRAP_STRUCT
+void
+yast_module_free( BrokerInfo *info )
+{
+ //std::cout << "Deleting namespace." << std::endl;
+ //delete info;
+}
+
+VALUE
+yast_module_allocate( VALUE klass )
+{
+ BrokerInfo *info = new BrokerInfo;
+ return Data_Wrap_Struct( klass, yast_module_mark, RB_FINALIZER(yast_module_free), info );
+}
+
+VALUE
+yast_module_initialize( VALUE self, VALUE param_ns_name )
+{
+ Check_Type(param_ns_name, T_STRING);
+ rb_iv_set(self, "@namespace_name", param_ns_name);
+ return self;
+}
+
+VALUE
+yast_module_methods( VALUE self )
+{
+ return Qnil;
+}
+
+VALUE
+yast_module_proxy_method( int argc, VALUE *argv, VALUE self )
+{
+ VALUE symbol = argv[0];
+ // 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);
+
+ //Check_Type(argv[0], T_STRING);
+ //y2internal(RSTRING (symbol)->ptr);
+ //Data_Get_Struct( self, class Y2Namespace, ns );
+ //ns = gNameSpaces[self];
+
+ Y2Component *c;
+ VALUE namespace_name = rb_iv_get(self, "@namespace_name");
+ c = Y2ComponentBroker::getNamespaceComponent(RSTRING (namespace_name)->ptr);
+ if (c == NULL)
+ {
+ y2internal("No component can provide namespace %s\n", RSTRING (namespace_name)->ptr);
+ rb_raise( rb_eRuntimeError, "No component can provide namespace %s\n", RSTRING (namespace_name)->ptr);
+ return 2;
+ }
+ y2internal("component name %s\n", c->name().c_str());
+
+ // import the namespace
+ //Y2Namespace *ns = c->import(RSTRING (namespace_name)->ptr);
+ Y2Namespace *ns = getNs( RSTRING (namespace_name)->ptr, RSTRING(symbol_str)->ptr);
+ if (ns == NULL)
+ {
+ rb_raise( rb_eRuntimeError, "Component cannot import namespace %s", RSTRING (namespace_name)->ptr );
+ return Qnil;
+ }
+ else
+ {
+ y2internal("Namespace created from %s\n", ns->filename().c_str());
+ }
+ // ensure it is an initialized namespace
+ //ns->initialize ();
+ y2internal("Namespace %s initialized\n", RSTRING (namespace_name)->ptr);
+
+ TableEntry *sym_te = ns->table()->find (RSTRING(symbol_str)->ptr);
+
+ if (sym_te == NULL)
+ {
+ y2error ("No such symbol %s::%s", RSTRING (namespace_name)->ptr, RSTRING(symbol_str)->ptr);
+ rb_raise( rb_eNameError, "YCP symbol '%s' not found in namespace '%s'", RSTRING(symbol_str)->ptr, RSTRING (namespace_name)->ptr );
+ return Qnil;
+ }
+
+ if (sym_te->sentry ()->isVariable () ||
+ sym_te->sentry ()->isReference ())
+ {
+ // set the variable
+ //ret_yv = YCP_getset_variable (aTHX_ ns_name, sym_te->sentry (), args);
+ }
+ else
+ { // no indent yet
+ Y2Function* call = ns->createFunctionCall (RSTRING(symbol_str)->ptr, 0 /*Type::fromSignature("list<string>()")*/);
+
+ if (call == NULL)
+ {
+ y2internal ("Cannot create function call %s\n", RSTRING(symbol_str)->ptr);
+ return 4;
+ }
+
+ // add the parameters
+ for (int i=1; i<argc; i++)
+ {
+ VALUE arg = argv[i];
+ YCPValue v = rbvalue_2_ycpvalue(arg);
+ //y2internal ("Appending parameter %s\n", v->toString());
+ call->appendParameter (v);
+ }
+ call->finishParameters ();
+
+ YCPValue res = call->evaluateCall ();
+ delete call;
+ y2internal ("Call succeded\n");
+ //y2internal ("Result: %i\n", res->asList()->size());
+ return ycpvalue_2_rbvalue(res);
+ }
+ return Qnil;
+}
+
+
+extern "C"
+{
+ void
+ Init_yast()
+ {
+ YCPPathSearch::initialize ();
+
+
+ for ( list<string>::const_iterator it = YCPPathSearch::searchListBegin (YCPPathSearch::Module); it != YCPPathSearch::searchListEnd (YCPPathSearch::Module) ; ++it )
+ {
+ y2internal("%s\n", (*it).c_str() );
+ }
+
+ string module = YCPPathSearch::find (YCPPathSearch::Module, string ("MyModule.ycp"));
+ y2internal("%s\n", module.c_str() );
+
+ rb_mYaST = rb_define_module("YaST");
+
+ // CIMClient
+ rb_cBroker = rb_define_class_under( rb_mYaST, "Module", rb_cObject);
+ //rb_define_singleton_method( rb_cBroker, "new", RB_METHOD(module_new), 1);
+ 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);
+ }
+}
+
+
+// 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;
+// }
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.rb
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.rb (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YCP.rb Mon Jun 25 18:26:33 2007
@@ -0,0 +1,520 @@
+#! /usr/bin/perl -w
+# Martin Vidner
+# $Id: YCP.pm 33405 2006-10-13 13:12:42Z mvidner $
+
+=head1 NAME
+
+YaST::YCP - a binary interface between Perl and YCP
+
+=head1 SYNOPSIS
+
+ use YaST::YCP qw(:DATA :LOGGING);
+
+ YaST::YCP::Import ("SCR");
+ my $m = SCR->Read (".sysconfig.displaymanager.DISPLAYMANAGER");
+ SCR->Write (".sysconfig.kernel.CRASH_OFTEN", Boolean (1));
+
+=head1 DATA TYPES
+
+YaST has a richer and stricter data type system than Perl.
+
+Note that the stdio-communicating agents, based on the modules
+L<YaST::SCRAgent|YaST::SCRAgent> and L<ycp|ycp>, have a similar but
+not the same data type mapping.
+
+When the language binding knows what type to expect, eg. when passing
+an argument to a YCP function, it will convert a Perl scalar to the
+desired type.
+
+On the other hand, if the type is not known, expressed
+in YCP as C<any>, scalars will be passed as strings. If you want
+a specific data type, use one of the data classes like
+L<YaST::YCP::Integer|/Integer>. Of course these work also when
+the type is known.
+
+=over 4
+
+=item void
+
+Has only one value, C<nil>, which is represented as C<undef>.
+Any data type can have C<nil> as a value.
+
+=item any
+
+A union of all data types. Any data type can be assigned to it.
+
+=item string, integer, float, boolean
+
+B<YCP to Perl:> Becomes a scalar
+
+B<Perl to YCP:> Any scalar will become a string
+(even if it looks like a number).
+Use L</String>, L</Integer>, L</Float> or L</Boolean>
+if you want a specific data type.
+
+=item list E<lt>TE<gt>
+
+B<YCP to Perl:> A list becomes a reference to an array.
+(Note that it refers to a B<copy>.)
+
+B<Perl to YCP:> A reference to an array becomes a list.
+I<This was different before SL9.1 Beta1:>
+Perl functions returning multiple values should not return a list
+but a reference to it. YCP will always set a scalar calling context,
+even if the result is assigned to a list.
+
+=item map E<lt>T1, T2E<gt>
+
+B<YCP to Perl:> A map becomes a reference to a hash.
+(Note that it refers to a B<copy>.)
+
+B<Perl to YCP:> A reference to a hash becomes a map.
+
+=item path
+
+B<YCP to Perl:> NOT IMPLEMENTED YET.
+
+B<Perl to YCP:> If a path is expected, a scalar like C<".foo.bar">
+will be converted to C<.foo.bar>.
+Otherwise use L</Path> (which is NOT IMPLEMENTED YET).
+
+=item symbol
+
+B<YCP to Perl:> Becomes a L</Symbol>.
+
+B<Perl to YCP:> If a symbol is expected, a scalar like C<"foo">
+will be converted to C<`foo>.
+Otherwise use L</Symbol>.
+
+=item term
+
+B<YCP to Perl:> Becomes a L</Term>.
+
+B<Perl to YCP:> Use L</Term>.
+
+=item byteblock
+
+B<YCP to Perl:> Becomes a scalar.
+
+B<Perl to YCP:> If a byteblock is expected, a scalar like C<"\0\1">
+will be converted to C<#[0001]>.
+Otherwise use L</Byteblock>.
+
+=item locale, block E<lt>TE<gt>, ...
+
+Not implemented.
+
+=back
+
+=head1 YaST::YCP
+
+The DATA tag (in C<use YaST::YCP qw(:DATA)>) imports the data
+constructor functions such as Boolean, Symbol or Term.
+
+=cut
+
+package YaST::YCP;
+use strict;
+use warnings;
+use diagnostics;
+
+require Exporter;
+our @ISA = qw(Exporter);
+my @e_data = qw(Boolean Byteblock Integer Float String Symbol Term);
+my @e_logging = qw(y2debug y2milestone y2warning y2error y2security y2internal);
+our @EXPORT_OK = (@e_data, @e_logging, "sformat");
+our %EXPORT_TAGS = ( DATA => [@e_data], LOGGING => [@e_logging] );
+
+=head2 debug
+
+ $olddebug = YaST::YCP::debug (1);
+ YaST::YCP::...
+ YaST::YCP::debug ($olddebug);
+
+Enables miscellaneous unscpecified debugging
+
+=cut
+
+my $debug = 0;
+sub debug (;$)
+{
+ my $param = shift;
+ if (defined $param)
+ {
+ $debug = $param;
+ }
+ return $debug;
+}
+
+
+## calls boot_YaST__YCP
+require XSLoader;
+XSLoader::load ('YaST::YCP');
+
+=head2 init_ui
+
+ YaST::YCP::init_ui ();
+ YaST::YCP::init_ui "qt";
+
+Initializes the user interface, "ncurses" (the default) or "qt".
+
+=cut
+
+# ensure that the ncurses window is closed
+# and wfm and its agents are closed (#39519)
+END {
+ close_components (); # XS
+}
+
+=head2 Import
+
+ YaST::YCP::Import "Namespace";
+ Namespace->foo ("bar");
+
+Imports a YaST namespace (in YCP or Perl or any supported language).
+Equivalent to YCP C<import>, similar to Perl C<use>.
+
+If C<Namespace> is in YCP, its constructor is executed later than if
+it were imported from YCP. This can have subtle effects, for example
+in testsuites. To get closer to the YCP import behavior, call
+C<Import> from a C<BEGIN> block.
+
+=cut
+
+sub Import ($)
+{
+ my $package = shift;
+ print "Importing $package\n" if debug;
+
+ no strict;
+ # let it get our autoload
+ *{"${package}::AUTOLOAD"} = \&YaST::YCP::Autoload::AUTOLOAD;
+}
+
+=head2 logging
+
+These functions go via liby2util and thus use log.conf.
+See also ycp::y2milestone.
+
+The multiple arguments are simply joined by a space.
+
+ y2debug ($message, $message2, ...)
+ y2milestone ($message, $message2, ...)
+ y2warning ($message, $message2, ...)
+ y2error ($message, $message2, ...)
+ y2security ($message, $message2, ...)
+ y2internal ($message, $message2, ...)
+
+=cut
+
+sub y2_logger_helper ($@)
+{
+ my $level = shift;
+ # look _two_ frames up for the subroutine
+ # when called from the main script, it will be undef
+ my ($package, $filename, $line, $subroutine) = caller (2);
+ # look _one_ frame up for file and line
+ # (is it because of optimization?)
+ ($package, $filename, $line) = caller (1);
+ # this is a XS:
+ y2_logger ($level, "Perl", $filename, $line, $subroutine || "",
+ join (" ", @_));
+}
+
+sub y2debug (@) { y2_logger_helper (0, @_); }
+sub y2milestone (@) { y2_logger_helper (1, @_); }
+sub y2warning (@) { y2_logger_helper (2, @_); }
+sub y2error (@) { y2_logger_helper (3, @_); }
+sub y2security (@) { y2_logger_helper (4, @_); }
+sub y2internal (@) { y2_logger_helper (5, @_); }
+
+=head2 sformat
+
+Implements the sformat YCP builtin:
+
+C<sformat ('%2 %% %1', "a", "b")> returns C<'b % a'>
+
+It is useful mainly for messages marked for translation.
+
+=cut
+
+sub sformat ($@)
+{
+ # don't shift
+ # now the % indices can be used for @_
+ my $format = $_[0];
+
+ # g: global, replace all occurences
+ # e: expression, not a string
+ $format =~ s{%([1-9%])}{
+ ($1 eq '%') ? '%' : $_[$1]
+ }ge;
+
+ return $format;
+}
+
+# shortcuts for the data types
+# for POD see packages below
+
+sub Boolean ($)
+{
+ return new YaST::YCP::Boolean (@_);
+}
+
+sub Byteblock ($)
+{
+ return new YaST::YCP::Byteblock (@_);
+}
+
+sub Integer ($)
+{
+ return new YaST::YCP::Integer (@_);
+}
+
+sub Float ($)
+{
+ return new YaST::YCP::Float (@_);
+}
+
+sub String ($)
+{
+ return new YaST::YCP::String (@_);
+}
+
+sub Symbol ($)
+{
+ return new YaST::YCP::Symbol (@_);
+}
+
+sub Term ($@)
+{
+ return new YaST::YCP::Term (@_);
+}
+
+# by defining AUTOLOAD in a separate package, undefined functions in
+# the main one will be detected
+package YaST::YCP::Autoload;
+use strict;
+use warnings;
+use diagnostics;
+
+# cannot rely on UNIVERSAL::AUTOLOAD getting automatically called
+# http://www.rocketaware.com/perl/perldelta/Deprecated_Inherited_C_AUTOLOAD.h…
+
+# Gets called instead of all functions in Import'ed modules
+# It assumes a normal function, not a class or instance method
+sub AUTOLOAD
+{
+ our $AUTOLOAD;
+
+ # strip $self on the way from Perl to YCP,
+ # just as it is added in the reverse direction
+ my $himself = shift;
+ print "$himself $AUTOLOAD (", join (", ", @_), ")\n" if YaST::YCP::debug;
+
+ my @components = split ("::", $AUTOLOAD);
+ my $func = pop (@components);
+ return YaST::YCP::call_ycp (join ("::", @components), $func, @_);
+}
+
+=head2 Boolean
+
+ $b = YaST::YCP::Boolean (1);
+ $b->value (0);
+ print $b->value, "\n";
+ SCR::Write (".foo", $b);
+
+=cut
+
+package YaST::YCP::Boolean;
+use strict;
+use warnings;
+use diagnostics;
+
+# a Boolean is just a blessed reference to a scalar
+
+sub new
+{
+ my $class = shift;
+ my $val = shift;
+ return bless \$val, $class
+}
+
+# get/set
+sub value
+{
+ # see "Constructors and Instance Methods" in perltoot
+ my $self = shift;
+ if (@_) { $$self = shift; }
+ return $$self;
+}
+
+=head2 Byteblock
+
+A chunk of binary data.
+
+ use YaST::YCP qw(:DATA);
+
+ read ($dev_random_fh, $r, 100);
+ $b = Byteblock ($r);
+ $b->value ("Hello\0world\0");
+ print $b->value, "\n";
+ return $b;
+
+=cut
+
+package YaST::YCP::Byteblock;
+use strict;
+use warnings;
+use diagnostics;
+
+# a Byteblock is just a blessed reference to a scalar
+# just like Boolean, so use it!
+
+our @ISA = qw (YaST::YCP::Boolean);
+
+=head2 Integer
+
+An explicitly typed integer, useful to put in heterogenous data structures.
+
+ use YaST::YCP qw(:DATA);
+
+ $i = Integer ("42 and more");
+ $i->value ("43, actually");
+ print $i->value, "\n";
+ return [ $i ];
+
+=cut
+
+package YaST::YCP::Integer;
+use strict;
+use warnings;
+use diagnostics;
+
+
+# an Integer is just a blessed reference to a scalar
+# just like Boolean, so use it!
+
+our @ISA = qw (YaST::YCP::Boolean);
+
+=head2 Float
+
+An explicitly typed float, useful to put in heterogenous data structures.
+
+ use YaST::YCP qw(:DATA);
+
+ $f = Float ("3.41 is PI");
+ $f->value ("3.14 is PI");
+ print $f->value, "\n";
+ return [ $f ];
+
+=cut
+
+package YaST::YCP::Float;
+use strict;
+use warnings;
+use diagnostics;
+
+
+# a Float is just a blessed reference to a scalar
+# just like Boolean, so use it!
+
+our @ISA = qw (YaST::YCP::Boolean);
+
+=head2 Path
+
+Not implemented yet.
+
+=cut
+
+=head2 String
+
+An explicitly typed string, useful to put in heterogenous data structures.
+
+ use YaST::YCP qw(:DATA);
+
+ $s = String (42);
+ $s->value (1 + 1);
+ print $s->value, "\n";
+ return [ $s ];
+
+=cut
+
+package YaST::YCP::String;
+use strict;
+use warnings;
+use diagnostics;
+
+# a String is just a blessed reference to a scalar
+# just like Boolean, so use it!
+
+our @ISA = qw (YaST::YCP::Boolean);
+
+=head2 Symbol
+
+ use YaST::YCP qw(:DATA);
+
+ $s = Symbol ("next");
+ $s->value ("back");
+ print $s->value, "\n";
+ return Term ("id", $s);
+
+=cut
+
+package YaST::YCP::Symbol;
+use strict;
+use warnings;
+use diagnostics;
+
+
+# a Symbol is just a blessed reference to a scalar
+# just like Boolean, so use it!
+
+our @ISA = qw (YaST::YCP::Boolean);
+
+=head2 Term
+
+ $t = new YaST::YCP::Term("CzechBox", "Accept spam", new YaST::YCP::Boolean(0));
+ $t->name ("CheckBox");
+ print $t->args->[0], "\n";
+ UIx::OpenDialog ($t);
+
+=cut
+
+package YaST::YCP::Term;
+use strict;
+use warnings;
+use diagnostics;
+
+# a Term has a name and arguments
+
+sub new
+{
+ my $class = shift;
+ my $name = shift;
+ my $args = [ @_ ];
+ return bless { name => $name, args => $args }, $class
+}
+
+# get/set
+sub name
+{
+ # see "Constructors and Instance Methods" in perltoot
+ my $self = shift;
+ if (@_) { $self->{name} = shift; }
+ return $self->{name};
+}
+
+# get/set
+sub args
+{
+ # see "Constructors and Instance Methods" in perltoot
+ my $self = shift;
+ if (@_) { @{ $self->{args} } = @_; }
+ # HACK:
+ # because I don't want to process multiple return values,
+ # I return it as a reference
+ return $self->{args};
+}
+
+1;
Added: 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 (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc Mon Jun 25 18:26:33 2007
@@ -0,0 +1,121 @@
+#include <stdlib.h>
+#include <list>
+#include <iosfwd>
+#include <sstream>
+#include <iomanip>
+
+// Ruby stuff
+#include <ruby.h>
+
+
+#define y2log_component "Y2Ruby"
+#include <ycp/y2log.h>
+#include <ycp/pathsearch.h>
+
+
+#include <ycp/YCPBoolean.h>
+#include <ycp/YCPByteblock.h>
+#include <ycp/YCPFloat.h>
+#include <ycp/YCPInteger.h>
+#include <ycp/YCPList.h>
+#include <ycp/YCPMap.h>
+#include <ycp/YCPPath.h>
+#include <ycp/YCPString.h>
+#include <ycp/YCPSymbol.h>
+#include <ycp/YCPTerm.h>
+#include <ycp/YCPVoid.h>
+#include <ycp/YCPCode.h>
+#include <ycp/YCPExternal.h>
+
+#include "YRuby.h"
+
+#define DIM(ARRAY) ( sizeof( ARRAY )/sizeof( ARRAY[0] ) )
+
+#define YCP_EXTERNAL_MAGIC "Reference to perl object (v1.0)"
+
+static void prependModulePath()
+{
+ YCPPathSearch::initialize ();
+
+ list<string>::const_iterator
+ b = YCPPathSearch::searchListBegin (YCPPathSearch::Module),
+ e = YCPPathSearch::searchListEnd (YCPPathSearch::Module),
+ i;
+
+ // count the number of directories to prepend
+ int n = 0;
+ for (i = b; i != e; ++i)
+ {
+ // do something
+ }
+}
+
+YRuby * YRuby::_yRuby = 0;
+
+YRuby::YRuby()
+{
+ y2milestone( "Initializing ruby interpreter." );
+ ruby_init();
+ //ruby_options(argc - 1, ++argv);
+ ruby_script("yast");
+}
+
+YRuby::~YRuby()
+{}
+
+
+YRuby *
+YRuby::yRuby()
+{
+ if ( ! _yRuby )
+ _yRuby = new YRuby();
+
+ return _yRuby;
+}
+
+
+YCPValue
+YRuby::destroy()
+{
+ y2milestone( "Shutting down embedded Ruby interpreter." );
+
+ if ( _yRuby )
+ delete _yRuby;
+
+ _yRuby = 0;
+
+ return YCPVoid();
+}
+
+/**
+ * Loads a module.
+ */
+YCPValue
+YRuby::loadModule( YCPList argList )
+{
+ y2milestone("loadModule 1");
+ if ( argList->size() != 1 || ! argList->value(0)->isString() )
+ return YCPError( "Ruby::loadModule() / Ruby::Use() : Bad arguments: String expected!" );
+ y2milestone("loadModule 2");
+ string module_name = argList->value(0)->asString()->value();
+ y2milestone("loadModule 3");
+ string require_module = "require(\"" + module_name + "\")";
+ y2milestone("loadModule 3.5");
+ VALUE a = rb_eval_string((require_module).c_str());
+ y2milestone("loadModule 4");
+ return YCPVoid();
+}
+
+
+
+/**
+ * @param argList arguments start 1!, 0 is dummy
+ */
+YCPValue
+YRuby::callInner (string module, string function, bool method,
+ YCPList argList, constTypePtr wanted_result_type)
+{
+ y2milestone( "Called function '%s' in module '%s'", module.c_str(), function.c_str());
+ return YCPVoid();
+}
+
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.h (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.h Mon Jun 25 18:26:33 2007
@@ -0,0 +1,74 @@
+#ifndef YRuby_h
+#define YRuby_h
+
+// Ruby stuff
+#include <ruby.h>
+
+#include <ycp/YCPList.h>
+#include <ycp/Type.h>
+
+class YRuby
+{
+public:
+
+ /**
+ * Load a Ruby module - equivalent to "use" in Ruby.
+ *
+ * Returns a YCPError on failure, YCPVoid on success.
+ **/
+ static YCPValue loadModule( YCPList argList );
+
+ /**
+ * Access the static (singleton) YRuby object. Create it if it isn't
+ * created yet.
+ *
+ * Returns 0 on error.
+ **/
+ static YRuby * yRuby();
+
+ /**
+ * Destroy the static (singleton) YRuby object and unload the embedded Ruby
+ * interpreter.
+ *
+ * Returns YCPVoid().
+ **/
+ static YCPValue destroy();
+
+
+protected:
+
+ /**
+ * Protected constructor. Use one of the static methods rather than
+ * instantiate an object of this class yourself.
+ **/
+ YRuby();
+
+ /**
+ * Protected constructor. Use one of the static methods rather than
+ * instantiate an object of this class yourself.
+ **/
+
+ /**
+ * Destructor.
+ **/
+ ~YRuby();
+
+ /**
+ * Returns the internal embedded Ruby interpreter.
+ **/
+
+
+public:
+ /**
+ * Generic Ruby call.
+ **/
+ YCPValue callInner (string module, string function, bool method,
+ YCPList argList, constTypePtr wanted_result_type);
+
+protected:
+
+public:
+ static YRuby * _yRuby;
+};
+
+#endif // YRuby_h
Added: 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 (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc Mon Jun 25 18:26:33 2007
@@ -0,0 +1,221 @@
+#include "YRubyNamespace.h"
+
+// Ruby stuff
+#include <ruby.h>
+
+#define y2log_component "Y2Ruby"
+#include <ycp/y2log.h>
+
+#include <ycp/YCPElement.h>
+#include <ycp/Type.h>
+#include <ycp/YCPVoid.h>
+//#include <YCP.h>
+#include "YRuby.h"
+#include <stdio.h>
+
+/**
+ * using this instead of plain strcmp
+ * enables embedding argument names into the typeinfo
+ */
+static bool firstWordIs (const char *where, const char *what)
+{
+ size_t n = strlen (what);
+ return !strncmp (where, what, n) &&
+ (where[n] == '\0' || isspace (where[n]));
+}
+
+/**
+ * The definition of a function that is implemented in Ruby
+ */
+class Y2RubyFunctionCall : public Y2Function
+{
+ //! module name
+ string m_module_name;
+ //! function name, excluding module name
+ string m_local_name;
+ //! function type
+ constFunctionTypePtr m_type;
+ //! data prepared for the inner call
+ YCPList m_call;
+
+public:
+ Y2RubyFunctionCall (const string &module_name,
+ const string &local_name,
+ constFunctionTypePtr function_type
+ ) :
+ m_module_name (module_name),
+ m_local_name (local_name),
+ m_type (function_type)
+ {
+ // placeholder, formerly function name
+ m_call->add (YCPVoid ());
+ }
+
+ //! if true, the perl function is passed the module name
+ virtual bool isMethod () = 0;
+
+ //! called by YEFunction::evaluate
+ virtual YCPValue evaluateCall ()
+ {
+ return YRuby::yRuby()->callInner ( m_module_name,
+ m_local_name,
+ isMethod (),
+ m_call,
+ m_type->returnType() );
+ }
+ /**
+ * Attaches a parameter to a given position to the call.
+ * @return false if there was a type mismatch
+ */
+ virtual bool attachParameter (const YCPValue& arg, const int position)
+ {
+ m_call->set (position+1, arg);
+ return true;
+ }
+
+ /**
+ * What type is expected for the next appendParameter (val) ?
+ * (Used when calling from Ruby, to be able to convert from the
+ * simple type system of Ruby to the elaborate type system of YCP)
+ * @return Type::Any if number of parameters exceeded
+ */
+ virtual constTypePtr wantedParameterType () const
+ {
+ // -1 for the function name
+ int params_so_far = m_call->size ()-1;
+ return m_type->parameterType (params_so_far);
+ }
+
+ /**
+ * Appends a parameter to the call.
+ * @return false if there was a type mismatch
+ */
+ virtual bool appendParameter (const YCPValue& arg)
+ {
+ m_call->add (arg);
+ return true;
+ }
+
+ /**
+ * Signal that we're done adding parameters.
+ * @return false if there was a parameter missing
+ */
+ virtual bool finishParameters ()
+ {
+ return true;
+ }
+
+
+ virtual bool reset ()
+ {
+ m_call = YCPList ();
+ // placeholder, formerly function name
+ m_call->add (YCPVoid ());
+ return true;
+ }
+
+ /**
+ * Something for remote namespaces
+ */
+ virtual string name () const
+ {
+ return m_local_name;
+ }
+};
+
+class Y2RubySubCall : public Y2RubyFunctionCall
+{
+public:
+ Y2RubySubCall (const string &module_name,
+ const string &local_name,
+ constFunctionTypePtr function_type
+ ) :
+ Y2RubyFunctionCall (module_name, local_name, function_type)
+ {}
+ virtual bool isMethod ()
+ {
+ return false;
+ }
+};
+
+class Y2RubyMethodCall : public Y2RubyFunctionCall
+{
+public:
+ Y2RubyMethodCall (const string &module_name,
+ const string &local_name,
+ constFunctionTypePtr function_type
+ ) :
+ Y2RubyFunctionCall (module_name, local_name, function_type)
+ {}
+ virtual bool isMethod ()
+ {
+ return true;
+ }
+};
+
+
+
+YRubyNamespace::YRubyNamespace (string name)
+ : m_name (name),
+ m_all_methods (true)
+{
+ y2milestone("Creating namespace for '%s'", name.c_str());
+ VALUE methods_in_module = rb_eval_string(("require(\"" + name + "\")").c_str());
+ VALUE module = rb_funcall( rb_mKernel, rb_intern("const_get"), 1, rb_str_new2(name.c_str()) );
+ if (module == Qnil)
+ {
+ y2error ("The Ruby module '%s' is not provided by its rb file", name.c_str());
+ return;
+ }
+ y2milestone("The module '%s' was found", name.c_str());
+}
+
+YRubyNamespace::~YRubyNamespace ()
+{}
+
+const string YRubyNamespace::filename () const
+{
+ // TODO improve
+ return ".../" + m_name;
+}
+
+// this is for error reporting only?
+string YRubyNamespace::toString () const
+{
+ y2error ("TODO");
+ return "{\n"
+ "/* this namespace is provided in Ruby */\n"
+ "}\n";
+}
+
+// called when running and the import statement is encountered
+// does initialization of variables
+// constructor is handled separately after this
+YCPValue YRubyNamespace::evaluate (bool cse)
+{
+ // so we don't need to do anything
+ y2debug ("Doing nothing");
+ return YCPNull ();
+}
+
+// It seems that this is the standard implementation. why would we
+// ever want it to be different?
+Y2Function* YRubyNamespace::createFunctionCall (const string name, constFunctionTypePtr required_type)
+{
+ y2debug ("Creating function call for %s", name.c_str ());
+ TableEntry *func_te = table ()->find (name.c_str (), SymbolEntry::c_function);
+ if (func_te)
+ {
+ constTypePtr t = required_type ? required_type : (constFunctionTypePtr)func_te->sentry()->type ();
+ if (m_all_methods)
+ {
+ return new Y2RubyMethodCall (m_name, name, t);
+ }
+ else
+ {
+ return new Y2RubySubCall (m_name, name, t);
+ }
+ }
+ y2error ("No such function %s", name.c_str ());
+ return NULL;
+}
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.h (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.h Mon Jun 25 18:26:33 2007
@@ -0,0 +1,34 @@
+#include <y2/Y2Namespace.h>
+#include <y2/Y2Function.h>
+#include <ycp/YStatement.h>
+
+/**
+ * YaST interface to a Ruby module
+ */
+class YRubyNamespace : public Y2Namespace
+{
+private:
+ string m_name; //! this namespace's name, eg. XML::Writer
+ bool m_all_methods; //! add the class name to all calls
+public:
+ /**
+ * Construct an interface. The module must be already loaded
+ * @param name eg "XML::Writer"
+ */
+ YRubyNamespace (string name);
+
+ virtual ~YRubyNamespace ();
+
+ //! what namespace do we implement
+ virtual const string name () const { return m_name; }
+ //! used for error reporting
+ virtual const string filename () const;
+
+ //! unparse. useful only for YCP namespaces??
+ virtual string toString () const;
+ //! called when evaluating the import statement
+ // constructor is handled separately
+ virtual YCPValue evaluate (bool cse = false);
+
+ virtual Y2Function* createFunctionCall (const string name, constFunctionTypePtr requiredType);
+};
Added: branches/tmp/dmacvicar/ruby-yast/src/ruby/YaPI.pm.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YaPI.pm.in (added)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YaPI.pm.in Mon Jun 25 18:26:33 2007
@@ -0,0 +1,246 @@
+# -*- perl -*-
+# @configure_input@
+# $Id: YaPI.pm.in 33405 2006-10-13 13:12:42Z mvidner $
+
+package YaPI;
+
+=head1 NAME
+
+YaPI - common functions for modules implementing YaST API
+
+=cut
+
+BEGIN {
+ # substituted by configure
+ my $modules = '@yast2dir4perl@/modules';
+ # unconditional 'use lib' could override a "use lib ." that
+ # we do during compilation, #197099
+ grep { $_ eq $modules } @INC or unshift(@INC, $modules);
+}
+use strict;
+
+use Exporter;
+our @ISA = qw(Exporter);
+our @EXPORT = qw(textdomain __);
+
+use YaST::YCP;
+use ycp;
+
+use Locale::gettext ("!textdomain");
+use POSIX (); # Needed for setlocale()
+
+POSIX::setlocale(&POSIX::LC_MESSAGES, "");
+
+our %TYPEINFO;
+my %__error = ();
+my $VERSION = "";
+our @CAPABILITIES = ();
+
+=head2 base functions
+
+These are to be used by modules that use YaPI as their base class.
+
+ use YaPI;
+ our @ISA = ("YaPI");
+
+=head3 Interface
+
+Returns a reference to a list of hashes describing the functions
+in the current package. The information is taken from TYPEINFO.
+
+ [
+ {
+ functionName => "contains",
+ return => "boolean",
+ argument => [ "string", ["list", "string"]],
+ },
+ ...
+ ]
+
+=cut
+
+BEGIN { $TYPEINFO{Interface} = ["function", "any"]; }
+sub Interface {
+ my $self = shift;
+ my @ret = ();
+
+ no strict "refs";
+ my %TI = %{"${self}::TYPEINFO"};
+
+ foreach my $k (keys %TYPEINFO) {
+ $TI{$k} = $TYPEINFO{$k};
+ }
+
+ foreach my $funcName (sort keys %TI) {
+ my @dummy = @{$TI{$funcName}};
+ my $hash = {};
+
+ $hash->{'functionName'} = $funcName;
+ $hash->{'return'} = $dummy[1];
+ splice(@dummy, 0, 2);
+ $hash->{'argument'} = \@dummy;
+ push @ret, $hash;
+ }
+ return \@ret;
+}
+
+=head3 Version
+
+Returns the version of the current package.
+
+=cut
+
+BEGIN { $TYPEINFO{Version} = ["function", "string"]; }
+sub Version {
+ my $self = shift;
+ no strict "refs";
+ return ${"${self}::VERSION"};
+}
+
+=head3 Supports
+
+Greps C<@CAPABILITIES> of the current package.
+
+ if (YaPI::Foo->Supports ("frobnicate")) {...}
+
+=cut
+
+BEGIN { $TYPEINFO{Supports} = ["function", "boolean", "string"]; }
+sub Supports {
+ my $self = shift;
+ my $cap = shift;
+
+ no strict "refs";
+ my @c = @{"${self}::CAPABILITIES"};
+ foreach my $k (@CAPABILITIES) {
+ push @c, $k;
+ }
+
+ return !!grep( ($_ eq $cap), @c);
+}
+
+
+=head3 SetError
+
+Logs an error and remembers it for L</Error>.
+
+Error map:
+
+ {
+ code # mandatory, an uppercase short string
+ summary
+ description
+ # if all of the following are missing, caller () is used
+ package
+ file
+ line
+ }
+
+=cut
+
+BEGIN { $TYPEINFO{SetError} = ["function", "boolean", ["map", "string", "any" ]]; }
+sub SetError {
+ my $self = shift;
+ %__error = @_;
+ if( !$__error{package} && !$__error{file} && !$__error{line})
+ {
+ @__error{'package','file','line'} = caller();
+ }
+ if ( defined $__error{summary} ) {
+ y2error($__error{code}."[".$__error{line}.":".$__error{file}."] ".$__error{summary});
+ } else {
+ y2error($__error{code});
+ }
+ if(defined $__error{description} && $__error{description} ne "") {
+ y2error("Description: ".$__error{description});
+ }
+
+ return undef;
+}
+
+=head3 Error
+
+Returns the error set by L</SetError>
+
+=cut
+
+BEGIN { $TYPEINFO{Error} = ["function", ["map", "string", "any"] ]; }
+sub Error {
+ my $self = shift;
+ return \%__error;
+}
+
+=head2 i18n
+
+C<< use YaPI; >>
+
+C<< textdomain "mydomain"; >>
+
+Just use a double underscore to mark text to be translated: C<__("my text")>.
+Both C<textdomain> and C<__> are exported to the calling package.
+
+These must not be used any longer because they collide with symbols
+exported by this module:
+
+ # use Locale::gettext; # textdomain
+ # sub _ { ... }
+
+These don't hurt but aren't necessary:
+
+ # use POSIX ();
+ # POSIX::setlocale(LC_MESSAGES, ""); # YaPI calls it itself now
+
+=head3 textdomain
+
+Calls Locale::gettext::textdomain
+and also
+remembers an association between the calling package and the
+domain. Later calls of __ use this domain as an argument to dgettext.
+
+=cut
+
+# See also bug 38613 where untranslated texts were seen because
+# a random textdomain was used instead of the proper one.
+my %textdomains;
+
+sub textdomain
+{
+ my $domain = shift;
+ my ($package, $filename, $line) = caller;
+
+ if (defined ($textdomains{package}))
+ {
+ if ($textdomains{package} ne $domain)
+ {
+ y2error ("Textdomain '$domain' overrides old textdomain '$textdomains{package}' in package $package, $filename:$line");
+ }
+ }
+ $textdomains{$package} = $domain;
+ return Locale::gettext::textdomain ($domain);
+}
+
+=head3 __ (double underscore)
+
+Calls Locale::gettext::dgettext, supplying the textdomain of the calling
+package (set by calling textdomain).
+
+Note: the single underscore function (_) will be removed because it
+is automaticaly exported to main:: which causes namespace conflicts.
+
+=cut
+
+# bug 39954: __ better than _
+sub __ {
+ my $msgid = shift;
+ my $package = caller;
+ my $domain = $textdomains{$package};
+ return Locale::gettext::dgettext ($domain, $msgid);
+}
+
+# Compatibility by partial typeglob assignment:
+# &_ will call &__ but $_ will not be $__ which would happen
+# if we just asigned *_ = *__.
+# Cannot just call __ from _ because of "caller".
+*_ = \&__;
+
+1;
Modified: branches/tmp/dmacvicar/ruby-yast/src/swig/yast.i
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/s…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/swig/yast.i (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/swig/yast.i Mon Jun 25 18:26:33 2007
@@ -18,6 +18,8 @@
#include <y2/Y2Namespace.h>
#include <y2/Y2Component.h>
#include <y2/Y2Function.h>
+#include <y2/SymbolEntry.h>
+#include <y2util/Ustring.h>
#include <Y2.h>
#include <ycp/Import.h>
@@ -39,7 +41,7 @@
%rename("!=") "operator!=";
%rename("!") "operator!";
%rename("==") "operator==";
-
+
%typemap(in) int YCPValue {
// TODO conver integers, and add support for lists, ah, and boleans!
switch (TYPE($1))
@@ -128,9 +130,89 @@
$result = Qnil;
}
+//%include "y2util/RepDef.h"
%include "y2/Y2ComponentBroker.h"
%include "y2/Y2Namespace.h"
%include "y2/Y2Component.h"
%include "y2/Y2Function.h"
+
+%ignore SymbolEntryPtr::_nameHash;
+%ignore SymbolEntry::emptyUstring;
+
+class SymbolEntry
+{
+public:
+ //static UstringHash* _nameHash;
+ //static Ustring emptyUstring;
+public:
+ typedef enum {
+ c_unspec = 0, // 0 unspecified local symbol (sets m_global = false)
+ c_global, // 1 unspecified global symbol (translates to c_unspec, sets m_global = true)
+ c_module, // 2 a module identifier
+ c_variable, // 3 a variable
+ c_reference, // 4 a reference to a variable
+ c_function, // 5 a defined function
+ c_builtin, // 6 a builtin function
+ c_typedef, // 7 a type
+ c_const, // 8 a constant (a read-only c_variable)
+ c_namespace, // 9 a namespace identifier
+ c_self, // 10 the current namespace (namespace prefix used in namespace definition)
+ c_predefined, // 11 a predefined namespace identifier
+ c_filename // 12 a filename (used in conjunction with TableEntry to store definition locations)
+ } category_t;
+public:
+ // create symbol beloging to namespace (at position)
+ SymbolEntry (const Y2Namespace* name_space, unsigned int position, const char *name, category_t cat, constTypePtr type);
+
+ virtual ~SymbolEntry ();
+
+ // symbols link to the defining namespace
+ const Y2Namespace *nameSpace () const;
+ void setNamespace (const Y2Namespace *name_space);
+ virtual bool onlyDeclared () const { return false; }
+
+ unsigned int position () const;
+ void setPosition (unsigned int position);
+
+ bool isGlobal () const;
+ void setGlobal (bool global);
+
+ bool isModule () const { return m_category == c_module; }
+ bool isVariable () const { return m_category == c_variable; }
+ bool isReference () const { return m_category == c_reference; }
+ bool isFunction () const { return m_category == c_function; }
+ bool isBuiltin () const { return m_category == c_builtin; }
+ bool isNamespace () const { return m_category == c_namespace; }
+ bool isSelf () const { return m_category == c_self; }
+ bool isFilename () const { return m_category == c_filename; }
+ bool isPredefined () const { return m_category == c_predefined; }
+
+ bool likeNamespace () const { return isModule() || isNamespace() || isSelf(); }
+
+ const char *name () const;
+ category_t category () const;
+ void setCategory (category_t cat);
+ constTypePtr type () const;
+ string catString () const;
+ void setType (constTypePtr type);
+ YCPValue setValue (YCPValue value);
+ YCPValue value () const;
+
+ void push ();
+ void pop ();
+
+ virtual string toString (bool with_type = true) const;
+};
+
+template < typename T >
+class Ptr {
+ public:
+ T *operator->();
+};
+%template (SymbolEntryPtr) Ptr<SymbolEntry>;
+
+%include "ycp/SymbolTable.h"
+
%include "ycp/Import.h"
-%include "ycp/Type.h"
\ No newline at end of file
+%include "ycp/Type.h"
+%include "ycp/TypePtr.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] r39020 - /trunk/network/package/yast2-network.changes
by mvidner@svn.opensuse.org 25 Jun '07
by mvidner@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: mvidner
Date: Mon Jun 25 18:25:29 2007
New Revision: 39020
URL: http://svn.opensuse.org/viewcvs/yast?rev=39020&view=rev
Log:
fix changelog entry order (adrian)
Modified:
trunk/network/package/yast2-network.changes
Modified: trunk/network/package/yast2-network.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/network/package/yast2-network.ch…
==============================================================================
--- trunk/network/package/yast2-network.changes (original)
+++ trunk/network/package/yast2-network.changes Mon Jun 25 18:25:29 2007
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Thu Jun 21 17:39:03 CEST 2007 - adrian(a)suse.de
+
+- fix changelog entry order
+
+-------------------------------------------------------------------
Mon Jun 18 18:08:38 CEST 2007 - mzugec(a)suse.cz
- use correct syntax "default $IP - -" for sysconfig/route
@@ -532,6 +537,7 @@
- fate #300628 - indicate when netcard is not present
- 2.14.2
+-------------------------------------------------------------------
Fri Oct 20 14:28:48 CEST 2006 - mzugec(a)suse.cz
- #176804 - root on iscsi
@@ -2057,15 +2063,15 @@
- 2.9.46
-------------------------------------------------------------------
-Wed May 19 17:40:54 CEST 2004 - mvidner(a)suse.cz
+Fri May 21 02:43:12 CEST 2004 - nashif(a)suse.de
-- Another fix of hwcfg-{hsi,qeth}-* (#40692#c15)
-- 2.9.45
+- return right device name when cloning with autoyast.
-------------------------------------------------------------------
-Fri May 21 02:43:12 CEST 2004 - nashif(a)suse.de
+Wed May 19 17:40:54 CEST 2004 - mvidner(a)suse.cz
-- return right device name when cloning with autoyast.
+- Another fix of hwcfg-{hsi,qeth}-* (#40692#c15)
+- 2.9.45
-------------------------------------------------------------------
Tue May 18 15:01:31 CEST 2004 - msvec(a)suse.cz
@@ -2559,6 +2565,11 @@
- 2.8.26
-------------------------------------------------------------------
+Thu Sep 04 11:39:02 CEST 2003 - arvin(a)suse.de
+
+- fixed encoding of logs in internet test (bug #29500)
+
+-------------------------------------------------------------------
Thu Sep 4 10:21:23 CEST 2003 - msvec(a)suse.cz
- use dhcpcd-test script for testing of DHCP (#29945)
@@ -2568,11 +2579,6 @@
- 2.8.25
-------------------------------------------------------------------
-Thu Sep 04 11:39:02 CEST 2003 - arvin(a)suse.de
-
-- fixed encoding of logs in internet test (bug #29500)
-
--------------------------------------------------------------------
Wed Sep 3 11:26:51 CEST 2003 - msvec(a)suse.de
- fixed typo (#29905)
@@ -2609,15 +2615,6 @@
- 2.8.19
-------------------------------------------------------------------
-Thu Aug 28 15:35:34 CEST 2003 - msvec(a)suse.cz
-
-- don't shut down network interface during detection (#29452)
-- don't show error messages in case detection isn't started (#29582)
-- don't make modules.conf entries for hotpluggable hardware (#29547)
-- improve DSL detection message (#29576)
-- 2.8.18
-
--------------------------------------------------------------------
Sun Aug 31 14:57:34 CEST 2003 - arvin(a)suse.de
- use Popup::ConfirmAbort
@@ -2633,6 +2630,15 @@
- CommandLine::Plain2Rich -> RichText::Plain2Rich
-------------------------------------------------------------------
+Thu Aug 28 15:35:34 CEST 2003 - msvec(a)suse.cz
+
+- don't shut down network interface during detection (#29452)
+- don't show error messages in case detection isn't started (#29582)
+- don't make modules.conf entries for hotpluggable hardware (#29547)
+- improve DSL detection message (#29576)
+- 2.8.18
+
+-------------------------------------------------------------------
Wed Aug 27 16:38:05 CEST 2003 - msvec(a)suse.cz
- confirm hardware detection in manual mode (#26515)
@@ -2667,12 +2673,6 @@
- 2.8.11
-------------------------------------------------------------------
-Fri Aug 1 12:49:15 CEST 2003 - msvec(a)suse.cz
-
-- read /root/.curlrc only if present
-- 2.8.10
-
--------------------------------------------------------------------
Mon Aug 18 17:05:14 CEST 2003 - nashif(a)suse.de
- Fixed dhcp configuration in autoinst mode
@@ -2706,6 +2706,12 @@
- fixed return value in inst_netprobe
-------------------------------------------------------------------
+Fri Aug 1 12:49:15 CEST 2003 - msvec(a)suse.cz
+
+- read /root/.curlrc only if present
+- 2.8.10
+
+-------------------------------------------------------------------
Fri Aug 1 12:49:15 CEST 2003 - msvec(a)suse.de
- drop yast2-network-instsys package
@@ -3388,6 +3394,11 @@
- 2.6.0
-------------------------------------------------------------------
+Tue Mar 26 00:45:36 CET 2002 - ro(a)suse.de
+
+- added yast2 to neededforbuild (modules/Mode.ycp)
+
+-------------------------------------------------------------------
Sat Mar 23 14:43:32 CET 2002 - kkeil(a)suse.de
- fix empty custom provider problem (#15425)
@@ -3399,11 +3410,6 @@
- don't load drivers in proposal mode (#15078)
-------------------------------------------------------------------
-Tue Mar 26 00:45:36 CET 2002 - ro(a)suse.de
-
-- added yast2 to neededforbuild (modules/Mode.ycp)
-
--------------------------------------------------------------------
Thu Mar 21 16:15:47 CET 2002 - mvidner(a)suse.cz
- Added autoloading of a network card module for DSL.
--
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] r39019 - in /branches/tmp/sh/mod-ui: core/libyui/doc/examples/ core/libyui/src/ qt/src/
by sh-sh-sh@svn.opensuse.org 25 Jun '07
by sh-sh-sh@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: sh-sh-sh
Date: Mon Jun 25 18:24:54 2007
New Revision: 39019
URL: http://svn.opensuse.org/viewcvs/yast?rev=39019&view=rev
Log:
TextEntry -> InputField
Added:
branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField-setInputMaxLength.ycp
- copied, changed from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry-setInputMaxLength.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField1.ycp
- copied, changed from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry1.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField2.ycp
- copied, changed from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry2.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField3.ycp
- copied, changed from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry3.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField4.ycp
- copied, changed from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry4.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField5.ycp
- copied, changed from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry5.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField6.ycp
- copied, changed from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry6.ycp
branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc
- copied, changed from r38907, branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.cc
branches/tmp/sh/mod-ui/core/libyui/src/YInputField.h
- copied, changed from r38993, branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h
branches/tmp/sh/mod-ui/qt/src/YQInputField.cc
- copied, changed from r39006, branches/tmp/sh/mod-ui/qt/src/YQTextEntry.cc
branches/tmp/sh/mod-ui/qt/src/YQInputField.h
- copied, changed from r38991, branches/tmp/sh/mod-ui/qt/src/YQTextEntry.h
Removed:
branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry-setInputMaxLength.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry1.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry2.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry3.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry4.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry5.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry6.ycp
branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.cc
branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h
branches/tmp/sh/mod-ui/qt/src/YQTextEntry.cc
branches/tmp/sh/mod-ui/qt/src/YQTextEntry.h
Modified:
branches/tmp/sh/mod-ui/core/libyui/doc/examples/CheckBoxFrame1.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/CheckBoxFrame2.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/CheckBoxFrame3.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/DefaultButtons1.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/DefaultButtons2.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/DefaultButtons3.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/DemoBrowser.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/DumbTab2.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/Enabling2.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/Events.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/FakeUserInput1.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/SetLanguage.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/ShortcutConflict3.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/ShortcutConflict5.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/Spacing1.ycp
branches/tmp/sh/mod-ui/core/libyui/doc/examples/UserInput.ycp
branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h
branches/tmp/sh/mod-ui/core/libyui/src/YEvent.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/Makefile.am
branches/tmp/sh/mod-ui/qt/src/YQComboBox.h
branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.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/CheckBoxFrame1.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/CheckBoxFrame1.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/CheckBoxFrame1.ycp Mon Jun 25 18:24:54 2007
@@ -6,14 +6,14 @@
`CheckBoxFrame ( "E&xpert Settings", true,
`VBox(
`HBox(
- `TextEntry( "&Server" ),
+ `InputField( "&Server" ),
`ComboBox ( "&Mode",
[ "Automatic",
"Manual",
"Debug" ] )
),
`Left( `CheckBox( "&Logging" ) ),
- `TextEntry( "&Connections" )
+ `InputField( "&Connections" )
)
)
),
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/CheckBoxFrame2.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/CheckBoxFrame2.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/CheckBoxFrame2.ycp Mon Jun 25 18:24:54 2007
@@ -7,14 +7,14 @@
`CheckBoxFrame (`opt(`invertAutoEnable), "&Automatic", true,
`VBox(
`HBox(
- `TextEntry( "&Server" ),
+ `InputField( "&Server" ),
`ComboBox ( "&Mode",
[ "Automatic",
"Manual",
"Debug" ] )
),
`Left( `CheckBox( "&Logging" ) ),
- `TextEntry( "&Connections" )
+ `InputField( "&Connections" )
)
)
),
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/CheckBoxFrame3.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/CheckBoxFrame3.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/CheckBoxFrame3.ycp Mon Jun 25 18:24:54 2007
@@ -7,14 +7,14 @@
`CheckBoxFrame (`id(`use_suse_server), `opt(`noAutoEnable, `notify), "&SuSE Server", false,
`VBox(
`HBox(
- `TextEntry(`id(`server), "&Server" ),
+ `InputField(`id(`server), "&Server" ),
`ComboBox (`id(`mode ), "&Mode",
[ "Automatic",
"Manual",
"Debug" ] )
),
`Left(`id(`logging), `CheckBox( "&Logging" ) ),
- `TextEntry(`id(`connections), "&Connections" )
+ `InputField(`id(`connections), "&Connections" )
)
)
),
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/DefaultButtons1.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/DefaultButtons1.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/DefaultButtons1.ycp Mon Jun 25 18:24:54 2007
@@ -73,7 +73,7 @@
`VBox(
`Heading( "Current workflow step:" ),
`VSpacing(0.5),
- `HSquash( `TextEntry(`id(`stepName), "Step &Name: " ) ),
+ `HSquash( `InputField(`id(`stepName), "Step &Name: " ) ),
`PushButton(`id(`doit), `opt(`default), "&Do something!" )
) );
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/DefaultButtons2.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/DefaultButtons2.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/DefaultButtons2.ycp Mon Jun 25 18:24:54 2007
@@ -73,7 +73,7 @@
`VBox(
`Heading( "Current workflow step:" ),
`VSpacing(0.5),
- `HSquash( `TextEntry(`id(`stepName), "Step &Name: " ) ),
+ `HSquash( `InputField(`id(`stepName), "Step &Name: " ) ),
`PushButton(`id(`doit), `opt(`default), "&Do something!" ),
`PushButton(`id(`doit), `opt(`default), "&Do something!" )
) );
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/DefaultButtons3.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/DefaultButtons3.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/DefaultButtons3.ycp Mon Jun 25 18:24:54 2007
@@ -73,7 +73,7 @@
`VBox(
`Heading( "Current workflow step:" ),
`VSpacing(0.5),
- `HSquash( `TextEntry(`id(`stepName), "Step &Name: " ) ),
+ `HSquash( `InputField(`id(`stepName), "Step &Name: " ) ),
`PushButton(`id(`doit), "&Do something!" )
) );
UI::SetFocus(`doit);
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/DemoBrowser.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/DemoBrowser.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/DemoBrowser.ycp Mon Jun 25 18:24:54 2007
@@ -42,7 +42,7 @@
`HSpacing( 0.5 ),
`Frame( "Search",
`VBox(
- `TextEntry( `id( `te_search ), "Search &term:" ),
+ `InputField( `id( `te_search ), "Search &term:" ),
`Left( `CheckBox( `id( `cb_search_fn ), "Search in file&names" ) ),
`Left( `CheckBox( `id( `cb_search_text ), "Search &file contents" ) ),
`Left( `CheckBox( `id( `cb_highlight ), "&Highlight match" ) ),
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/DumbTab2.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/DumbTab2.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/DumbTab2.ycp Mon Jun 25 18:24:54 2007
@@ -8,9 +8,9 @@
`HSquash(
`VBox(
`HSpacing( 50 ),
- `TextEntry( "Name" ),
- `TextEntry( "E-Mail" ),
- `TextEntry( "Phone" ),
+ `InputField( "Name" ),
+ `InputField( "E-Mail" ),
+ `InputField( "Phone" ),
`VSpacing(),
`MultiLineEdit( "Comments" ),
`VStretch()
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/Enabling2.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/Enabling2.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/Enabling2.ycp Mon Jun 25 18:24:54 2007
@@ -1,7 +1,7 @@
{
UI::OpenDialog(
`VBox(
- `TextEntry(`id(`test), `opt(`disabled), "TestEntry", "Disabled"),
+ `InputField(`id(`test), `opt(`disabled), "TestEntry", "Disabled"),
`PushButton(`id(`change), `opt(`hstretch), "&Change")
)
);
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/Events.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/Events.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/Events.ycp Mon Jun 25 18:24:54 2007
@@ -147,7 +147,7 @@
`HBox(
`Top( `ComboBox(`id(`salutation), `opt(`notify, `editable), "&To:",
[ "Mr.", "Mrs.", "Miss", "Dr.", "Don", "King", "His Royal Highness" ] ) ),
- `Top( `TextEntry(`id(`name), `opt(`notify), "&Name:" ) ),
+ `Top( `InputField(`id(`name), `opt(`notify), "&Name:" ) ),
`MultiLineEdit(`id(`address), `opt(`notify), "&Address:" ),
`VSpacing( 4 ) // Force height (don't use MultiLineEdit default height)
)
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/FakeUserInput1.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/FakeUserInput1.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/FakeUserInput1.ycp Mon Jun 25 18:24:54 2007
@@ -1,8 +1,8 @@
{
- // Build dialog with one text entry field, 4 Beatles buttons and an OK button.
+ // Build dialog with one input field field, 4 Beatles buttons and an OK button.
UI::OpenDialog(
`VBox(
- `TextEntry(`id(`name), "Name:"),
+ `InputField(`id(`name), "Name:"),
`HBox(
`PushButton(`id(`john), "&John" ),
`PushButton(`id(`paul), "&Paul" ),
Copied: branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField-setInputMaxLength.ycp (from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry-setInputMaxLength.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/TextEntry-setInputMaxLength.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField-setInputMaxLength.ycp Mon Jun 25 18:24:54 2007
@@ -2,7 +2,7 @@
UI::OpenDialog(
`VBox(
- `TextEntry( `id( `input ), "Text entry", "pizza, pasta, pronta" ),
+ `InputField( `id( `input ), "Input Field", "pizza, pasta, pronta" ),
`IntField( `id ( `field ), "Limit characters to...", -1, 100, -1 ),
`PushButton( `id ( `butt ),"limit input" ),
`PushButton( `id ( `exitButton ), "Exit" )
Copied: branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField1.ycp (from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry1.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/TextEntry1.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField1.ycp Mon Jun 25 18:24:54 2007
@@ -1,7 +1,7 @@
{
UI::OpenDialog(
`VBox(
- `TextEntry("Name:"),
+ `InputField("Name:"),
`PushButton("&OK")
)
);
Copied: branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField2.ycp (from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry2.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/TextEntry2.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField2.ycp Mon Jun 25 18:24:54 2007
@@ -1,8 +1,8 @@
{
- // Build dialog with one text entry field and an OK button.
+ // Build dialog with one input field field and an OK button.
UI::OpenDialog(
`VBox(
- `TextEntry(`id(`name), "Name:"),
+ `InputField(`id(`name), "Name:"),
`PushButton("&OK")
)
);
@@ -10,7 +10,7 @@
// Wait for user input.
UI::UserInput();
- // Get the input from the text entry field.
+ // Get the input from the input field field.
//
// Notice: The return value of UI::UserInput() does NOT return this value!
// Rather, it returns the ID of the widget (normally the PushButton)
Copied: branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField3.ycp (from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry3.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/TextEntry3.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField3.ycp Mon Jun 25 18:24:54 2007
@@ -1,22 +1,22 @@
{
- // Build dialog with one text entry field and an OK button.
+ // Build dialog with one input field field and an OK button.
UI::OpenDialog(
`VBox(
- `TextEntry(`id(`name), "You will never see this:"),
+ `InputField(`id(`name), "You will never see this:"),
`PushButton("&OK")
)
);
- // Set an initial value for the text entry field.
+ // Set an initial value for the input field field.
UI::ChangeWidget(`id(`name), `Value, "Averell Dalton");
- // Change the text entry field's label.
+ // Change the input field field's label.
UI::ChangeWidget(`id(`name), `Label, "Name:");
// Wait for user input.
UI::UserInput();
- // Get the input from the text entry field.
+ // Get the input from the input field field.
//
// Notice: The return value of UI::UserInput() does NOT return this value!
// Rather, it returns the ID of the widget (normally the PushButton)
Copied: branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField4.ycp (from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry4.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/TextEntry4.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField4.ycp Mon Jun 25 18:24:54 2007
@@ -1,8 +1,8 @@
{
- // Build dialog with one text entry field, 4 Beatles buttons and an OK button.
+ // Build dialog with one input field field, 4 Beatles buttons and an OK button.
UI::OpenDialog(
`VBox(
- `TextEntry(`id(`name), "Name:"),
+ `InputField(`id(`name), "Name:"),
`HBox(
`PushButton(`id(`john), "&John" ),
`PushButton(`id(`paul), "&Paul" ),
Copied: branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField5.ycp (from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry5.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/TextEntry5.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField5.ycp Mon Jun 25 18:24:54 2007
@@ -3,10 +3,10 @@
`VBox(
`Frame("Shrinkable Textentries",
`HBox(
- `TextEntry(`opt(`shrinkable), "1"),
- `TextEntry(`opt(`shrinkable), "2"),
- `TextEntry(`opt(`shrinkable), "3"),
- `TextEntry(`opt(`shrinkable), "4")
+ `InputField(`opt(`shrinkable), "1"),
+ `InputField(`opt(`shrinkable), "2"),
+ `InputField(`opt(`shrinkable), "3"),
+ `InputField(`opt(`shrinkable), "4")
)
),
`PushButton(`opt(`default), "&OK" )
Copied: branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField6.ycp (from r38058, branches/tmp/sh/mod-ui/core/libyui/doc/examples/TextEntry6.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/TextEntry6.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/InputField6.ycp Mon Jun 25 18:24:54 2007
@@ -1,8 +1,8 @@
{
- // Build dialog with one text entry field and an OK button.
+ // Build dialog with one input field field and an OK button.
UI::OpenDialog(
`VBox(
- `TextEntry(`id(`hex_digits), "Hex number:"),
+ `InputField(`id(`hex_digits), "Hex number:"),
`PushButton("&OK")
)
);
@@ -12,7 +12,7 @@
// Wait for user input.
UI::UserInput();
- // Get the input from the text entry field.
+ // Get the input from the input field field.
//
// Notice: The return value of UI::UserInput() does NOT return this value!
// Rather, it returns the ID of the widget (normally the PushButton)
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/SetLanguage.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/SetLanguage.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/SetLanguage.ycp Mon Jun 25 18:24:54 2007
@@ -4,7 +4,7 @@
UI::OpenDialog(
`VBox(
- `TextEntry(`id(`lang_field), "&Language:"),
+ `InputField(`id(`lang_field), "&Language:"),
`HBox(
`Label("Current language:"),
`Label(`id(`lang_label), `opt(`outputField, `hstretch), UI::GetLanguage(false))
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/ShortcutConflict3.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/ShortcutConflict3.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/ShortcutConflict3.ycp Mon Jun 25 18:24:54 2007
@@ -12,8 +12,8 @@
),
`Left( `ComboBox( "Game &Type:",
[ "Boring", "Full automatic", "Unplayable" ] ) ),
- `TextEntry( "Nickname for &Player 1:" ),
- `TextEntry( "Nickname for &Player 2:" ),
+ `InputField( "Nickname for &Player 1:" ),
+ `InputField( "Nickname for &Player 2:" ),
`IntField( "Maximum &Time:", 0, 100, 20 ),
`PushButton( "&OK" )
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/ShortcutConflict5.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/ShortcutConflict5.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/ShortcutConflict5.ycp Mon Jun 25 18:24:54 2007
@@ -14,9 +14,9 @@
term fields =
`HBox(
- `HWeight(1, `TextEntry( "&Back" ) ),
- `HWeight(1, `TextEntry( "&Abort" ) ),
- `HWeight(1, `TextEntry( "&Next" ) )
+ `HWeight(1, `InputField( "&Back" ) ),
+ `HWeight(1, `InputField( "&Abort" ) ),
+ `HWeight(1, `InputField( "&Next" ) )
);
term buttons =
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/Spacing1.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/Spacing1.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/Spacing1.ycp Mon Jun 25 18:24:54 2007
@@ -1,11 +1,11 @@
{
- // Build dialog with one text entry field, 4 Beatles buttons and an OK button.
+ // Build dialog with one input field field, 4 Beatles buttons and an OK button.
UI::OpenDialog(
`VBox(
`VSpacing(),
`HBox(
`Label("Name:"),
- `TextEntry(`id(`name), "")
+ `InputField(`id(`name), "")
),
`VSpacing(0.2),
`HBox(
Modified: branches/tmp/sh/mod-ui/core/libyui/doc/examples/UserInput.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/UserInput.ycp (original)
+++ branches/tmp/sh/mod-ui/core/libyui/doc/examples/UserInput.ycp Mon Jun 25 18:24:54 2007
@@ -13,8 +13,8 @@
UI::OpenDialog(
`VBox(
- `TextEntry(`id(`name), "&Name:", name ),
- `TextEntry(`id(`addr), "&Address:", addr ),
+ `InputField(`id(`name), "&Name:", name ),
+ `InputField(`id(`addr), "&Address:", addr ),
`HBox(
`PushButton(`id(`ok ), "&OK" ),
`PushButton(`id(`cancel ), "&Cancel" ),
@@ -57,7 +57,7 @@
y2milestone( "Help button activated" );
}
- // No other "else" branch necessary: None of the TextEntry widget has
+ // No other "else" branch necessary: None of the InputField widget has
// the `notify option set, so none of them can make UI::UserInput() return.
} until ( widget_id == `ok || widget_id == `cancel );
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 Mon Jun 25 18:24:54 2007
@@ -211,3 +211,11 @@
* virtual YWidget::setSize() now has int params, no longer long
see longer explanations on top
+
+
+2007-06-25 18:00 sh(a)suse.de
+
+* Renamed YTextEntry -> YInputField
+
+ For YCP, TextEntry is (and will remain) still a valid widget name.
+ `InputField is the new default name, though.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/Makefile.am Mon Jun 25 18:24:54 2007
@@ -41,6 +41,7 @@
YEvent.cc \
YFrame.cc \
YImage.cc \
+ YInputField.cc \
YIntField.cc \
YLabel.cc \
YLayoutBox.cc \
@@ -69,7 +70,6 @@
YSpacing.cc \
YSquash.cc \
YTable.cc \
- YTextEntry.cc \
YTime.cc \
YTree.cc \
YWizard.cc
@@ -113,6 +113,7 @@
YEvent.h \
YFrame.h \
YImage.h \
+ YInputField.h \
YIntField.h \
YLabel.h \
YLayoutBox.h \
@@ -141,7 +142,6 @@
YSpacing.h \
YSquash.h \
YTable.h \
- YTextEntry.h \
YTime.h \
YTransText.h \
YTree.h \
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 Mon Jun 25 18:24:54 2007
@@ -55,7 +55,7 @@
#include "YDumbTab.h"
#include "YBarGraph.h"
#include "YTable.h"
-#include "YTextEntry.h"
+#include "YInputField.h"
#include "YTree.h"
using std::string;
@@ -207,6 +207,7 @@
else if ( s == YUIWidget_Heading ) w = parseLabel ( p, opt, term, ol, n, true );
else if ( s == YUIWidget_IconButton ) w = parsePushButton ( p, opt, term, ol, n, true );
else if ( s == YUIWidget_Image ) w = parseImage ( p, opt, term, ol, n );
+ else if ( s == YUIWidget_InputField ) w = parseInputField ( p, opt, term, ol, n, false );
else if ( s == YUIWidget_IntField ) w = parseIntField ( p, opt, term, ol, n );
else if ( s == YUIWidget_Label ) w = parseLabel ( p, opt, term, ol, n, false );
else if ( s == YUIWidget_Left ) w = parseAlignment ( p, opt, term, ol, n, YAlignBegin, YAlignUnchanged );
@@ -219,7 +220,7 @@
else if ( s == YUIWidget_MultiLineEdit ) w = parseMultiLineEdit ( p, opt, term, ol, n );
else if ( s == YUIWidget_MultiSelectionBox ) w = parseMultiSelectionBox ( p, opt, term, ol, n );
else if ( s == YUIWidget_PackageSelector ) w = parsePackageSelector ( p, opt, term, ol, n );
- else if ( s == YUIWidget_Password ) w = parseTextEntry ( p, opt, term, ol, n, true );
+ else if ( s == YUIWidget_Password ) w = parseInputField ( p, opt, term, ol, n, true );
else if ( s == YUIWidget_PkgSpecial ) w = parsePkgSpecial ( p, opt, term, ol, n );
else if ( s == YUIWidget_ProgressBar ) w = parseProgressBar ( p, opt, term, ol, n );
else if ( s == YUIWidget_PushButton ) w = parsePushButton ( p, opt, term, ol, n, false );
@@ -230,7 +231,7 @@
else if ( s == YUIWidget_Right ) w = parseAlignment ( p, opt, term, ol, n, YAlignEnd, YAlignUnchanged );
else if ( s == YUIWidget_SelectionBox ) w = parseSelectionBox ( p, opt, term, ol, n );
else if ( s == YUIWidget_Table ) w = parseTable ( p, opt, term, ol, n );
- else if ( s == YUIWidget_TextEntry ) w = parseTextEntry ( p, opt, term, ol, n, false );
+ else if ( s == YUIWidget_TextEntry ) w = parseInputField ( p, opt, term, ol, n, false );
else if ( s == YUIWidget_Top ) w = parseAlignment ( p, opt, term, ol, n, YAlignUnchanged, YAlignBegin );
else if ( s == YUIWidget_Tree ) w = parseTree ( p, opt, term, ol, n );
else if ( s == YUIWidget_VBox ) w = parseLayoutBox ( p, opt, term, ol, n, YD_VERT );
@@ -573,7 +574,7 @@
* @arg float|integer size minimum width (for MinWidth or MinSize) or minimum heigh (for MinHeight)
* @optarg float|integer height (only for MinSize)
* @arg term child The contained child widget
- * @usage `MinWidth( 30, TextEntry(`id(`name), "Name" ) );
+ * @usage `MinWidth( 30, InputField(`id(`name), "Name" ) );
* @example MinWidth1.ycp MinHeight1.ycp MinSize1.ycp
*
* @description
@@ -746,7 +747,7 @@
* @arg string label title to be displayed on the top left edge
* @arg term child the contained child widget
* @usage `Frame( `RadioButtonGroup( `id( rb ), `VBox( ... ) ) );
- * @examples Frame1.ycp Frame2.ycp TextEntry5.ycp
+ * @examples Frame1.ycp Frame2.ycp InputField5.ycp
*
* @description
*
@@ -788,7 +789,7 @@
* @short Layout aid: Minimize widget to its nice size
* @class YSquash
* @arg term child the child widget
- * @usage HSquash( `TextEntry( "Name:" ) )
+ * @usage HSquash( `InputField( "Name:" ) )
* @example HSquash1.ycp
*
* @description
@@ -1160,8 +1161,8 @@
const YCPTerm & term, const YCPList & optList, int argnr,
bool isIconButton )
{
- std::string label;
- std::string iconName;
+ string label;
+ string iconName;
if ( isIconButton )
{
@@ -1432,7 +1433,7 @@
* `VBox(...) or `HBox(...)
* @option noAutoEnable do not enable/disable frame children upon status change
* @option invertAutoAnable disable frame children if check box is checked
- * @usage `CheckBoxFrame( `id( `custom), "&Custom", true, `VBox(`TextEntry(...), ... )
+ * @usage `CheckBoxFrame( `id( `custom), "&Custom", true, `VBox(`InputField(...), ... )
* @examples CheckBoxFrame1.ycp CheckBoxFrame2.ycp CheckBoxFrame3.ycp
*
* @description
@@ -1604,18 +1605,18 @@
/**
- * @widgets TextEntry Password
+ * @widgets InputField TextEntry Password
* @short Input field
- * @class YTextEntry
+ * @class YInputField
* @arg string label the label describing the meaning of the entry
* @optarg string defaulttext The text contained in the text entry
* @option shrinkable make the input field very small
- * @usage `TextEntry( `id( `name ), "Enter your name:", "Kilroy" )
+ * @usage `InputField( `id( `name ), "Enter your name:", "Kilroy" )
*
- * @examples TextEntry1.ycp TextEntry2.ycp TextEntry3.ycp TextEntry4.ycp
- * TextEntry5.ycp TextEntry6.ycp
+ * @examples InputField1.ycp InputField2.ycp InputField3.ycp InputField4.ycp
+ * InputField5.ycp InputField6.ycp
* Password1.ycp Password2.ycp
- * TextEntry-setInputMaxLength.ycp
+ * InputField-setInputMaxLength.ycp
*
* @description
*
@@ -1628,7 +1629,7 @@
**/
YWidget *
-YCPDialogParser::parseTextEntry( YWidget * parent, YWidgetOpt & opt,
+YCPDialogParser::parseInputField( YWidget * parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
bool passwordMode )
{
@@ -1638,28 +1639,34 @@
|| (term->size() == argnr+2 && !term->value(argnr+1)->isString()))
{
y2error( "Invalid arguments for the %s widget: %s",
- passwordMode ? "Password" : "TextEntry",
+ passwordMode ? "Password" : "InputField",
term->toString().c_str() );
return 0;
}
- std::string initialValue;
+ string label = term->value( argnr )->asString()->value();
+
+ string initialValue;
if ( term->size() >= argnr + 2 )
initialValue = term->value( argnr+1 )->asString()->value();
+ bool shrinkable = false;
+
for ( int o=0; o < optList->size(); o++ )
{
- if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_shrinkable ) opt.isShrinkable.setValue( true );
+ if ( optList->value(o)->isSymbol() && optList->value(o)->asSymbol()->symbol() == YUIOpt_shrinkable ) shrinkable = true;
else logUnknownOption( term, optList->value(o) );
}
- YTextEntry * textEntry = dynamic_cast<YTextEntry *>
- ( YUI::ui()->createTextEntry( parent, opt, term->value( argnr )->asString()->value(), passwordMode ) );
+ YInputField * inputField = YUI::widgetFactory()->createInputField( parent, label, passwordMode );
+
+ if ( ! initialValue.empty() )
+ inputField->setValue( initialValue );
- if ( textEntry && ! initialValue.empty() )
- textEntry->setValue( initialValue );
+ if ( shrinkable )
+ inputField->setShrinkable();
- return textEntry;
+ return inputField;
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.h Mon Jun 25 18:24:54 2007
@@ -188,9 +188,9 @@
const YCPTerm & term, const YCPList & optList, int argnr );
/**
- * TextEntry, Password
+ * InputField, Password
**/
- static YWidget * parseTextEntry( YWidget *parent, YWidgetOpt & opt,
+ static YWidget * parseInputField( YWidget *parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr,
bool passwordMode );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YEvent.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YEvent.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YEvent.cc Mon Jun 25 18:24:54 2007
@@ -157,7 +157,7 @@
if ( widgetClass )
{
- if ( *widgetClass == 'Y' ) // skip leading "Y" (YPushButton, YTextEntry, ...)
+ if ( *widgetClass == 'Y' ) // skip leading "Y" (YPushButton, YInputField, ...)
widgetClass++;
map->add( YCPString( "WidgetClass" ), YCPSymbol( widgetClass ) );
@@ -236,7 +236,7 @@
if ( widgetClass )
{
- if ( *widgetClass == 'Y' ) // skip leading "Y" (YPushButton, YTextEntry, ...)
+ if ( *widgetClass == 'Y' ) // skip leading "Y" (YPushButton, YInputField, ...)
widgetClass++;
map->add( YCPString( "FocusWidgetClass" ), YCPSymbol( widgetClass ) );
Copied: branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc (from r38907, branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.cc)
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc Mon Jun 25 18:24:54 2007
@@ -10,7 +10,7 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YTextEntry.cc
+ File: YInputField.cc
Author: Stefan Hundhammer <sh(a)suse.de>
@@ -25,23 +25,27 @@
#include "YUISymbols.h"
#include "YMacroRecorder.h"
-#include "YTextEntry.h"
+#include "YInputField.h"
+using std::string;
-struct YTextEntryPrivate
+
+struct YInputFieldPrivate
{
- std::string label;
+ string label;
bool passwordMode;
- std::string validChars;
+ bool shrinkable;
+ string validChars;
int inputMaxLength;
/**
* Constructor
**/
- YTextEntryPrivate( std::string label, bool passwordMode )
+ YInputFieldPrivate( string label, bool passwordMode )
: label( label )
, passwordMode( passwordMode )
+ , shrinkable( false )
, validChars( "" )
, inputMaxLength( -1 )
{}
@@ -49,9 +53,9 @@
-YTextEntry::YTextEntry( const YWidgetOpt & opt, const std::string & label, bool passwordMode )
- : YWidget( opt )
- , priv( new YTextEntryPrivate( label, passwordMode ) )
+YInputField::YInputField( YWidget * parent, const string & label, bool passwordMode )
+ : YWidget( parent )
+ , priv( new YInputFieldPrivate( label, passwordMode ) )
{
YUI_CHECK_NEW( priv );
@@ -60,55 +64,68 @@
}
-YTextEntry::~YTextEntry()
+YInputField::~YInputField()
{
// NOP
}
-std::string YTextEntry::label()
+string YInputField::label()
{
return priv->label;
}
-void YTextEntry::setLabel( const std::string & label )
+void YInputField::setLabel( const string & label )
{
priv->label = label;
}
-std::string YTextEntry::validChars()
+string YInputField::validChars()
{
return priv->validChars;
}
-void YTextEntry::setValidChars( const std::string & newValidChars )
+void YInputField::setValidChars( const string & newValidChars )
{
priv->validChars= newValidChars;
}
-bool YTextEntry::passwordMode() const
+bool YInputField::passwordMode() const
{
return priv->passwordMode;
}
-int YTextEntry::inputMaxLength() const
+bool YInputField::shrinkable() const
+{
+ return priv->shrinkable;
+}
+
+
+void YInputField::setShrinkable( bool shrinkable )
+{
+ priv->shrinkable = shrinkable;
+}
+
+
+int YInputField::inputMaxLength() const
{
return priv->inputMaxLength;
}
-void YTextEntry::setInputMaxLength( int len )
+
+void YInputField::setInputMaxLength( int len )
{
priv->inputMaxLength = len;
}
const YPropertySet &
-YTextEntry::propertySet()
+YInputField::propertySet()
{
static YPropertySet propSet;
@@ -132,7 +149,7 @@
void
-YTextEntry::setProperty( const std::string & propertyName, const YPropertyValue & val )
+YInputField::setProperty( const string & propertyName, const YPropertyValue & val )
{
propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
@@ -148,7 +165,7 @@
YPropertyValue
-YTextEntry::getProperty( const std::string & propertyName )
+YInputField::getProperty( const string & propertyName )
{
propertySet().check( propertyName ); // throws exceptions if not found
@@ -169,7 +186,7 @@
// FIXME
// FIXME
-void YTextEntry::saveUserInput( YMacroRecorder *macroRecorder )
+void YInputField::saveUserInput( YMacroRecorder *macroRecorder )
{
if ( passwordMode() )
{
Copied: branches/tmp/sh/mod-ui/core/libyui/src/YInputField.h (from r38993, branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h)
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YInputField.h Mon Jun 25 18:24:54 2007
@@ -10,23 +10,25 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YTextEntry.h
+ File: YInputField.h
Author: Stefan Hundhammer <sh(a)suse.de>
/-*/
-#ifndef YTextEntry_h
-#define YTextEntry_h
+#ifndef YInputField_h
+#define YInputField_h
#include <string>
#include "YWidget.h"
class YMacroRecorder;
-class YTextEntryPrivate;
+class YInputFieldPrivate;
+using std::string;
-class YTextEntry : public YWidget
+
+class YInputField : public YWidget
{
public:
/**
@@ -35,20 +37,20 @@
* Creates an input field with 'label' as the caption.
* If 'passwordMode' is set, the input will be not be echoed as clear text.
**/
- YTextEntry( const YWidgetOpt & opt,
- const std::string & label,
- bool passwordMode = false );
+ YInputField( YWidget * parent,
+ const string & label,
+ bool passwordMode = false );
/**
* Destructor.
**/
- virtual ~YTextEntry();
+ virtual ~YInputField();
/**
* Returns a descriptive name of this widget class for logging,
* debugging etc.
**/
- virtual const char * widgetClass() { return "YTextEntry"; }
+ virtual const char * widgetClass() { return "YInputField"; }
/**
* Get the current value (the text entered by the user or set from the
@@ -56,7 +58,7 @@
*
* Derived classes need to implement this.
**/
- virtual std::string value() = 0;
+ virtual string value() = 0;
/**
* Set the current value (the text entered by the user or set from the
@@ -64,12 +66,12 @@
*
* Derived classes need to implement this.
**/
- virtual void setValue( const std::string & text ) = 0;
+ virtual void setValue( const string & text ) = 0;
/**
* Get the label (the caption above the input field).
**/
- std::string label();
+ string label();
/**
* Set the label (the caption above the input field).
@@ -77,7 +79,7 @@
* Derived classes are free to reimplement this, but they should call this
* base class method at the end of the overloaded function.
**/
- virtual void setLabel( const std::string & label );
+ virtual void setLabel( const string & label );
/**
* Returns 'true' if this input field is in password mode, i.e. if there should
@@ -91,7 +93,7 @@
* Get the valid input characters. No input validation is performed (i.e.,
* the user can enter anything) if this is empty.
**/
- std::string validChars();
+ string validChars();
/**
* Set the valid input characters. No input validation is performed (i.e.,
@@ -100,7 +102,7 @@
* Derived classes are free to reimplement this, but they should call this
* base class method at the end of the overloaded function.
**/
- virtual void setValidChars( const std::string & validChars );
+ virtual void setValidChars( const string & validChars );
/**
* Gthe maximum input length, i.e., the maximum number of characters the
@@ -118,13 +120,26 @@
virtual void setInputMaxLength( int numberOfChars );
/**
+ * Return 'true' if this InputField should be very small.
+ **/
+ bool shrinkable() const;
+
+ /**
+ * Make this InputField very small. This will take effect only upon the
+ * next geometry management run.
+ *
+ * Derived classes can overwrite this, but should call this base class
+ * function in the new function.
+ **/
+ virtual void setShrinkable( bool shrinkable = true );
+
+ /**
* Set a property.
* Reimplemented from YWidget.
*
* This method may throw YUIPropertyExceptions.
**/
- virtual void setProperty( const std::string & propertyName,
- const YPropertyValue & val );
+ virtual void setProperty( const string & propertyName, const YPropertyValue & val );
/**
* Get a property.
@@ -132,7 +147,7 @@
*
* This method may throw YUIPropertyExceptions.
**/
- virtual YPropertyValue getProperty( const std::string & propertyName );
+ virtual YPropertyValue getProperty( const string & propertyName );
/**
* Return this class's property set.
@@ -147,21 +162,21 @@
*
* Reimplemented from YWidget.
**/
- virtual std::string shortcutString() { return label(); }
+ virtual string shortcutString() { return label(); }
/**
* Set the string of this widget that holds the keyboard shortcut.
*
* Reimplemented from YWidget.
**/
- virtual void setShortcutString( const std::string & str )
+ virtual void setShortcutString( const string & str )
{ setLabel( str ); }
/**
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
- const char *userInputProperty() { return YUIProperty_Value; }
+ const char * userInputProperty() { return YUIProperty_Value; }
private:
@@ -173,8 +188,8 @@
**/
virtual void saveUserInput( YMacroRecorder *macroRecorder );
- ImplPtr<YTextEntryPrivate> priv;
+ ImplPtr<YInputFieldPrivate> priv;
};
-#endif // YTextEntry_h
+#endif // YInputField_h
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 Mon Jun 25 18:24:54 2007
@@ -444,7 +444,6 @@
virtual YWidget *createLogView( YWidget *parent, YWidgetOpt & opt, const YCPString & label, int visibleLines, int maxLines ) = 0;
virtual YWidget *createMenuButton( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
virtual YWidget *createCheckBox( YWidget *parent, YWidgetOpt & opt, const YCPString & label, bool checked ) = 0;
- virtual YWidget *createTextEntry( YWidget *parent, YWidgetOpt & opt, const string & label, bool passwordMode ) = 0;
virtual YWidget *createMultiLineEdit( YWidget *parent, YWidgetOpt & opt, const YCPString & label, const YCPString & text ) = 0;
virtual YWidget *createSelectionBox( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
virtual YWidget *createMultiSelectionBox( YWidget *parent, YWidgetOpt & opt, const YCPString & label ) = 0;
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUISymbols.h Mon Jun 25 18:24:54 2007
@@ -91,6 +91,7 @@
#define YUIWidget_HWeight "HWeight"
#define YUIWidget_Heading "Heading"
#define YUIWidget_IconButton "IconButton"
+#define YUIWidget_InputField "InputField"
#define YUIWidget_Image "Image"
#define YUIWidget_IntField "IntField"
#define YUIWidget_Label "Label"
@@ -114,7 +115,7 @@
#define YUIWidget_Right "Right"
#define YUIWidget_SelectionBox "SelectionBox"
#define YUIWidget_Table "Table"
-#define YUIWidget_TextEntry "TextEntry"
+#define YUIWidget_TextEntry "TextEntry" // for backwards compatibility
#define YUIWidget_Top "Top"
#define YUIWidget_Tree "Tree"
#define YUIWidget_VBox "VBox"
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 Mon Jun 25 18:24:54 2007
@@ -838,7 +838,7 @@
* the widget to change, <tt>property</tt> specifies the property that should
* be changed, <tt>newvalue</tt> gives the new value.
*
- * For example in order to change the label of a TextEntry with id `name to
+ * For example in order to change the label of an InputField with id `name to
* "anything", you write <tt>ChangeWidget( `id(`name), `Label, "anything" )</tt>.
* @param symbol widgetId Can also be specified as `id( any widgetId )
* @param symbol property
@@ -955,7 +955,7 @@
* @short Queries Widget contents
* @description
* Queries a property of a widget of the topmost dialog. For example in order
- * to query the current text of a TextEntry with id `name, you write
+ * to query the current text of an InputField with id `name, you write
* <tt>QueryWidget( `id(`name), `Value )</tt>. In some cases the propery can be given
* as term in order to further specify it. An example is
* <tt>QueryWidget( `id( `table ), `Item( 17 ) )</tt> for a table where you query a
@@ -1166,7 +1166,7 @@
* @description
* Sets the keyboard focus to the specified widget. Notice that not all
* widgets can accept the keyboard focus; this is limited to interactive
- * widgets like PushButtton, TextEntry, SelectionBox etc. - manager widgets
+ * widgets like PushButtton, InputField, SelectionBox etc. - manager widgets
* like VBox, HBox etc. will not accept the keyboard focus. They will not
* propagate the keyboard focus to some child widget that accepts the
* focus. Instead, an error message will be emitted into the log file.
@@ -1742,7 +1742,7 @@
* @description
* This function returns a list of maps describing the content of all input widgets
* in the current dialog (or in the widget with the specified ID, if any is
- * given), such as TextEntry, ComboBox, SelectionBox, ... widgets (but not
+ * given), such as InputField, ComboBox, SelectionBox, ... widgets (but not
* Labels, RichText, etc., that don't accept user input).
*
* This function returns a list with a map for each input widget:
@@ -1752,7 +1752,7 @@
* "Value" : (current value of this widget, depending on "Property")
* "Property" : (what property this is, `Value, `CurrentItem or whatever)
*
- * "WidgetClass" : (one of "TextEntry", "ComboBox", "SelectionBox", ...)
+ * "WidgetClass" : (one of "InputField", "ComboBox", "SelectionBox", ...)
* "DebugLabel : ((translated) label of this widget, possibly shortened: "Name", ...)
* ]
*
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc Mon Jun 25 18:24:54 2007
@@ -659,7 +659,7 @@
if ( widgetClass )
{
- if ( *widgetClass == 'Y' ) // skip leading "Y" (YPushButton, YTextEntry, ...)
+ if ( *widgetClass == 'Y' ) // skip leading "Y" (YPushButton, YInputField, ...)
widgetClass++;
map->add( YCPString( "WidgetClass" ), YCPSymbol( widgetClass ) );
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h Mon Jun 25 18:24:54 2007
@@ -517,7 +517,7 @@
/**
* The name of the widget property that will return user input, if there is
- * any. Widgets that do have user input (such as TextEntry, ComboBox,
+ * any. Widgets that do have user input (such as InputField, ComboBox,
* SelBox) should overwrite this methods. Widgets that are purely passive
* (such as Label, RichText) should not.
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.cc Mon Jun 25 18:24:54 2007
@@ -219,5 +219,10 @@
}
-
-
+YInputField *
+YWidgetFactory::createPasswordField( YWidget * parent, const string & label )
+{
+ return createInputField( parent,
+ label,
+ true ); // passwordMode
+}
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 Mon Jun 25 18:24:54 2007
@@ -91,7 +91,7 @@
virtual YPushButton * createPushButton ( YWidget * parent, const string & label ) = 0;
virtual YLabel * createLabel ( YWidget * parent, const string & text, bool isHeading = false, bool isOutputField = false ) = 0;
YLabel * createHeading ( YWidget * parent, const string & label );
- virtual YInputField * createInputField ( YWidget * parent, const string & label ) = 0;
+ virtual YInputField * createInputField ( YWidget * parent, const string & label, bool passwordMode = false ) = 0;
virtual YCheckBox * createCheckBox ( YWidget * parent, const string & label, bool isChecked = false ) = 0;
virtual YRadioButton * createRadioButton ( YWidget * parent, const string & label, bool isChecked = false ) = 0;
virtual YComboBox * createComboBox ( YWidget * parent, const string & label, bool editable = false ) = 0;
@@ -108,7 +108,7 @@
YPushButton * createIconButton ( YWidget * parent, const string & iconName, const string & fallbackTextLabel );
YLabel * createOutputField ( YWidget * parent, const string & label );
virtual YIntField * createIntField ( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal ) = 0;
- virtual YInputField * createPasswordField ( YWidget * parent, const string & label ) = 0;
+ YInputField * createPasswordField ( YWidget * parent, const string & label );
virtual YMenuButton * createMenuButton ( YWidget * parent, const string & label ) = 0;
virtual YMultiLineEdit * createMultiLineEdit ( YWidget * parent, const string & label ) = 0;
Modified: branches/tmp/sh/mod-ui/qt/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/Makefile…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/Makefile.am (original)
+++ branches/tmp/sh/mod-ui/qt/src/Makefile.am Mon Jun 25 18:24:54 2007
@@ -75,6 +75,7 @@
YQFrame.cc \
YQGenericButton.cc \
YQImage.cc \
+ YQInputField.cc \
YQIntField.cc \
YQLabel.cc \
YQLayoutBox.cc \
@@ -95,7 +96,6 @@
YQSpacing.cc \
YQSquash.cc \
YQTable.cc \
- YQTextEntry.cc \
YQTime.cc \
YQTree.cc \
YQWizard.cc \
@@ -141,6 +141,7 @@
YQFrame.moc \
YQGenericButton.moc \
YQImage.moc \
+ YQInputField.moc \
YQIntField.moc \
YQLabel.moc \
YQLayoutBox.moc \
@@ -161,7 +162,6 @@
YQSpacing.moc \
YQSquash.moc \
YQTable.moc \
- YQTextEntry.moc \
YQTree.moc \
YQWizard.moc \
YQWizardButton.moc \
@@ -194,6 +194,7 @@
YQFrame.o YQFrame.lo: YQFrame.moc
YQGenericButton.o YQGenericButton.lo: YQGenericButton.moc
YQImage.o YQImage.lo: YQImage.moc
+YQInputField.o YQInputField.lo: YQInputField.moc
YQIntField.o YQIntField.lo: YQIntField.moc
YQLabel.o YQLabel.lo: YQLabel.moc
YQLayoutBox.o YQLayoutBox.lo: YQLayoutBox.moc
@@ -214,7 +215,6 @@
YQSpacing.o YQSpacing.lo: YQSpacing.moc
YQSquash.o YQSquash.lo: YQSquash.moc
YQTable.o YQTable.lo: YQTable.moc
-YQTextEntry.o YQTextEntry.lo: YQTextEntry.moc
YQTime.o YQTime.lo: YQTime.moc
YQTree.o YQTree.lo: YQTree.moc
YQWizard.o YQWizard.lo: YQWizard.moc
@@ -245,6 +245,7 @@
YQFrame.moc: YQFrame.h
YQGenericButton.moc: YQGenericButton.h
YQImage.moc: YQImage.h
+YQInputField.moc: YQInputField.h
YQIntField.moc: YQIntField.h
YQLabel.moc: YQLabel.h
YQLayoutBox.moc: YQLayoutBox.h
@@ -265,7 +266,6 @@
YQSpacing.moc: YQSpacing.h
YQSquash.moc: YQSquash.h
YQTable.moc: YQTable.h
-YQTextEntry.moc: YQTextEntry.h
YQTree.moc: YQTree.h
YQWizard.moc: YQWizard.h
YQWizardButton.moc: YQWizardButton.h
Modified: branches/tmp/sh/mod-ui/qt/src/YQComboBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQComboB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQComboBox.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQComboBox.h Mon Jun 25 18:24:54 2007
@@ -134,7 +134,7 @@
/**
* Specify the amount of characters which can be inserted.
*
- * Reimplemented from @ref YTextEntry.
+ * Reimplemented from YComboBox.
**/
void setInputMaxLength( const YCPInteger & numberOfChars );
Copied: branches/tmp/sh/mod-ui/qt/src/YQInputField.cc (from r39006, branches/tmp/sh/mod-ui/qt/src/YQTextEntry.cc)
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQInputF…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQTextEntry.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQInputField.cc Mon Jun 25 18:24:54 2007
@@ -10,7 +10,7 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YQTextEntry.cc
+ File: YQInputField.cc
Author: Stefan Hundhammer <sh(a)suse.de>
@@ -30,7 +30,7 @@
#include "YQUI.h"
#include "YEvent.h"
#include "QY2CharValidator.h"
-#include "YQTextEntry.h"
+#include "YQInputField.h"
#include "YQi18n.h"
// Include low-level X headers AFTER Qt headers:
@@ -40,13 +40,15 @@
#include <X11/Xlib.h> // CapsLock detection
#include <X11/keysym.h> // CapsLock detection
+using std::string;
-YQTextEntry::YQTextEntry( QWidget * parent,
- const YWidgetOpt & opt,
- const std::string & label,
- bool passwordMode )
- : QVBox( parent )
- , YTextEntry( opt, label, passwordMode )
+
+
+YQInputField::YQInputField( YWidget * parent,
+ const string & label,
+ bool passwordMode )
+ : QVBox( (QWidget *) parent->widgetRep() )
+ , YInputField( parent, label, passwordMode )
, _validator(0)
, _displayingCapsLockWarning( false )
{
@@ -67,8 +69,6 @@
_qt_label->setBuddy( _qt_lineEdit );
- _shrinkable = opt.isShrinkable.value();
-
connect( _qt_lineEdit, SIGNAL( textChanged( const QString & ) ),
this, SLOT ( changed ( const QString & ) ) );
@@ -85,13 +85,13 @@
}
-std::string YQTextEntry::value()
+string YQInputField::value()
{
return toUTF8( _qt_lineEdit->text() );
}
-void YQTextEntry::setValue( const std::string & newText )
+void YQInputField::setValue( const string & newText )
{
QString text = fromUTF8( newText );
@@ -109,16 +109,16 @@
}
-void YQTextEntry::setEnabled( bool enabled )
+void YQInputField::setEnabled( bool enabled )
{
_qt_lineEdit->setEnabled( enabled );
YWidget::setEnabled( enabled );
}
-int YQTextEntry::preferredWidth()
+int YQInputField::preferredWidth()
{
- int minSize = _shrinkable ? 15 : 200;
+ int minSize = shrinkable() ? 15 : 200;
int hintWidth = sizeHint().width();
if ( _qt_label->text().isEmpty() )
@@ -128,26 +128,26 @@
}
-int YQTextEntry::preferredHeight()
+int YQInputField::preferredHeight()
{
return sizeHint().height();
}
-void YQTextEntry::setSize( int newWidth, int newHeight )
+void YQInputField::setSize( int newWidth, int newHeight )
{
resize( newWidth, newHeight );
}
-void YQTextEntry::setLabel( const std::string & label )
+void YQInputField::setLabel( const string & label )
{
_qt_label->setText( fromUTF8(label ) );
- YTextEntry::setLabel( label );
+ YInputField::setLabel( label );
}
-bool YQTextEntry::isValidText( const QString & txt ) const
+bool YQInputField::isValidText( const QString & txt ) const
{
if ( ! _validator )
return true;
@@ -159,7 +159,7 @@
}
-void YQTextEntry::setValidChars( const std::string & newValidChars )
+void YQInputField::setValidChars( const string & newValidChars )
{
if ( _validator )
{
@@ -183,16 +183,16 @@
_qt_lineEdit->setText( "" );
}
- YTextEntry::setValidChars( newValidChars );
+ YInputField::setValidChars( newValidChars );
}
-void YQTextEntry::setInputMaxLength( int len )
+void YQInputField::setInputMaxLength( int len )
{
_qt_lineEdit->setMaxLength( len );
- YTextEntry::setInputMaxLength( len );
+ YInputField::setInputMaxLength( len );
}
-bool YQTextEntry::setKeyboardFocus()
+bool YQInputField::setKeyboardFocus()
{
_qt_lineEdit->setFocus();
_qt_lineEdit->selectAll();
@@ -201,14 +201,14 @@
}
-void YQTextEntry::changed( const QString & )
+void YQInputField::changed( const QString & )
{
if ( getNotify() )
YQUI::ui()->sendEvent( new YWidgetEvent( this, YEvent::ValueChanged ) );
}
-void YQTextEntry::displayCapsLockWarning()
+void YQInputField::displayCapsLockWarning()
{
y2milestone( "warning" );
if ( _displayingCapsLockWarning )
@@ -233,7 +233,7 @@
}
-void YQTextEntry::clearCapsLockWarning()
+void YQInputField::clearCapsLockWarning()
{
y2milestone( "warning off " );
if ( ! _displayingCapsLockWarning )
@@ -321,4 +321,4 @@
}
-#include "YQTextEntry.moc"
+#include "YQInputField.moc"
Copied: branches/tmp/sh/mod-ui/qt/src/YQInputField.h (from r38991, branches/tmp/sh/mod-ui/qt/src/YQTextEntry.h)
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQInputF…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQInputField.h Mon Jun 25 18:24:54 2007
@@ -10,21 +10,21 @@
| (C) SuSE GmbH |
\----------------------------------------------------------------------/
- File: YQTextEntry.h
+ File: YQInputField.h
Author: Stefan Hundhammer <sh(a)suse.de>
/-*/
-#ifndef YQTextEntry_h
-#define YQTextEntry_h
+#ifndef YQInputField_h
+#define YQInputField_h
#include <qvbox.h>
#include <qlineedit.h>
#include <ycp/YCPString.h>
-#include "YTextEntry.h"
+#include "YInputField.h"
class QString;
@@ -33,8 +33,10 @@
class QY2CharValidator;
class YQRawLineEdit;
+using std::string;
-class YQTextEntry : public QVBox, public YTextEntry
+
+class YQInputField : public QVBox, public YInputField
{
Q_OBJECT
@@ -42,46 +44,45 @@
/**
* Constructor.
**/
- YQTextEntry( QWidget * parent,
- const YWidgetOpt & opt,
- const std::string & label,
- bool passwordMode = false );
+ YQInputField( YWidget * parent,
+ const string & label,
+ bool passwordMode = false );
/**
* Get the current value (the text entered by the user or set from the
* outside) of this input field.
*
- * Reimplemented from YTextEntry.
+ * Reimplemented from YInputField.
**/
- virtual std::string value();
+ virtual string value();
/**
* Set the current value (the text entered by the user or set from the
* outside) of this input field.
*
- * Reimplemented from YTextEntry.
+ * Reimplemented from YInputField.
**/
- virtual void setValue( const std::string & text );
+ virtual void setValue( const string & text );
/**
* Set the label (the caption above the input field).
*
- * Reimplemented from YTextEntry.
+ * Reimplemented from YInputField.
**/
- void setLabel( const std::string & label );
+ void setLabel( const string & label );
/**
* Set the valid input characters. No input validation is performed (i.e.,
* the user can enter anything) if this is empty.
*
- * Reimplemented from YTextEntry.
+ * Reimplemented from YInputField.
**/
- void setValidChars( const std::string & validChars );
+ void setValidChars( const string & validChars );
/**
* Specify the amount of characters which can be inserted.
*
- * Reimplemented from @ref YTextEntry.
+ * Reimplemented from @ref YInputField.
**/
void setInputMaxLength( int numberOfChars );
@@ -126,7 +127,7 @@
protected slots:
/**
- * Triggered when the text in the TextEntry changes.
+ * Triggered when the text in the InputField changes.
* This _may_ be of interest to the module.
**/
void changed( const QString & );
@@ -206,4 +207,4 @@
bool _capsLockActive;
};
-#endif // YQTextEntry_h
+#endif // YQInputField_h
Modified: branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQMultiL…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQMultiLineEdit.h Mon Jun 25 18:24:54 2007
@@ -100,7 +100,7 @@
/**
* Specify the amount of characters which can be inserted.
*
- * Reimplemented from @ref YTextEntry.
+ * Reimplemented from YMulitLineEdit.
**/
void setInputMaxLength( const YCPInteger & numberOfChars );
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 Mon Jun 25 18:24:54 2007
@@ -461,7 +461,6 @@
YWidget * createSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createMultiSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createTable ( YWidget * parent, YWidgetOpt & opt, vector<string> header);
- YWidget * createTextEntry ( YWidget * parent, YWidgetOpt & opt, const std::string & label, bool passwordMode );
YWidget * createTree ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createPkgSpecial ( YWidget * parent, YWidgetOpt & opt, const YCPString & subwidget );
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 Mon Jun 25 18:24:54 2007
@@ -47,7 +47,7 @@
#include "YQSpacing.h"
#include "YQSquash.h"
#include "YQTable.h"
-#include "YQTextEntry.h"
+#include "YQInputField.h"
#include "YQTime.h"
#include "YQTree.h"
#include "YQWizard.h"
@@ -170,18 +170,10 @@
}
-YWidget * YQUI::createTextEntry ( YWidget * parent,
- YWidgetOpt & opt,
- const std::string & label,
- bool passwordMode )
-{
- return new YQTextEntry( (QWidget *) ( parent->widgetRep() ), opt, label, passwordMode );
-}
-
-YWidget * YQUI::createMultiLineEdit ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & label,
- const YCPString & initialText )
+YWidget * YQUI::createMultiLineEdit( YWidget * parent,
+ YWidgetOpt & opt,
+ const YCPString & label,
+ const YCPString & initialText )
{
return new YQMultiLineEdit( (QWidget *) ( parent->widgetRep() ), opt, label, initialText);
}
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 Mon Jun 25 18:24:54 2007
@@ -106,9 +106,12 @@
YQInputField *
-YQWidgetFactory::createInputField( YWidget * parent, const string & label )
+YQWidgetFactory::createInputField( YWidget * parent, const string & label, bool passwordMode )
{
- return 0; // FIXME: TO DO
+ YQInputField * inputField = new YQInputField( parent, label, passwordMode );
+ YUI_CHECK_NEW( inputField );
+
+ return inputField;
}
@@ -200,14 +203,6 @@
-YQInputField *
-YQWidgetFactory::createPasswordField( YWidget * parent, const string & label )
-{
- return 0; // FIXME: TO DO
-}
-
-
-
YQMenuButton *
YQWidgetFactory::createMenuButton( YWidget * parent, const string & label )
{
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 Mon Jun 25 18:24:54 2007
@@ -30,6 +30,7 @@
#include "YQEmpty.h"
#include "YQFrame.h"
#include "YQImage.h"
+#include "YQInputField.h"
#include "YQIntField.h"
#include "YQLabel.h"
#include "YQLayoutBox.h"
@@ -47,16 +48,9 @@
#include "YQSpacing.h"
#include "YQSquash.h"
#include "YQTable.h"
+#include "YQTime.h"
#include "YQTree.h"
-#if 0
-#include "YQInputField.h"
-#include "YQTimeField.h"
-#else
-#define YQInputField YInputField
-#define YQTimeField YTimeField
-#endif
-
using std::string;
@@ -90,7 +84,7 @@
virtual YQPushButton * createPushButton ( YWidget * parent, const string & label );
virtual YQLabel * createLabel ( YWidget * parent, const string & text, bool isHeading = false, bool isOutputField = false );
- virtual YQInputField * createInputField ( YWidget * parent, const string & label );
+ virtual YQInputField * createInputField ( YWidget * parent, const string & label, bool passwordMode = false );
virtual YQCheckBox * createCheckBox ( YWidget * parent, const string & label, bool isChecked = false );
virtual YQRadioButton * createRadioButton ( YWidget * parent, const string & label, bool isChecked = false );
virtual YQComboBox * createComboBox ( YWidget * parent, const string & label, bool editable = false );
@@ -105,8 +99,6 @@
//
virtual YQIntField * createIntField ( YWidget * parent, const string & label, int minVal, int maxVal, int initialVal );
- virtual YQInputField * createPasswordField ( YWidget * parent, const string & label );
-
virtual YQMenuButton * createMenuButton ( YWidget * parent, const string & label );
virtual YQMultiLineEdit * createMultiLineEdit ( YWidget * parent, const string & label );
virtual YQImage * createImage ( YWidget * parent, const string & imagePath );
@@ -114,7 +106,7 @@
virtual YQSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label );
virtual YQPackageSelector * createPackageSelector ( YWidget * parent );
- virtual YPkgSpecial * createPkgSpecial ( YWidget * parent ); // NCurses only
+ virtual YPkgSpecial * createPkgSpecial ( YWidget * parent ); // NCurses only, will throw exception in the Qt UI
//
// Layout Helpers
--
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] r39018 - in /trunk/live-installer: ./ agents/ doc/ doc/autodocs/ package/ src/ src/control/ testsuite/ testsuite/tests/
by jsrain@svn.opensuse.org 25 Jun '07
by jsrain@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: jsrain
Date: Mon Jun 25 18:22:25 2007
New Revision: 39018
URL: http://svn.opensuse.org/viewcvs/yast?rev=39018&view=rev
Log:
backup to SVN, not yet working version
Added:
trunk/live-installer/
trunk/live-installer/.cvsignore
trunk/live-installer/MAINTAINER
trunk/live-installer/Makefile.cvs
trunk/live-installer/RPMNAME
trunk/live-installer/VERSION
trunk/live-installer/agents/
trunk/live-installer/agents/.cvsignore
trunk/live-installer/agents/Makefile.am
trunk/live-installer/configure.in.in
trunk/live-installer/doc/
trunk/live-installer/doc/.cvsignore
trunk/live-installer/doc/Makefile.am
trunk/live-installer/doc/autodocs/
trunk/live-installer/doc/autodocs/.cvsignore
trunk/live-installer/doc/autodocs/Makefile.am
trunk/live-installer/package/
trunk/live-installer/package/.cvsignore
trunk/live-installer/package/yast2-live-installer.changes
trunk/live-installer/src/
trunk/live-installer/src/.cvsignore
trunk/live-installer/src/LiveInstaller.ycp
trunk/live-installer/src/Makefile.am
trunk/live-installer/src/complex.ycp
trunk/live-installer/src/control/
trunk/live-installer/src/control/live-install.xml
trunk/live-installer/src/dialogs.ycp
trunk/live-installer/src/helps.ycp
trunk/live-installer/src/live-installer.desktop
trunk/live-installer/src/live-installer.ycp
trunk/live-installer/src/live_doit.ycp
trunk/live-installer/src/wizards.ycp
trunk/live-installer/testsuite/
trunk/live-installer/testsuite/.cvsignore
trunk/live-installer/testsuite/Makefile.am
trunk/live-installer/testsuite/tests/
trunk/live-installer/testsuite/tests/.cvsignore
trunk/live-installer/testsuite/tests/LiveInstaller.err
trunk/live-installer/testsuite/tests/LiveInstaller.out
trunk/live-installer/testsuite/tests/LiveInstaller.ycp
trunk/live-installer/yast2-live-installer.spec.in
Added: trunk/live-installer/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/.cvsignore?rev=39…
==============================================================================
--- trunk/live-installer/.cvsignore (added)
+++ trunk/live-installer/.cvsignore Mon Jun 25 18:22:25 2007
@@ -0,0 +1,20 @@
+Makefile
+Makefile.am
+Makefile.am.common
+Makefile.in
+aclocal.m4
+config.cache
+config.guess
+config.h.in
+config.log
+config.status
+config.sub
+configure
+configure.in
+depcomp
+install-sh
+missing
+mkinstalldirs
+stamp-h
+live-installer.pot
+autom4te.cache
Added: trunk/live-installer/MAINTAINER
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/MAINTAINER?rev=39…
==============================================================================
--- trunk/live-installer/MAINTAINER (added)
+++ trunk/live-installer/MAINTAINER Mon Jun 25 18:22:25 2007
@@ -0,0 +1 @@
+Jiri Srain <jsrain(a)suse.cz>
Added: trunk/live-installer/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/Makefile.cvs?rev=…
==============================================================================
--- trunk/live-installer/Makefile.cvs (added)
+++ trunk/live-installer/Makefile.cvs Mon Jun 25 18:22:25 2007
@@ -0,0 +1,18 @@
+#
+# Makefile.cvs
+#
+configure: all
+ ./configure
+
+all:
+ y2tool y2autoconf
+ y2tool y2automake
+ autoreconf --force --install
+
+install: configure
+ make
+ make install
+
+reconf: all
+ ./config.status --recheck
+ ./config.status
Added: trunk/live-installer/RPMNAME
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/RPMNAME?rev=39018…
==============================================================================
--- trunk/live-installer/RPMNAME (added)
+++ trunk/live-installer/RPMNAME Mon Jun 25 18:22:25 2007
@@ -0,0 +1 @@
+yast2-live-installer
Added: trunk/live-installer/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/VERSION?rev=39018…
==============================================================================
--- trunk/live-installer/VERSION (added)
+++ trunk/live-installer/VERSION Mon Jun 25 18:22:25 2007
@@ -0,0 +1 @@
+2.13.0
Added: trunk/live-installer/agents/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/agents/.cvsignore…
==============================================================================
--- trunk/live-installer/agents/.cvsignore (added)
+++ trunk/live-installer/agents/.cvsignore Mon Jun 25 18:22:25 2007
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/live-installer/agents/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/agents/Makefile.a…
==============================================================================
--- trunk/live-installer/agents/Makefile.am (added)
+++ trunk/live-installer/agents/Makefile.am Mon Jun 25 18:22:25 2007
@@ -0,0 +1,7 @@
+# Makefile.am for live-installer/agents
+
+agent_SCRIPTS =
+
+scrconf_DATA =
+
+EXTRA_DIST = $(agent_SCRIPTS) $(scrconf_DATA)
Added: 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 (added)
+++ trunk/live-installer/configure.in.in Mon Jun 25 18:22:25 2007
@@ -0,0 +1,12 @@
+## YCP module configure.in.in
+
+## Initialize
+@YAST2-INIT-COMMON@
+@YAST2-INIT-YCP@
+
+## some common checks
+@YAST2-CHECKS-COMMON@
+@YAST2-CHECKS-YCP@
+
+## and generate the output...
+@YAST2-OUTPUT@
Added: trunk/live-installer/doc/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/doc/.cvsignore?re…
==============================================================================
--- trunk/live-installer/doc/.cvsignore (added)
+++ trunk/live-installer/doc/.cvsignore Mon Jun 25 18:22:25 2007
@@ -0,0 +1,2 @@
+Makefile
+Makefile.in
Added: trunk/live-installer/doc/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/doc/Makefile.am?r…
==============================================================================
--- trunk/live-installer/doc/Makefile.am (added)
+++ trunk/live-installer/doc/Makefile.am Mon Jun 25 18:22:25 2007
@@ -0,0 +1,10 @@
+# Makefile.am for live-installer/doc
+
+SUBDIRS = autodocs
+
+htmldir = $(docdir)
+
+doc_DATA =
+html_DATA =
+
+EXTRA_DIST = $(doc_DATA) $(html_DATA)
Added: trunk/live-installer/doc/autodocs/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/doc/autodocs/.cvs…
==============================================================================
--- trunk/live-installer/doc/autodocs/.cvsignore (added)
+++ trunk/live-installer/doc/autodocs/.cvsignore Mon Jun 25 18:22:25 2007
@@ -0,0 +1,3 @@
+Makefile
+Makefile.in
+*.html
Added: trunk/live-installer/doc/autodocs/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/doc/autodocs/Make…
==============================================================================
--- trunk/live-installer/doc/autodocs/Makefile.am (added)
+++ trunk/live-installer/doc/autodocs/Makefile.am Mon Jun 25 18:22:25 2007
@@ -0,0 +1,3 @@
+# Makefile.am for live-installer/doc/autodocs
+
+include $(top_srcdir)/autodocs-ycp.ami
Added: trunk/live-installer/package/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/package/.cvsignor…
==============================================================================
--- trunk/live-installer/package/.cvsignore (added)
+++ trunk/live-installer/package/.cvsignore Mon Jun 25 18:22:25 2007
@@ -0,0 +1,2 @@
+*.spec
+*.bz2
Added: trunk/live-installer/package/yast2-live-installer.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/package/yast2-liv…
==============================================================================
--- trunk/live-installer/package/yast2-live-installer.changes (added)
+++ trunk/live-installer/package/yast2-live-installer.changes Mon Jun 25 18:22:25 2007
@@ -0,0 +1,4 @@
+-------------------------------------------------------------------
+Mon Jun 25 09:14:19 2007 - jsrain(a)suse.cz
+
+- initial version
Added: trunk/live-installer/src/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/.cvsignore?re…
==============================================================================
--- trunk/live-installer/src/.cvsignore (added)
+++ trunk/live-installer/src/.cvsignore Mon Jun 25 18:22:25 2007
@@ -0,0 +1,4 @@
+Makefile
+Makefile.in
+*.ybc
+.dep
Added: trunk/live-installer/src/LiveInstaller.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/LiveInstaller…
==============================================================================
--- trunk/live-installer/src/LiveInstaller.ycp (added)
+++ trunk/live-installer/src/LiveInstaller.ycp Mon Jun 25 18:22:25 2007
@@ -0,0 +1,49 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: modules/LiveInstaller.ycp
+ * Package: Configuration of live-installer
+ * Summary: LiveInstaller settings, input and output functions
+ * Authors: Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: LiveInstaller.ycp 37292 2007-04-03 16:38:49Z mvidner $
+ *
+ * Representation of the configuration of live-installer.
+ * Input and output routines.
+ */
+
+{
+
+module "LiveInstaller";
+textdomain "live-installer";
+
+import "ProductControl";
+
+
+global string live_control_file =
+ "/etc/YaST2/live-install.xml";
+
+global void LiveInstaller()
+{
+}
+
+/* EOF */
+}
Added: 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 (added)
+++ trunk/live-installer/src/Makefile.am Mon Jun 25 18:22:25 2007
@@ -0,0 +1,31 @@
+# Makefile.am for live-installer/src
+
+yncludedir = @yncludedir@/live-installer
+
+client_DATA = \
+ live-installer.ycp \
+ live_doit.ycp \
+ live_finish.ycp \
+ live_stage_normal.ycp \
+ live_stage_initial.ycp
+
+ynclude_DATA = \
+ helps.ycp \
+ wizards.ycp \
+ dialogs.ycp \
+ complex.ycp
+
+desktop_DATA = \
+ live-installer.desktop
+
+module_DATA = \
+ LiveInstaller.ycp
+
+# create a symlink for local build, #145327
+live-installer:
+ ln -sf . $@
+ycpchook = live-installer
+
+EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+
+include $(top_srcdir)/Makefile.am.common
Added: trunk/live-installer/src/complex.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/complex.ycp?r…
==============================================================================
--- trunk/live-installer/src/complex.ycp (added)
+++ trunk/live-installer/src/complex.ycp Mon Jun 25 18:22:25 2007
@@ -0,0 +1,205 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/live-installer/complex.ycp
+ * Package: Configuration of live-installer
+ * Summary: Dialogs definitions
+ * Authors: Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: complex.ycp 29363 2006-03-24 08:20:43Z mzugec $
+ */
+
+{
+
+textdomain "live-installer";
+
+import "Label";
+import "Popup";
+import "Wizard";
+import "Wizard_hw";
+import "Confirm";
+import "LiveInstaller";
+
+
+include "live-installer/helps.ycp";
+
+/**
+ * Return a modification status
+ * @return true if data was modified
+ */
+boolean Modified() {
+ return LiveInstaller::Modified();
+}
+
+boolean ReallyAbort() {
+ return !LiveInstaller::Modified() || Popup::ReallyAbort(true);
+}
+
+boolean PollAbort() {
+ return UI::PollInput() == `abort;
+}
+
+/**
+ * Read settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol ReadDialog() {
+ Wizard::RestoreHelp(HELPS["read"]:"");
+ // LiveInstaller::AbortFunction = PollAbort;
+ if (!Confirm::MustBeRoot()) return `abort;
+ boolean ret = LiveInstaller::Read();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Write settings dialog
+ * @return `abort if aborted and `next otherwise
+ */
+symbol WriteDialog() {
+ Wizard::RestoreHelp(HELPS["write"]:"");
+ // LiveInstaller::AbortFunction = PollAbort;
+ boolean ret = LiveInstaller::Write();
+ return ret ? `next : `abort;
+}
+
+/**
+ * Summary dialog
+ * @return dialog result
+ */
+any SummaryDialog() {
+
+ /* LiveInstaller summary dialog caption */
+ string caption = _("LiveInstaller Configuration");
+
+ /* FIXME */
+ list summary = LiveInstaller::Summary();
+ list unconfigured = summary[1]:[];
+ string configured = summary[0]:"";
+
+ /* Frame label */
+ term contents = Wizard_hw::DetectedContent(_("LiveInstaller to Configure"),
+ unconfigured, false, configured);
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["summary"]:"",
+ Label::BackButton(), Label::FinishButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel || ret == `back) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ /* overview dialog */
+ else if(ret == `edit_button) {
+ ret = `overview;
+ break;
+ }
+ /* configure the selected device */
+ else if(ret == `configure_button) {
+ // TODO FIXME: check for change of the configuration
+ any selected = UI::QueryWidget(`id(`detected_selbox), `CurrentItem);
+ if(selected == `other) {
+ ret = `other;
+ }
+ else {
+ ret = `configure;
+ }
+ break;
+ }
+ else if(ret == `next) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * Overview dialog
+ * @return dialog result
+ */
+any OverviewDialog() {
+
+ /* LiveInstaller overview dialog caption */
+ string caption = _("LiveInstaller Overview");
+
+ list overview = LiveInstaller::Overview();
+
+ /* FIXME table header */
+ term contents = Wizard_hw::ConfiguredContent(
+ /* Table header */
+ `header(_("Number"), _("LiveInstaller")),
+ overview, nil, nil, nil, nil );
+
+ contents = Wizard_hw::SpacingAround(contents, 1.5, 1.5, 1.0, 1.0);
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["overview"]:"",
+ Label::BackButton(), Label::FinishButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ /* add */
+ else if(ret == `add_button) {
+ /* FIXME */
+ ret = `add;
+ break;
+ }
+ /* edit */
+ else if(ret == `edit_button) {
+ /* FIXME */
+ ret = `edit;
+ break;
+ }
+ /* delete */
+ else if(ret == `delete_button) {
+ /* FIXME */
+ continue;
+ }
+ else if(ret == `next || ret == `back) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/* EOF */
+}
Added: 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 (added)
+++ trunk/live-installer/src/control/live-install.xml Mon Jun 25 18:22:25 2007
@@ -0,0 +1,148 @@
+<?xml version="1.0"?>
+<productDefines xmlns="http://www.suse.com/1.0/yast2ns"
+ xmlns:config="http://www.suse.com/1.0/configns">
+
+<!--
+Work around for the text domain
+textdomain="live-installer"
+-->
+
+ <textdomain>control</textdomain>
+ <globals>
+ <additional_kernel_parameters></additional_kernel_parameters>
+ <enable_autologin config:type="boolean">true</enable_autologin>
+ <enable_firewall config:type="boolean">true</enable_firewall>
+ <firewall_enable_ssh config:type="boolean">false</firewall_enable_ssh>
+ <fam_local_only>never</fam_local_only>
+ <incomplete_translation_treshold>95</incomplete_translation_treshold>
+ <inform_about_suboptimal_distribution config:type="boolean">true</inform_about_suboptimal_distribution>
+ <skip_language_dialog config:type="boolean">true</skip_language_dialog>
+ <ui_mode>simple</ui_mode>
+ <enable_clone config:type="boolean">false</enable_clone>
+ <enable_register_hwdata config:type="boolean">true</enable_register_hwdata>
+ <enable_register_optional config:type="boolean">true</enable_register_optional>
+ <display_register_forcereg config:type="boolean">true</display_register_forcereg>
+ <disable_register_w3m config:type="boolean">true</disable_register_w3m>
+ <register_monthly config:type="boolean">false</register_monthly>
+ <manual_online_update config:type="boolean">true</manual_online_update>
+ <root_password_ca_check config:type="boolean">false</root_password_ca_check>
+
+ <!-- FATE #301937, Save /root content from the installation system to the installed system -->
+ <save_instsys_content config:type="list">
+ <save_instsys_item>
+ <instsys_directory>/root/</instsys_directory>
+ <system_directory>/root/inst-sys/</system_directory>
+ </save_instsys_item>
+ </save_instsys_content>
+ </globals>
+
+ <software>
+ <delete_old_packages config:type="boolean">true</delete_old_packages>
+ <selection_type config:type="symbol">auto</selection_type>
+
+ <!-- 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>
+ </software>
+
+ <partitioning>
+ <evms_config config:type="boolean">false</evms_config>
+ <try_separate_home config:type="boolean">true</try_separate_home>
+ <limit_try_home>7G</limit_try_home>
+ <root_space_percent>40</root_space_percent>
+ <root_base_size>5G</root_base_size>
+ <root_max_size>20G</root_max_size>
+ <proposal_lvm>false</proposal_lvm>
+ <proposal_evms>false</proposal_evms>
+ <vm_desired_size>15G</vm_desired_size>
+ <vm_home_max_size>25G</vm_home_max_size>
+ <boot_evms>false</boot_evms>
+ </partitioning>
+
+ <network>
+ <force_static_ip config:type="boolean">false</force_static_ip>
+ <network_manager>laptop</network_manager>
+ <startmode>ifplugd</startmode>
+ </network>
+
+ <texts>
+ <congratulate>
+ <label>
+<p><b>Congratulations!</b></p>
+<p>The installation of openSUSE on your machine is complete.
+After clicking <b>Finish</b>, you can log in to the system.</p>
+<p>Visit us at %1.</p>
+<p>Have a lot of fun!<br>Your openSUSE Development Team</p>
+ </label>
+ </congratulate>
+ </texts>
+
+ <proposals config:type="list">
+ <proposal>
+ <label>Live Installation Settings</label>
+ <mode>installation</mode>
+ <stage>normal</stage>
+ <name>initial</name>
+ <enable_skip>no</enable_skip>
+ <proposal_modules config:type="list">
+ <proposal_module>hwinfo</proposal_module>
+ <proposal_module>partitions</proposal_module>
+ <proposal_module>bootloader</proposal_module>
+ </proposal_modules>
+ </proposal>
+ </proposals>
+
+ <!-- Stage: Initial, Mode: Installation -->
+ <workflows config:type="list">
+ <workflow>
+ <defaults>
+ <archs>all</archs>
+ <enable_back>yes</enable_back>
+ <enable_next>yes</enable_next>
+ </defaults>
+ <label>Installation</label>
+ <mode>installation</mode>
+ <stage>normal</stage>
+ <modules config:type="list">
+ <module>
+ <label>Installation Summary</label>
+ <name>inst_proposal</name>
+ <proposal>initial</proposal>
+ </module>
+ <module>
+ <label>Perform Installation</label>
+ <name>live_stage_initial</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_mode_normal</name>
+ </module>
+ <module>
+ <label>Perform Installation</label>
+ <name>live_doit</name>
+ <enable_next>no</enable_next>
+ <enable_back>no</enable_back>
+ </module>
+ <module>
+ <label>Perform Installation</label>
+ <name>live_finish</name>
+ <enable_back>no</enable_back>
+ </module>
+ </modules>
+ </workflow>
+
+ </workflows>
+</productDefines>
Added: trunk/live-installer/src/dialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/dialogs.ycp?r…
==============================================================================
--- trunk/live-installer/src/dialogs.ycp (added)
+++ trunk/live-installer/src/dialogs.ycp Mon Jun 25 18:22:25 2007
@@ -0,0 +1,115 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/live-installer/dialogs.ycp
+ * Package: Configuration of live-installer
+ * Summary: Dialogs definitions
+ * Authors: Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: dialogs.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "live-installer";
+
+import "Label";
+import "Wizard";
+import "LiveInstaller";
+
+include "live-installer/helps.ycp";
+
+/**
+ * Configure1 dialog
+ * @return dialog result
+ */
+any Configure1Dialog () {
+
+ /* LiveInstaller configure1 dialog caption */
+ string caption = _("LiveInstaller Configuration");
+
+ /* LiveInstaller configure1 dialog contents */
+ term contents = `Label (_("First part of configuration of live-installer"));
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["c1"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if(ret == `next || ret == `back) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/**
+ * Configure2 dialog
+ * @return dialog result
+ */
+any Configure2Dialog () {
+
+ /* LiveInstaller configure2 dialog caption */
+ string caption = _("LiveInstaller Configuration");
+
+ /* LiveInstaller configure2 dialog contents */
+ term contents = `Label (_("Second part of configuration of live-installer"));
+
+ Wizard::SetContentsButtons(caption, contents, HELPS["c2"]:"",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = nil;
+ while(true) {
+
+ ret = UI::UserInput();
+
+ /* abort? */
+ if(ret == `abort || ret == `cancel) {
+ if(ReallyAbort()) break;
+ else continue;
+ }
+ else if(ret == `next || ret == `back) {
+ break;
+ }
+ else {
+ y2error("unexpected retcode: %1", ret);
+ continue;
+ }
+ }
+
+ return ret;
+}
+
+/* EOF */
+}
Added: trunk/live-installer/src/helps.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/helps.ycp?rev…
==============================================================================
--- trunk/live-installer/src/helps.ycp (added)
+++ trunk/live-installer/src/helps.ycp Mon Jun 25 18:22:25 2007
@@ -0,0 +1,119 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/live-installer/helps.ycp
+ * Package: Configuration of live-installer
+ * Summary: Help texts of all the dialogs
+ * Authors: Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: helps.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "live-installer";
+
+/**
+ * All helps are here
+ */
+map HELPS = $[
+
+ /* Read dialog help 1/2 */
+ "read" : _("<p><b><big>Initializing live-installer Configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Read dialog help 2/2 */
+ _("<p><b><big>Aborting Initialization:</big></b><br>
+Safely abort the configuration utility by pressing <b>Abort</b> now.</p>
+"),
+
+ /* Write dialog help 1/2 */
+ "write" : _("<p><b><big>Saving live-installer Configuration</big></b><br>
+Please wait...<br></p>
+") +
+
+ /* Write dialog help 2/2 */
+_("<p><b><big>Aborting Saving:</big></b><br>
+Abort the save procedure by pressing <b>Abort</b>.
+An additional dialog informs whether it is safe to do so.
+</p>
+"),
+
+ /* Summary dialog help 1/3 */
+ "summary" : _("<p><b><big>LiveInstaller Configuration</big></b><br>
+Configure live-installer here.<br></p>
+") +
+
+ /* Summary dialog help 2/3 */
+ _("<p><b><big>Adding a live-installer:</big></b><br>
+Choose an live-installer from the list of detected live-installers.
+If your live-installer was not detected, use <b>Other (not detected)</b>.
+Then press <b>Configure</b>.</p>
+") +
+
+ /* Summary dialog help 3/3 */
+ _("<p><b><big>Editing or Deleting:</big></b><br>
+If you press <b>Edit</b>, an additional dialog in which to change
+the configuration opens.</p>
+"),
+
+ /* Ovreview dialog help 1/3 */
+ "overview" : _("<p><b><big>LiveInstaller Configuration Overview</big></b><br>
+Obtain an overview of installed live-installers. Additionally
+edit their configurations.<br></p>
+") +
+
+ /* Ovreview dialog help 2/3 */
+_("<p><b><big>Adding a live-installer:</big></b><br>
+Press <b>Add</b> to configure a live-installer.</p>") +
+
+ /* Ovreview dialog help 3/3 */
+_("<p><b><big>Editing or Deleting:</big></b><br>
+Choose a live-installer to change or remove.
+Then press <b>Edit</b> or <b>Delete</b> as desired.</p>
+"),
+
+ /* Configure1 dialog help 1/2 */
+ "c1" : _("<p><b><big>Configuration Part One</big></b><br>
+Press <b>Next</b> to continue.
+<br></p>") +
+
+ /* Configure1 dialog help 2/2 */
+_("<p><b><big>Selecting Something</big></b><br>
+It is not possible. You must code it first. :-)
+</p>"),
+
+ /* Configure2 dialog help 1/2 */
+ "c2" : _("<p><b><big>Configuration Part Two</big></b><br>
+Press <b>Next</b> to continue.
+<br></p>
+") +
+
+ /* Configure2 dialog help 2/2 */
+_("<p><b><big>Selecting Something</big></b><br>
+It is not possible. You must code it first. :-)
+</p>"),
+
+];
+
+/* EOF */
+}
Added: trunk/live-installer/src/live-installer.desktop
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/live-installe…
==============================================================================
--- trunk/live-installer/src/live-installer.desktop (added)
+++ trunk/live-installer/src/live-installer.desktop Mon Jun 25 18:22:25 2007
@@ -0,0 +1,24 @@
+[Desktop Entry]
+Type=Application
+Categories=Qt;X-SuSE-YaST;X-SuSE-YaST-Misc;
+
+X-KDE-ModuleType=Library
+X-KDE-RootOnly=true
+X-KDE-HasReadOnlyMode=true
+X-KDE-Library=yast2
+X-SuSE-YaST-Call=live-installer
+
+X-SuSE-YaST-Group=Misc
+X-SuSE-YaST-Argument=
+X-SuSE-YaST-RootOnly=true
+X-SuSE-YaST-AutoInst=
+X-SuSE-YaST-Geometry=
+X-SuSE-YaST-SortKey=
+X-SuSE-YaST-AutoInstResource=live-installer
+
+Icon=yast-live-installer
+Exec=/sbin/yast2 live-installer
+
+Name=LiveInstaller
+GenericName=live-installer
+X-KDE-SubstituteUID=true
Added: 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 (added)
+++ trunk/live-installer/src/live-installer.ycp Mon Jun 25 18:22:25 2007
@@ -0,0 +1,52 @@
+/**
+ * Maintainer: Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: firstboot.ycp 36560 2007-02-28 12:40:38Z lslezak $
+ */
+{
+ textdomain "firstboot";
+
+ import "Mode";
+ import "Stage";
+ import "ProductControl";
+ import "Wizard";
+ import "Report";
+ import "LiveInstaller";
+ import "Misc";
+ import "Installation";
+ import "Storage";
+
+
+ Wizard::OpenNextBackStepsDialog();
+ Installation::destdir = "/mnt";
+ Installation::scr_destdir = "/mnt";
+
+ list<map> stage_mode = [$["stage": "normal", "mode": "installation" ]];
+ y2internal ("SM: %1", stage_mode);
+ Mode::SetMode ("installation");
+ // required in order to make Storage.ycp honor Installation::destdir
+ Stage::Set ("initial");
+ Storage::InitLibstorage ();
+ Stage::Set ("normal");
+
+ ProductControl::custom_control_file = LiveInstaller::live_control_file;
+ if (!ProductControl::Init())
+ y2error("control file %1 not found", ProductControl::custom_control_file );
+ ProductControl::AddWizardSteps(stage_mode);
+
+ // Do log Report messages by default (#180862)
+ Report::LogMessages(true);
+ Report::LogErrors(true);
+ Report::LogWarnings(true);
+
+
+ symbol ret = ProductControl::Run();
+ y2milestone("ProductControl::Run() returned: %1", ret);
+
+ Pkg::SourceFinishAll();
+ Pkg::TargetFinish();
+
+ UI::CloseDialog();
+
+ return ret;
+}
Added: trunk/live-installer/src/live_doit.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/live_doit.ycp…
==============================================================================
--- trunk/live-installer/src/live_doit.ycp (added)
+++ trunk/live-installer/src/live_doit.ycp Mon Jun 25 18:22:25 2007
@@ -0,0 +1,130 @@
+/**
+ * Maintainer: Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: firstboot.ycp 36560 2007-02-28 12:40:38Z lslezak $
+ */
+{
+textdomain "live-installer";
+
+import "Installation";
+
+Installation::destdir = "/mnt";
+
+/**
+ * Copy a subtree, limit to a single filesystem
+ * @param from string source directory
+ * @param to string target directory
+ * @return boolean true on success
+ */
+boolean FileSystemCopy (string from, string to) {
+/* string fromdir = "/";
+ list<string> components = splitstring (from, "/");
+ if (size (components) > 1)
+ {
+ from = components[size(components) - 1]:"";
+ components[size(components) - 1] = "";
+ fromdir = mergestring (components, "/");
+ }
+ if (fromdir == "")
+ fromdir = "/";
+ if (from == "")
+ from = "/";
+ if (to == "")
+ to = "/";
+ y2milestone ("FromDir: %1, From: %2, To: %3",
+ fromdir, from, to);
+ string cmd = sformat (
+ "(cd %1 ; tar clf - %2 ) | dd | (cd %3 ; tar -xf - )",
+ fromdir, from, to);*/
+ string cmd = sformat ("/bin/cp -avx %1 %2", from, to);
+ y2milestone ("Executing %1", cmd);
+ map out = (map)SCR::Execute (.target.bash_output, cmd);
+ y2milestone ("Result: %1", out);
+ return out["exit"]:-1 == 0;
+}
+
+/**
+ * Find symlinks which need to be resolved and copied
+ * @return a list of such symlinks
+ */
+list<string> LinksToCopyList () {
+ string cmd = sformat ("
+ for LINK in `find %1 -type l -xdev` ; do
+ stat -c \"%%N\" $LINK |grep livecd >/devnull 2>/devnull && echo $LINK;
+ done", Installation::destdir);
+ y2milestone ("Executing %1", cmd);
+ map out = (map)SCR::Execute (.target.bash_output, cmd);
+ y2milestone ("Result: %1", out);
+ if (out["exit"]:-1 != 0)
+ {
+ y2error ("Faild resolving symlinks");
+ return [];
+ }
+ string stdout = out["stdout"]:"";
+ list<string> lines = splitstring (stdout, "\n");
+ lines = filter (string l, lines, { return l != ""; });
+ y2milestone ("Symlinks to resolve: %1", lines);
+ return lines;
+}
+
+/**
+ * Create a map of relevant link pointers
+ * @param list of links which need to be resolved and copied
+ * @return a map $[ link : target ]
+ */
+map<string,string> LinksMap (list<string> links) {
+ integer dest_length = size (Installation::destdir);
+ map<string,string> out = listmap (string link, links, {
+ if (substring (link, 0, dest_length) == Installation::destdir)
+ link = substring (link, dest_length);
+ if (substring (link, 0, 1) != "/")
+ link = "/" + link;
+ string target = (string)SCR::Read (.target.symlink, link);
+ return $[ link : target ];
+ });
+ y2milestone ("Resolved symlinks: %1", out);
+ return out;
+}
+
+/**
+ * Copy all the symlinks as needed
+ * @param symlinks a map of resolved symlinks
+ * @return boolean true on success
+ */
+boolean CopySymlinkedImage (map<string,string> symlinks) {
+ foreach (string link, string target, symlinks, {
+ SCR::Execute (.target.remove, sformat ("%1/%2", Installation::destdir, link));
+/*
+ list<string> components = splitstring (link, "/");
+ while (size(components) > 1
+ && components[size(components) - 1]:"" == "")
+ {
+ components = remove (components, size (components) - 1);
+ }
+ if (size (components) > 1)
+ components[size(components) - 1] = "";
+ link = mergestring (components, "/");
+*/
+ FileSystemCopy ("/" + target, sformat ("%1/%2", Installation::destdir, link));
+ });
+ return true;
+}
+
+/**
+ * Copy root image to hard disk
+ * @return boolean true on success
+ */
+boolean CopyRootImage () {
+ string tmpdir = (string)SCR::Read (.target.tmpdir);
+ SCR::Execute (.target.bash, sformat ("/bin/cp -a %1/etc %2", Installation::destdir, tmpdir));
+ FileSystemCopy ("/", Installation::destdir);
+ SCR::Execute (.target.bash, sformat ("/bin/cp -a %1/etc %2", tmpdir, Installation::destdir));
+ return true;
+}
+
+CopyRootImage ();
+map<string,string> copy_map = LinksMap (LinksToCopyList ());
+CopySymlinkedImage (copy_map);
+
+
+} // client end
Added: trunk/live-installer/src/wizards.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/wizards.ycp?r…
==============================================================================
--- trunk/live-installer/src/wizards.ycp (added)
+++ trunk/live-installer/src/wizards.ycp Mon Jun 25 18:22:25 2007
@@ -0,0 +1,177 @@
+/* ------------------------------------------------------------------------------
+ * Copyright (c) 2006 Novell, Inc. All Rights Reserved.
+ *
+ *
+ * This program is free software; you can redistribute it and/or modify it under
+ * the terms of version 2 of the GNU General Public License as published by the
+ * Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful, but WITHOUT
+ * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
+ * FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along with
+ * this program; if not, contact Novell, Inc.
+ *
+ * To contact Novell about this file by physical or electronic mail, you may find
+ * current contact information at www.novell.com.
+ * ------------------------------------------------------------------------------
+ */
+
+/**
+ * File: include/live-installer/wizards.ycp
+ * Package: Configuration of live-installer
+ * Summary: Wizards definitions
+ * Authors: Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: wizards.ycp 27914 2006-02-13 14:32:08Z locilka $
+ */
+
+{
+
+textdomain "live-installer";
+
+import "Sequencer";
+import "Wizard";
+
+include "live-installer/complex.ycp";
+include "live-installer/dialogs.ycp";
+
+/**
+ * Add a configuration of live-installer
+ * @return sequence result
+ */
+any AddSequence() {
+
+ /* FIXME: adapt to your needs */
+ map aliases = $[
+ "config1" : ``(Configure1Dialog()),
+ "config2" : ``(Configure2Dialog()),
+ ];
+
+ /* FIXME: adapt to your needs */
+ map sequence = $[
+ "ws_start" : "config1",
+ "config1" : $[
+ `abort : `abort,
+ `next : "config2"
+ ],
+ "config2" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ return Sequencer::Run(aliases, sequence);
+}
+
+/**
+ * Main workflow of the live-installer configuration
+ * @return sequence result
+ */
+any MainSequence() {
+
+ /* FIXME: adapt to your needs */
+ map aliases = $[
+ "summary" : ``( SummaryDialog() ),
+ "overview" : ``( OverviewDialog() ),
+ "configure" : [ ``( AddSequence() ), true ],
+ "add" : [ ``( AddSequence() ), true ],
+ "edit" : [ ``( AddSequence() ), true ]
+ ];
+
+ /* FIXME: adapt to your needs */
+ map sequence = $[
+ "ws_start" : "summary",
+ "summary" : $[
+ `abort : `abort,
+ `next : `next,
+ `overview : "overview",
+ `configure : "configure",
+ `other : "configure",
+ ],
+ "overview" : $[
+ `abort : `abort,
+ `next : `next,
+ `add : "add",
+ `edit : "edit",
+ ],
+ "configure" : $[
+ `abort : `abort,
+ `next : "summary",
+ ],
+ "add" : $[
+ `abort : `abort,
+ `next : "overview",
+ ],
+ "edit" : $[
+ `abort : `abort,
+ `next : "overview",
+ ]
+ ];
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ return ret;
+}
+
+/**
+ * Whole configuration of live-installer
+ * @return sequence result
+ */
+any LiveInstallerSequence() {
+
+ map aliases = $[
+ "read" : [ ``( ReadDialog() ), true ],
+ "main" : ``( MainSequence() ),
+ "write" : [ ``( WriteDialog() ), true ]
+ ];
+
+ map sequence = $[
+ "ws_start" : "read",
+ "read" : $[
+ `abort : `abort,
+ `next : "main"
+ ],
+ "main" : $[
+ `abort : `abort,
+ `next : "write"
+ ],
+ "write" : $[
+ `abort : `abort,
+ `next : `next
+ ]
+ ];
+
+ Wizard::CreateDialog();
+
+ any ret = Sequencer::Run(aliases, sequence);
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/**
+ * Whole configuration of live-installer but without reading and writing.
+ * For use with autoinstallation.
+ * @return sequence result
+ */
+any LiveInstallerAutoSequence() {
+
+ /* Initialization dialog caption */
+ string caption = _("LiveInstaller Configuration");
+ /* Initialization dialog contents */
+ term contents = `Label(_("Initializing..."));
+
+ Wizard::CreateDialog();
+ Wizard::SetContentsButtons(caption, contents, "",
+ Label::BackButton(), Label::NextButton());
+
+ any ret = MainSequence();
+
+ UI::CloseDialog();
+ return ret;
+}
+
+/* EOF */
+}
Added: trunk/live-installer/testsuite/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/testsuite/.cvsign…
==============================================================================
--- trunk/live-installer/testsuite/.cvsignore (added)
+++ trunk/live-installer/testsuite/.cvsignore Mon Jun 25 18:22:25 2007
@@ -0,0 +1,11 @@
+Makefile
+Makefile.in
+site.exp
+*.sum
+*.log
+tmp.out*
+tmp.err*
+tmp.log*
+config
+run
+*.test
Added: trunk/live-installer/testsuite/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/testsuite/Makefil…
==============================================================================
--- trunk/live-installer/testsuite/Makefile.am (added)
+++ trunk/live-installer/testsuite/Makefile.am Mon Jun 25 18:22:25 2007
@@ -0,0 +1,21 @@
+#
+# Makefile.am for .../testsuite
+#
+# Do not edit this file (Makefile.am) as it will be overwritten!
+#
+
+AUTOMAKE_OPTIONS = dejagnu
+EXTRA_DIST = $(wildcard tests/*.out) $(wildcard tests/*.err) $(wildcard tests/*.ycp) $(wildcard tests/*.yh)
+
+testsuite_prepare = @ydatadir@/testsuite/Makefile.testsuite
+
+all-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir)
+
+clean-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) clean
+
+check-local: $(testsuite_prepare)
+ make -f $(testsuite_prepare) RPMNAME=$(RPMNAME) srcdir=$(srcdir) check
+
+# EOF
Added: trunk/live-installer/testsuite/tests/.cvsignore
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/testsuite/tests/.…
==============================================================================
(empty)
Added: trunk/live-installer/testsuite/tests/LiveInstaller.err
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/testsuite/tests/L…
==============================================================================
(empty)
Added: 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 (added)
+++ trunk/live-installer/testsuite/tests/LiveInstaller.out Mon Jun 25 18:22:25 2007
@@ -0,0 +1,2 @@
+Dump LiveInstaller::Modified
+Return false
Added: 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 (added)
+++ trunk/live-installer/testsuite/tests/LiveInstaller.ycp Mon Jun 25 18:22:25 2007
@@ -0,0 +1,13 @@
+{
+
+// testedfiles: LiveInstaller.ycp
+
+include "testsuite.ycp";
+TESTSUITE_INIT([], nil);
+
+import "LiveInstaller";
+
+DUMP("LiveInstaller::Modified");
+TEST(``(LiveInstaller::Modified()), [], nil);
+
+}
Added: 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 (added)
+++ trunk/live-installer/yast2-live-installer.spec.in Mon Jun 25 18:22:25 2007
@@ -0,0 +1,31 @@
+@HEADER-COMMENT@
+
+@HEADER@
+Requires: yast2
+BuildRequires: perl-XML-Writer update-desktop-files yast2 yast2-devtools yast2-testsuite
+
+BuildArchitectures: noarch
+
+Summary: Configuration of live-installer
+
+%description
+-
+
+@PREP@
+
+@BUILD@
+
+@INSTALL@
+
+@CLEAN@
+
+%files
+%defattr(-,root,root)
+%dir @yncludedir@/live-installer
+@yncludedir@/live-installer/*
+@clientdir@/live-installer.ycp
+@clientdir@/live-installer_*.ycp
+@moduledir@/LiveInstaller.*
+@moduledir@/LiveInstaller2.*
+@desktopdir@/live-installer.desktop
+%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] r39017 - /trunk/core/package/yast2-core.changes
by mvidner@svn.opensuse.org 25 Jun '07
by mvidner@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: mvidner
Date: Mon Jun 25 18:13:11 2007
New Revision: 39017
URL: http://svn.opensuse.org/viewcvs/yast?rev=39017&view=rev
Log:
readded missing entries
Modified:
trunk/core/package/yast2-core.changes
Modified: trunk/core/package/yast2-core.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?…
==============================================================================
--- trunk/core/package/yast2-core.changes (original)
+++ trunk/core/package/yast2-core.changes Mon Jun 25 18:13:11 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Mon Jun 25 18:10:49 CEST 2007 - mvidner(a)suse.cz
+
+- ag_background: added a test suite.
+- Recommend, not require, netcat (#264309).
+
+-------------------------------------------------------------------
Thu Jun 21 17:37:27 CEST 2007 - adrian(a)suse.de
- fix changelog entry order
--
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] r39016 - /trunk/core/package/yast2-core.changes
by mvidner@svn.opensuse.org 25 Jun '07
by mvidner@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: mvidner
Date: Mon Jun 25 18:12:09 2007
New Revision: 39016
URL: http://svn.opensuse.org/viewcvs/yast?rev=39016&view=rev
Log:
fix changelog entry order (adrian)
Modified:
trunk/core/package/yast2-core.changes
Modified: trunk/core/package/yast2-core.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?…
==============================================================================
--- trunk/core/package/yast2-core.changes (original)
+++ trunk/core/package/yast2-core.changes Mon Jun 25 18:12:09 2007
@@ -1,7 +1,7 @@
-------------------------------------------------------------------
-Mon Jun 4 14:40:26 CEST 2007 - mvidner(a)suse.cz
+Thu Jun 21 17:37:27 CEST 2007 - adrian(a)suse.de
-- ag_background: added a test suite.
+- fix changelog entry order
-------------------------------------------------------------------
Thu May 24 11:56:41 CEST 2007 - stbinner(a)suse.de
@@ -9,21 +9,6 @@
- add missing %run_ldconfig calls
-------------------------------------------------------------------
-Thu Apr 19 12:55:05 CEST 2007 - sh(a)suse.de
-
-- Merged mod-ui branch changes (r37462:37567) back to trunk:
- - Reorganized layout of libyui source tree:
- Moved header files to the same directory as sources
-
-- V 2.15.8
-
--------------------------------------------------------------------
-Mon Apr 16 17:59:35 CEST 2007 - mvidner(a)suse.cz
-
-- Recommend, not require, netcat (#264309).
-- 2.15.7
-
--------------------------------------------------------------------
Fri Apr 13 17:38:58 CEST 2007 - sh(a)suse.de
- Merged mod-ui branch changes (r37142:37462) back to trunk:
@@ -113,6 +98,12 @@
- 2.15.2
-------------------------------------------------------------------
+Tue Dec 5 10:54:41 CET 2006 - mvidner(a)suse.cz
+
+- ini-agent with repeat_names: do not merge sections with same name
+ when parsing. They can be accessed using .all. (#224414)
+
+-------------------------------------------------------------------
Tue Dec 5 10:31:13 CET 2006 - kmachalkova(a)suse.cz
- Added RunInTerminal UI builtin for running external programs from
@@ -120,12 +111,6 @@
- 2.15.1
-------------------------------------------------------------------
-Tue Dec 5 10:54:41 CET 2006 - mvidner(a)suse.cz
-
-- ini-agent with repeat_names: do not merge sections with same name
- when parsing. They can be accessed using .all. (#224414)
-
--------------------------------------------------------------------
Tue Dec 5 08:45:30 CET 2006 - mvidner(a)suse.cz
- Do not abort if a nonterm is passed to `ReplacePoint or `*Squash
@@ -674,12 +659,6 @@
- 2.12.1
-------------------------------------------------------------------
-Tue Mar 15 09:44:18 CET 2005 - locilka(a)suse.cz
-
-- Checked, fixed and added YCP builtins description and examples
-- Mark tolist() as deprecated
-
--------------------------------------------------------------------
Wed Mar 16 10:15:35 CET 2005 - visnov(a)suse.cz
- reduced UI logging
@@ -687,6 +666,12 @@
- 2.11.26
-------------------------------------------------------------------
+Tue Mar 15 09:44:18 CET 2005 - locilka(a)suse.cz
+
+- Checked, fixed and added YCP builtins description and examples
+- Mark tolist() as deprecated
+
+-------------------------------------------------------------------
Tue Mar 8 15:34:51 CET 2005 - locilka(a)suse.cz
- Checked, fixed and added YCP builtins description and examples
@@ -2027,18 +2012,18 @@
- 2.9.13
-------------------------------------------------------------------
-Fri Dec 12 20:46:22 CET 2003 - msvec(a)suse.cz
-
-- adapted for the logging changes in liby2util
-- 2.9.12
-
--------------------------------------------------------------------
Mon Dec 15 12:33:48 CET 2003 - ma(a)suse.de
- Removed outdated Pkg::SelectionsUpdateAll
- 2.9.11
-------------------------------------------------------------------
+Fri Dec 12 20:46:22 CET 2003 - msvec(a)suse.cz
+
+- adapted for the logging changes in liby2util
+- 2.9.12
+
+-------------------------------------------------------------------
Fri Dec 5 09:12:50 CET 2003 - mvidner(a)suse.cz
- ycp.pm: accept `Command(...) as well as Command(...)
@@ -2050,6 +2035,11 @@
- 2.9.9
-------------------------------------------------------------------
+Tue Dec 2 17:42:09 CET 2003 - visnov(a)suse.cz
+
+- fix function prototypes
+
+-------------------------------------------------------------------
Tue Dec 2 15:58:51 CET 2003 - msvec(a)suse.cz
- better logging in the dummy agent (needs newer testsuite)
@@ -2057,11 +2047,6 @@
- 2.9.8
-------------------------------------------------------------------
-Tue Dec 2 17:42:09 CET 2003 - visnov(a)suse.cz
-
-- fix function prototypes
-
--------------------------------------------------------------------
Thu Nov 27 16:01:36 CET 2003 - visnov(a)suse.cz
- ignore function prototypes
@@ -3034,7 +3019,7 @@
- provide full directory structure
- removed obsolete getyast2dir function from libycp
-------------------------------------------------------------------
+-------------------------------------------------------------------
Fri Jul 12 16:20:10 CEST 2002 - kkeil(a)suse.de
- agent-probe: Additional fields for the ISDN database to
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
Author: fehr
Date: Mon Jun 25 17:59:31 2007
New Revision: 39015
URL: http://svn.opensuse.org/viewcvs/yast?rev=39015&view=rev
Log:
Created tag stable-2_15_17 for storage
Added:
tags/stable-2_15_17/storage/
- copied from r39014, trunk/storage/
--
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] r39014 - in /trunk/storage: VERSION package/yast2-storage.changes
by fehr@svn.opensuse.org 25 Jun '07
by fehr@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: fehr
Date: Mon Jun 25 17:48:41 2007
New Revision: 39014
URL: http://svn.opensuse.org/viewcvs/yast?rev=39014&view=rev
Log:
increase version
Modified:
trunk/storage/VERSION
trunk/storage/package/yast2-storage.changes
Modified: trunk/storage/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/VERSION?rev=39014&r1=390…
==============================================================================
--- trunk/storage/VERSION (original)
+++ trunk/storage/VERSION Mon Jun 25 17:48:41 2007
@@ -1 +1 @@
-2.15.16
+2.15.17
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.ch…
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Mon Jun 25 17:48:41 2007
@@ -4,6 +4,7 @@
- fixed problem mounting filesystem in inst-sys (#286686)
- prevent direct or indirect change of partitions used for swap or
as install source during installation (#274321,#262417)
+- version 2.15.17
-------------------------------------------------------------------
Mon Jun 18 12:48:04 CEST 2007 - fehr(a)suse.de
--
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] r39013 - in /trunk/storage: libstorage/src/ package/ storage/src/ storage/src/include/ storage/src/modules/
by fehr@svn.opensuse.org 25 Jun '07
by fehr@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: fehr
Date: Mon Jun 25 17:48:13 2007
New Revision: 39013
URL: http://svn.opensuse.org/viewcvs/yast?rev=39013&view=rev
Log:
prevent direct or indirect change of partitions used for swap or
as install source during installation (#274321,#262417)
Modified:
trunk/storage/libstorage/src/Storage.cc
trunk/storage/libstorage/src/Volume.cc
trunk/storage/libstorage/src/Volume.h
trunk/storage/package/yast2-storage.changes
trunk/storage/storage/src/include/auto_part_prepare.ycp
trunk/storage/storage/src/include/custom_part_check_generated.ycp
trunk/storage/storage/src/include/custom_part_lib.ycp
trunk/storage/storage/src/include/do_proposal_flexible.ycp
trunk/storage/storage/src/include/evms_lib.ycp
trunk/storage/storage/src/include/signatures.ycp
trunk/storage/storage/src/inst_custom_part.ycp
trunk/storage/storage/src/inst_lvm_lv.ycp
trunk/storage/storage/src/inst_target_part.ycp
trunk/storage/storage/src/modules/Storage.ycp
Modified: trunk/storage/libstorage/src/Storage.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Storage.c…
==============================================================================
--- trunk/storage/libstorage/src/Storage.cc (original)
+++ trunk/storage/libstorage/src/Storage.cc Mon Jun 25 17:48:13 2007
@@ -829,8 +829,7 @@
{
if( i->getUsedByType()==UB_NONE )
{
- if( detectMounted )
- i->getMountData( Mounts );
+ i->getMountData( Mounts, !detectMounted );
i->getFstabData( *fstab );
y2mil( "detect:" << *i );
if( i->getFs()==FSUNKNOWN && i->getEncryption()==ENC_NONE )
Modified: trunk/storage/libstorage/src/Volume.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Volume.cc…
==============================================================================
--- trunk/storage/libstorage/src/Volume.cc (original)
+++ trunk/storage/libstorage/src/Volume.cc Mon Jun 25 17:48:13 2007
@@ -268,10 +268,10 @@
}
}
-void Volume::getMountData( const ProcMounts& mountData )
+void Volume::getMountData( const ProcMounts& mountData, bool swap_only )
{
y2mil( "this:" << *this );
- y2mil( "mountDevice:" << mountDevice() );
+ y2mil( "swap_only:" << swap_only << " mountDevice:" << mountDevice() );
mp = mountData.getMount( mountDevice() );
if( mp.empty() )
{
@@ -280,7 +280,13 @@
if( !mp.empty() )
{
is_mounted = true;
- y2milestone( "%s mounted on %s", device().c_str(), mp.c_str() );
+ if( swap_only && mp!="swap" )
+ {
+ is_mounted = false;
+ mp.clear();
+ }
+ if( is_mounted )
+ y2milestone( "%s mounted on %s", device().c_str(), mp.c_str() );
}
orig_mp = mp;
}
Modified: trunk/storage/libstorage/src/Volume.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Volume.h?…
==============================================================================
--- trunk/storage/libstorage/src/Volume.h (original)
+++ trunk/storage/libstorage/src/Volume.h Mon Jun 25 17:48:13 2007
@@ -199,7 +199,7 @@
bool allowedMountBy( storage::MountByType mby, const string& mp="" );
void getFsData( SystemCmd& blkidData );
void getLoopData( SystemCmd& loopData );
- void getMountData( const ProcMounts& mountData );
+ void getMountData( const ProcMounts& mountData, bool swap_only=false );
void getFstabData( EtcFstab& fstabData );
void getStartData();
void getTestmodeData( const string& data );
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.ch…
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Mon Jun 25 17:48:13 2007
@@ -2,6 +2,8 @@
Mon Jun 25 17:41:27 CEST 2007 - fehr(a)suse.de
- fixed problem mounting filesystem in inst-sys (#286686)
+- prevent direct or indirect change of partitions used for swap or
+ as install source during installation (#274321,#262417)
-------------------------------------------------------------------
Mon Jun 18 12:48:04 CEST 2007 - fehr(a)suse.de
Modified: trunk/storage/storage/src/include/auto_part_prepare.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/auto…
==============================================================================
--- trunk/storage/storage/src/include/auto_part_prepare.ycp (original)
+++ trunk/storage/storage/src/include/auto_part_prepare.ycp Mon Jun 25 17:48:13 2007
@@ -161,7 +161,7 @@
p["ui_id"] = ui_id;
if( p["type"]:`unknown == `free )
p["size_k"] = size_of_region( p["region"]:[0,0], bytes_per_unit )/1024;
- if( haskey(p,"mount"))
+ if( haskey(p,"mount") && p["mount"]:""!="swap" && !p["inactive"]:false )
p = remove( p, "mount" );
return( p );
});
Modified: trunk/storage/storage/src/include/custom_part_check_generated.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/cust…
==============================================================================
--- trunk/storage/storage/src/include/custom_part_check_generated.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_check_generated.ycp Mon Jun 25 17:48:13 2007
@@ -825,11 +825,14 @@
Remove the volume before editing it.
"), curr_part["used_by"]:"" ));
}
- return( used==`UB_NONE );
+ boolean ret = used==`UB_NONE;
+ if( ret )
+ ret = Storage::CanEdit( curr_part, true );
+ return( ret );
}
define boolean check_device_delete( map curr_part, boolean bsd_label,
- boolean installation, list<map> pl )
+ boolean installation, map disk )
``{
string part_name = curr_part["device"]:"";
@@ -930,10 +933,11 @@
}
}
}
- if( curr_part["type"]:`unknown==`logical )
+ if( !installation && curr_part["type"]:`unknown==`logical )
{
boolean ok = true;
- list<map> ppl = filter( map p, pl, ``(p["nr"]:0>curr_part["nr"]:0));
+ list<map> ppl = filter( map p, disk["partitions"]:[],
+ ``(p["nr"]:0>curr_part["nr"]:0));
if( size(ppl)>0 && check_devices_used( ppl, true )!=`UB_NONE )
ok = false;
if( ok && !installation && size(ppl)>0 )
@@ -956,7 +960,10 @@
return( false );
}
}
- return true;
+ boolean ret = used==`UB_NONE;
+ if( ret )
+ ret = Storage::CanDelete( curr_part, disk, true );
+ return ret;
};
@@ -1057,7 +1064,15 @@
deleting the extended partition.
"));
}
- return( used==`UB_NONE );
+ boolean ret = used==`UB_NONE;
+ if( ret )
+ {
+ map extd = find( map p, partitions,
+ ``(p["type"]:`primary==`extended));
+ if( extd!=nil && size(extd)>0 )
+ ret = Storage::CanDelete( extd, curr_disk, true );
+ }
+ return( ret );
};
}
Modified: trunk/storage/storage/src/include/custom_part_lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/cust…
==============================================================================
--- trunk/storage/storage/src/include/custom_part_lib.ycp (original)
+++ trunk/storage/storage/src/include/custom_part_lib.ycp Mon Jun 25 17:48:13 2007
@@ -418,6 +418,8 @@
ret["ok"] = true;
new["mount"] = UI::QueryWidget(`id(`mount_point), `Value);
new["mount"] = deletechars( new["mount"]:"", " \t" );
+ if( old["mount"]:"" != new["mount"]:"" )
+ new["inactive"] = true;
if( ret["ok"]:false && size(new["mount"]:"")>0 )
{
boolean crypt_fs = false;
@@ -643,7 +645,10 @@
{
not_used_mp = selected_fs[`mountpoints]:[];
if( mount != "swap" && (new["type"]:`primary!=`lvm || mount!=""))
+ {
new["mount"] = "swap";
+ new["inactive"] = true;
+ }
}
else
{
Modified: trunk/storage/storage/src/include/do_proposal_flexible.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/do_p…
==============================================================================
--- trunk/storage/storage/src/include/do_proposal_flexible.ycp (original)
+++ trunk/storage/storage/src/include/do_proposal_flexible.ycp Mon Jun 25 17:48:13 2007
@@ -821,6 +821,8 @@
{
y2milestone( "process_partition_data reuse part %1", p );
p["format"] = true;
+ if( p["mount"]:"" != mount )
+ p["inactive"] = true;
p["mount"] = mount;
p["used_fs"] =
solution["partitions",pindex,"fsys"]:Partitions::DefaultFs();
@@ -920,6 +922,7 @@
}
part["size_k"] = part["region",1]:0 * disk["cyl_size"]:0 / 1024;
part["mount"] = mount;
+ part["inactive"] = true;
part["used_fs"] =
solution["partitions",pindex,"fsys"]:Partitions::DefaultFs();
value = solution["partitions",pindex,"fstopt"]:"";
@@ -1002,6 +1005,7 @@
part["type"] = `logical;
}
part["mount"] = mount;
+ part["inactive"] = true;
part["used_fs"] =
solution["partitions",pindex,"fsys"]:Partitions::DefaultFs();
value = solution["partitions",pindex,"fstopt"]:"";
@@ -1633,7 +1637,8 @@
p["type"]:`primary != `extended &&
!contains( conf["keep_partition_num"]:[], p["nr"]:0 ) &&
!contains( conf["keep_partition_id"]:[], fsid ) &&
- !contains( conf["keep_partition_fsys"]:[], p["used_fs"]:`none ))
+ !contains( conf["keep_partition_fsys"]:[], p["used_fs"]:`none ) &&
+ Storage::CanDelete( p, disk, false ))
{
p["delete"] = true;
}
@@ -2206,6 +2211,8 @@
if( !p["delete"]:false &&
p["device"]:""==swaps[0,"device"]:"" )
{
+ if( p["mount"]:"" != "swap" )
+ p["inactive"] = true;
p["mount"] = "swap";
if( haskey( p, "vg" ))
{
@@ -2278,8 +2285,9 @@
{
ret = maplist( map p, partitions,
``{
- if( !p["delete"]:false &&
- p["device"]:""==boot["device"]:"" )
+ if( !p["delete"]:false &&
+ p["device"]:""==boot["device"]:"" &&
+ Storage::CanEdit(p,false) )
{
p["mount"] = Partitions::BootMount();
p["used_fs"] = Partitions::DefaultBootFs();
@@ -2312,7 +2320,8 @@
p["used_by_type"]:`UB_NONE == `UB_NONE &&
size(p["mount"]:"")==0 &&
p["size_k"]:0/1024 >= min &&
- (max==0 || p["size_k"]:0/1024 <= max)));
+ (max==0 || p["size_k"]:0/1024 <= max) &&
+ Storage::CanEdit( p, false )));
y2milestone( "can_mp_reuse normal %1", pl );
if( size(pl)>0 )
{
@@ -2563,11 +2572,12 @@
parts =
maplist( map p, parts,
``{
- if( size(mp)==0 || contains( mp, p["mount"]:"") )
+ if( (size(mp)==0 || contains( mp, p["mount"]:"")) &&
+ !(p["mount"]:""=="swap" && !p["inactive"]:false) )
{
foreach( string s, rems,
``{
- if( haskey( p, s ))
+ if( haskey( p, s ) )
p = remove( p, s );
});
}
@@ -2576,8 +2586,9 @@
return( parts );
}
-list<map> remove_one_partition( list<map> partitions )
+list<map> remove_one_partition( map disk )
{
+ list<map> partitions = disk["partitions"]:[];
list<map> pl = filter( map p, partitions,
``( p["linux"]:false && size(p["mount"]:"")==0 &&
!p["delete"]:false ));
@@ -2594,7 +2605,8 @@
``{
if( p["linux"]:false && !p["delete"]:false &&
size(p["mount"]:"")==0 &&
- p["device"]:""==pl[0,"device"]:"" )
+ p["device"]:""==pl[0,"device"]:"" &&
+ Storage::CanDelete( p, disk, false ))
{
p["delete"] = true;
y2milestone( "remove_one_partition p %1", p );
@@ -2631,7 +2643,8 @@
``{
if( p["linux"]:false && !p["delete"]:false &&
size(p["mount"]:"")==0 &&
- p["device"]:""==pl[0,"device"]:"" )
+ p["device"]:""==pl[0,"device"]:"" &&
+ Storage::CanDelete( p, disk, false ))
{
p["delete"] = true;
nr = p["nr"]:0;
@@ -2711,7 +2724,8 @@
maplist( map p, target[s,"partitions"]:[],
``{
if( !contains( Partitions::do_not_delete,
- p["fsid"]:0 ))
+ p["fsid"]:0 ) &&
+ Storage::CanDelete( p, target[s]:$[], false))
{
if( usable_for_win_resize(p,false) )
p["dtxt"] = _("Resize impossible due to inconsistent fs. Try checking fs under Windows.");
@@ -2744,7 +2758,7 @@
foreach( string s, filter( string d, ddev, ``(valid[d]:false)),
``{
target[s,"partitions"] =
- remove_one_partition( target[s,"partitions"]:[] );
+ remove_one_partition( target[s]:$[] );
});
}
}
@@ -3499,7 +3513,8 @@
maplist( map p, target[s,"partitions"]:[],
``{
if( !contains( Partitions::do_not_delete,
- p["fsid"]:0 ))
+ p["fsid"]:0 ) &&
+ Storage::CanDelete( p, target[s]:$[], false))
{
if( usable_for_win_resize(p,false) )
p["dtxt"] = _("Resize impossible due to inconsistent fs. Try checking fs under Windows.");
Modified: trunk/storage/storage/src/include/evms_lib.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/evms…
==============================================================================
--- trunk/storage/storage/src/include/evms_lib.ycp (original)
+++ trunk/storage/storage/src/include/evms_lib.ycp Mon Jun 25 17:48:13 2007
@@ -1323,7 +1323,7 @@
%1 is not a logical volume produced by a container.
"), device ));
}
- else if( check_device_delete( part, false, Mode::installation(), [] ))
+ else if( check_device_delete( part, false, Mode::installation(), $[] ))
{
string txt = sformat( _("Really delete %1?"), part["device"]:"" );
if( Popup::YesNo( txt ) )
Modified: trunk/storage/storage/src/include/signatures.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/include/sign…
==============================================================================
--- trunk/storage/storage/src/include/signatures.ycp (original)
+++ trunk/storage/storage/src/include/signatures.ycp Mon Jun 25 17:48:13 2007
@@ -11,7 +11,7 @@
boolean CheckFstabOptions( map part );
symbol check_devices_used( list<map> partitions, boolean not_cr );
boolean check_device_delete( map curr_part, boolean bsd_label,
- boolean installation, list<map> pl );
+ boolean installation, map disk );
list<map> get_possible_pvs( map<string,map> targetMap );
map DlgCreateVolumeGroup( list vgm_list );
void new_vg_list( list vg_list );
Modified: trunk/storage/storage/src/inst_custom_part.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_custom_…
==============================================================================
--- trunk/storage/storage/src/inst_custom_part.ycp (original)
+++ trunk/storage/storage/src/inst_custom_part.ycp Mon Jun 25 17:48:13 2007
@@ -3154,7 +3154,7 @@
}
else if( part["type"]:`unknown==`lvm )
{
- if( !check_device_delete( part, false, Stage::initial(), [] ))
+ if( !check_device_delete( part, false, Stage::initial(), $[] ))
{
ret = `again;
continue;
@@ -3185,7 +3185,7 @@
}
if( part["type"]:`primary != `extended &&
!check_device_delete( part, bsd_label, Stage::initial(),
- disk["partitions"]:[] ))
+ disk ))
{
ret = `again;
continue;
Modified: trunk/storage/storage/src/inst_lvm_lv.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_lvm_lv.…
==============================================================================
--- trunk/storage/storage/src/inst_lvm_lv.ycp (original)
+++ trunk/storage/storage/src/inst_lvm_lv.ycp Mon Jun 25 17:48:13 2007
@@ -253,7 +253,7 @@
else
{
map Lv = Storage::GetPartition( targetMap, id );
- if( !check_device_delete( Lv, false, Stage::initial(), []))
+ if( !check_device_delete( Lv, false, Stage::initial(), $[]))
{
ret = `again;
continue;
Modified: trunk/storage/storage/src/inst_target_part.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/inst_target_…
==============================================================================
--- trunk/storage/storage/src/inst_target_part.ycp (original)
+++ trunk/storage/storage/src/inst_target_part.ycp Mon Jun 25 17:48:13 2007
@@ -207,6 +207,21 @@
if( target["label"]:""!="msdos" && !Storage::BootEvms() )
UI::ChangeWidget( `id(`evms), `Enabled, false );
}
+ boolean disable_full = false;
+ foreach( map p, partitions,
+ ``{
+ y2milestone( "p:%1", p );
+ if( p["type"]:`unknown!=`extended && !Storage::CanDelete( p, target, false ))
+ {
+ if( UI::WidgetExists( `id(p["ui_id"]:0) ))
+ {
+ UI::ChangeWidget( `id(p["ui_id"]:0), `Enabled, false );
+ disable_full = true;
+ }
+ }
+ });
+ if( disable_full && UI::WidgetExists( `id(`full) ))
+ UI::ChangeWidget( `id(`full), `Enabled, false );
// Event handling
Modified: trunk/storage/storage/src/modules/Storage.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/storage/src/modules/Stor…
==============================================================================
--- trunk/storage/storage/src/modules/Storage.ycp (original)
+++ trunk/storage/storage/src/modules/Storage.ycp Mon Jun 25 17:48:13 2007
@@ -167,6 +167,7 @@
boolean proposal_lvm = false;
boolean proposal_home = false;
map cfg_xml = $[];
+string part_insts = "";
/*
@@ -2083,11 +2084,23 @@
StorageMap[targets_backup_key] = $[];
StorageMap[targets_backup_l_key] = $[];
StorageMap[targets_backup_m_key] = $[];
- if( Mode::normal () )
+ if( Mode::normal() )
{
Storage::SetPartMode( "CUSTOM" );
Storage::SetPartProposalActive( false );
}
+ if( Stage::initial() )
+ {
+ string inst = (string) SCR::Read( .etc.install_inf.Partition );
+ if( inst!=nil && size(inst)>0 )
+ {
+ part_insts = "/dev/" + inst;
+ y2milestone( "Storage .etc.install_inf.Partition \"%1\" part_insts:%2",
+ inst, part_insts );
+ }
+ Storage::SetPartMode( "CUSTOM" );
+ Storage::SetPartProposalActive( false );
+ }
InstallCallbacks();
}
@@ -3607,6 +3620,106 @@
return( ret );
}
+global boolean CanEdit( map p, boolean verbose )
+ {
+ boolean ret = true;
+ if( Stage::initial() )
+ {
+ if( !p["created"]:false && !p["inactive"]:false &&
+ p["mount"]:""=="swap" )
+ {
+ ret = false;
+ y2milestone( "CanEdit p:%1", p );
+ if( verbose )
+ {
+ string txt = sformat( _("
+Device %1 cannot be modified because it contains activated swap
+that is needed to run the installation.
+"), p["device"]:"" );
+ Popup::Message( txt );
+ }
+ }
+ if( size(part_insts)>0 && p["device"]:""==part_insts )
+ {
+ ret = false;
+ y2milestone( "CanEdit part_insts:%1 p:%2", part_insts, p );
+ if( verbose )
+ {
+ string txt = sformat( _("
+Device %1 cannot be modified because it contains the installation
+data needed to perform the installation.
+"), p["device"]:"" );
+ Popup::Message( txt );
+ }
+ }
+ }
+ y2milestone( "CanEdit dev:%1 verbose:%2 ret:%3", p["device"]:"",
+ verbose, ret );
+ return( ret );
+ }
+
+global boolean CanDelete( map p, map disk, boolean verbose )
+ {
+ string txt = "";
+ boolean ret = CanEdit( p, false );
+ if( !ret && verbose )
+ {
+ if( p["mount"]:""=="swap" )
+ {
+ txt = sformat( _("
+Device %1 cannot be removed because it contains activated swap
+that is needed to run the installation.
+"), p["device"]:"" );
+ }
+ else
+ {
+ txt = sformat( _("
+Device %1 cannot be removed because it contains the installation
+data needed to perform the installation.
+"), p["device"]:"" );
+ }
+ Popup::Message( txt );
+ }
+ if( ret && (p["type"]:`unknown == `logical||
+ p["type"]:`unknown == `extended) )
+ {
+ integer num = p["type"]:`unknown == `extended ? 4 : p["nr"]:4;
+ list<map> pl = filter( map q, disk["partitions"]:[],
+ ``( q["type"]:`unknown==`logical &&
+ q["nr"]:0 > num ));
+ y2milestone( "CanDelete pl:%1", pl );
+ integer pos = 0;
+ while( ret && pos<size(pl) )
+ {
+ ret = CanEdit( pl[pos]:$[], false );
+ if( ret )
+ pos = pos+1;
+ }
+ if( !ret && verbose )
+ {
+ if( p["mount"]:""=="swap" )
+ {
+ txt = sformat( _("
+Device %1 cannot be removed because this would indirectly change
+device %2 which contains activated swap that is needed to run
+the installation.
+"), p["device"]:"", pl[pos,"device"]:"" );
+ }
+ else
+ {
+ txt = sformat( _("
+Device %1 cannot be removed because this would indirectly change
+device %2 which contains data needed to perform the installation.
+"), p["device"]:"", pl[pos,"device"]:"" );
+ }
+ Popup::Message( txt );
+ }
+ }
+ y2milestone( "CanDelete dev:%1 verbose:%2 ret:%3", p["device"]:"",
+ verbose, ret );
+ return( ret );
+ }
+
global list ReadFstab( string dir )
{
list ret = [];
@@ -6129,19 +6242,7 @@
no_propose_disks = [];
if( Stage::initial() && SCR::Read( .target.size, "/etc/install.inf" )>0 )
{
- string inst = (string) SCR::Read( .etc.install_inf.Partition );
- y2milestone( "NoProposeDisks .etc.install_inf.Partition \"%1\"",
- inst );
- if( inst!=nil && size(inst)>0 )
- {
- if( search( inst, "/dev/" )!=0 )
- inst = "/dev/" + inst;
- map d = GetDiskPartition( inst );
- y2milestone( "NoProposeDisks inst:%1 disk:%2", inst, d );
- if( size(d["disk"]:"")>0 )
- no_propose_disks = add( no_propose_disks, d["disk"]:"" );
- }
- inst = (string) SCR::Read( .etc.install_inf.Cdrom );
+ string inst = (string) SCR::Read( .etc.install_inf.Cdrom );
y2milestone( "NoProposeDisks .etc.install_inf.Cdrom \"%1\"", inst );
if( inst!=nil && size(inst)>0 )
{
--
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] r39012 - in /trunk/storage: libstorage/src/Volume.cc package/yast2-storage.changes
by fehr@svn.opensuse.org 25 Jun '07
by fehr@svn.opensuse.org 25 Jun '07
25 Jun '07
Author: fehr
Date: Mon Jun 25 17:42:38 2007
New Revision: 39012
URL: http://svn.opensuse.org/viewcvs/yast?rev=39012&view=rev
Log:
fixed problem mounting filesystem in inst-sys (#286686)
Modified:
trunk/storage/libstorage/src/Volume.cc
trunk/storage/package/yast2-storage.changes
Modified: trunk/storage/libstorage/src/Volume.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/libstorage/src/Volume.cc…
==============================================================================
--- trunk/storage/libstorage/src/Volume.cc (original)
+++ trunk/storage/libstorage/src/Volume.cc Mon Jun 25 17:42:38 2007
@@ -2368,8 +2368,12 @@
ret = fstab->flush();
}
}
- if( ret==0 && !format && mp==orig_mp && mp!="swap" )
+ if( ret==0 && !format && !cont->getStorage()->instsys() &&
+ fstab_opt!=orig_fstab_opt && !orig_fstab_opt.empty() &&
+ mp==orig_mp && mp!="swap" )
{
+ y2mil( "fstab_opt:" << fstab_opt << " fstab_opt_orig:" << orig_fstab_opt );
+ y2mil( "remount:" << *this );
int r = umount( mp );
y2mil( "remount umount:" << r );
if( r==0 )
Modified: trunk/storage/package/yast2-storage.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/storage/package/yast2-storage.ch…
==============================================================================
--- trunk/storage/package/yast2-storage.changes (original)
+++ trunk/storage/package/yast2-storage.changes Mon Jun 25 17:42:38 2007
@@ -1,4 +1,9 @@
-------------------------------------------------------------------
+Mon Jun 25 17:41:27 CEST 2007 - fehr(a)suse.de
+
+- fixed problem mounting filesystem in inst-sys (#286686)
+
+-------------------------------------------------------------------
Mon Jun 18 12:48:04 CEST 2007 - fehr(a)suse.de
- add menu extry to call iSCSI client setup (#278554)
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0