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] r39041 - in /trunk/live-installer/src: LiveInstaller.ycp Makefile.am complex.ycp control/live-install.xml dialogs.ycp helps.ycp live-installer.ycp live_copy_files_finish.ycp live_doit.ycp wizards.ycp
by jsrain@svn.opensuse.org 27 Jun '07
by jsrain@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: jsrain
Date: Wed Jun 27 10:40:12 2007
New Revision: 39041
URL: http://svn.opensuse.org/viewcvs/yast?rev=39041&view=rev
Log:
Updated, nearly working version
Added:
trunk/live-installer/src/live_copy_files_finish.ycp
Removed:
trunk/live-installer/src/complex.ycp
trunk/live-installer/src/dialogs.ycp
trunk/live-installer/src/helps.ycp
trunk/live-installer/src/wizards.ycp
Modified:
trunk/live-installer/src/LiveInstaller.ycp
trunk/live-installer/src/Makefile.am
trunk/live-installer/src/control/live-install.xml
trunk/live-installer/src/live-installer.ycp
trunk/live-installer/src/live_doit.ycp
Modified: trunk/live-installer/src/LiveInstaller.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/LiveInstaller…
==============================================================================
--- trunk/live-installer/src/LiveInstaller.ycp (original)
+++ trunk/live-installer/src/LiveInstaller.ycp Wed Jun 27 10:40:12 2007
@@ -33,17 +33,11 @@
{
module "LiveInstaller";
-textdomain "live-installer";
-
-import "ProductControl";
+textdomain "live-installer";
global string live_control_file =
"/etc/YaST2/live-install.xml";
-global void LiveInstaller()
-{
-}
-
/* EOF */
}
Modified: trunk/live-installer/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/Makefile.am?r…
==============================================================================
--- trunk/live-installer/src/Makefile.am (original)
+++ trunk/live-installer/src/Makefile.am Wed Jun 27 10:40:12 2007
@@ -4,16 +4,7 @@
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
+ live_doit.ycp
desktop_DATA = \
live-installer.desktop
@@ -26,6 +17,6 @@
ln -sf . $@
ycpchook = live-installer
-EXTRA_DIST = $(client_DATA) $(ynclude_DATA) $(module_DATA) $(desktop_DATA)
+EXTRA_DIST = $(client_DATA) $(module_DATA) $(desktop_DATA)
include $(top_srcdir)/Makefile.am.common
Modified: trunk/live-installer/src/control/live-install.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/control/live-…
==============================================================================
--- trunk/live-installer/src/control/live-install.xml (original)
+++ trunk/live-installer/src/control/live-install.xml Wed Jun 27 10:40:12 2007
@@ -76,11 +76,44 @@
</congratulate>
</texts>
+ <inst_finish_stages config:type="list">
+ <inst_finish_stage>
+ <label>Copy files to installed system"</label>
+ <steps config:type="list">
+ <step>live_copy_files</step>
+ <step>switch_scr</step>
+ </steps>
+ </inst_finish_stage>
+ <inst_finish_stage>
+ <label>Save configuration</label>
+ <steps config:type="list">
+ <step>ldconfig</step>
+ </steps>
+ </inst_finish_stage>
+ <inst_finish_stage>
+ <label>Install boot manager"</label>
+ <steps config:type="list">
+ <step>bootloader</step>
+ </steps>
+ </inst_finish_stage>
+ <inst_finish_stage>
+ <label>Prepare system for initial boot"</label>
+ <steps config:type="list">
+<!--
+ copy logs just before 'umount'
+ keeps maximum logs available after reboot
+-->
+ <step>copy_logs</step>
+ <step>umount</step>
+ </steps>
+ </inst_finish_stage>
+ </inst_finish_stages>
+
<proposals config:type="list">
<proposal>
<label>Live Installation Settings</label>
<mode>installation</mode>
- <stage>normal</stage>
+ <stage>initial</stage>
<name>initial</name>
<enable_skip>no</enable_skip>
<proposal_modules config:type="list">
@@ -101,8 +134,8 @@
</defaults>
<label>Installation</label>
<mode>installation</mode>
- <stage>normal</stage>
- <modules config:type="list">
+ <stage>initial</stage>
+ <modules config:type="list">
<module>
<label>Installation Summary</label>
<name>inst_proposal</name>
@@ -110,10 +143,6 @@
</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>
@@ -128,17 +157,13 @@
</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>
+ <name>inst_finish</name>
<enable_back>no</enable_back>
</module>
</modules>
Modified: trunk/live-installer/src/live-installer.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/live-installe…
==============================================================================
--- trunk/live-installer/src/live-installer.ycp (original)
+++ trunk/live-installer/src/live-installer.ycp Wed Jun 27 10:40:12 2007
@@ -21,13 +21,12 @@
Installation::destdir = "/mnt";
Installation::scr_destdir = "/mnt";
- list<map> stage_mode = [$["stage": "normal", "mode": "installation" ]];
+ list<map> stage_mode = [$["stage": "initial", "mode": "installation" ]];
y2internal ("SM: %1", stage_mode);
Mode::SetMode ("installation");
- // required in order to make Storage.ycp honor Installation::destdir
+ // Stage::initial is required for most of the modules to behave correctly
Stage::Set ("initial");
Storage::InitLibstorage ();
- Stage::Set ("normal");
ProductControl::custom_control_file = LiveInstaller::live_control_file;
if (!ProductControl::Init())
Added: trunk/live-installer/src/live_copy_files_finish.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/live-installer/src/live_copy_fil…
==============================================================================
--- trunk/live-installer/src/live_copy_files_finish.ycp (added)
+++ trunk/live-installer/src/live_copy_files_finish.ycp Wed Jun 27 10:40:12 2007
@@ -0,0 +1,93 @@
+/**
+ * File:
+ * copy_files_finish.ycp
+ *
+ * Module:
+ * Step of base installation finish
+ *
+ * Authors:
+ * Jiri Srain <jsrain(a)suse.cz>
+ *
+ * $Id: copy_files_finish.ycp 38430 2007-06-13 13:50:38Z locilka $
+ *
+ */
+
+{
+
+textdomain "installation";
+
+import "Installation";
+import "Directory";
+import "ProductControl";
+import "FileUtils";
+import "String";
+import "SystemFilesCopy";
+
+include "installation/misc.ycp";
+
+any ret = nil;
+string func = "";
+map param = $[];
+
+/* Check arguments */
+if(size(WFM::Args()) > 0 && is(WFM::Args(0), string)) {
+ func = (string)WFM::Args(0);
+ if(size(WFM::Args()) > 1 && is(WFM::Args(1), map))
+ param = (map)WFM::Args(1);
+}
+
+y2milestone ("live_starting copy_files_finish");
+y2debug("func=%1", func);
+y2debug("param=%1", param);
+
+if (func == "Info")
+{
+ return (any)$[
+ "steps" : 1,
+ // progress step title
+ "title" : _("Copying files to installed system..."),
+ "when" : [ `installation, `update, `autoinst ],
+ ];
+}
+else if (func == "Write")
+{
+ // bugzilla #221815
+ // Adding blacklisted modules into the /etc/modprobe.d/blacklist
+ // This should run before the SCR::switch function
+ AdjustModprobeBlacklist();
+
+ // Copy control.xml so it can be read once again during continue mode
+ SCR::Execute (.target.bash, "/bin/cp " + ProductControl::current_control_file + " " +
+ "'" + String::Quote (Installation::destdir) + Directory::etcdir + "/control.xml'");
+ SCR::Execute (.target.bash, "/bin/chmod 0644 " +
+ "'" + String::Quote (Installation::destdir) + Directory::etcdir + "/control.xml'");
+
+ // Copy files from inst-sys to the just installed system
+ // FATE #301937, items are defined in the control file
+ SystemFilesCopy::SaveInstSysContent();
+
+ // Remove old eula.txt
+ // bugzilla #208908
+ string eula_txt = sformat ("%1%2/eula.txt", Installation::destdir, Directory::etcdir);
+ if (FileUtils::Exists (eula_txt)) {
+ SCR::Execute (.target.remove, eula_txt);
+ }
+
+ // Copy info.txt so it can be used in firstboot (new eula.txt)
+ if (FileUtils::Exists ("/info.txt"))
+ {
+ SCR::Execute (.target.bash, sformat("/bin/cp /info.txt %1", eula_txt));
+ }
+}
+else
+{
+ y2error ("unknown function: %1", func);
+ ret = nil;
+}
+
+y2debug("ret=%1", ret);
+y2milestone("live_copy_files_finish finished");
+return ret;
+
+
+} /* EOF */
Modified: 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 (original)
+++ trunk/live-installer/src/live_doit.ycp Wed Jun 27 10:40:12 2007
@@ -39,7 +39,7 @@
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);
+// y2milestone ("Result: %1", out);
return out["exit"]:-1 == 0;
}
@@ -49,9 +49,9 @@
*/
list<string> LinksToCopyList () {
string cmd = sformat ("
- for LINK in `find %1 -type l -xdev` ; do
+ for LINK in `find %1 -xdev -type l` ; do
stat -c \"%%N\" $LINK |grep livecd >/devnull 2>/devnull && echo $LINK;
- done", Installation::destdir);
+ done; exit 0", Installation::destdir);
y2milestone ("Executing %1", cmd);
map out = (map)SCR::Execute (.target.bash_output, cmd);
y2milestone ("Result: %1", out);
--
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] r39040 - /branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
by dmacvicar@svn.opensuse.org 27 Jun '07
by dmacvicar@svn.opensuse.org 27 Jun '07
27 Jun '07
Author: dmacvicar
Date: Wed Jun 27 10:27:03 2007
New Revision: 39040
URL: http://svn.opensuse.org/viewcvs/yast?rev=39040&view=rev
Log:
shut down the interpreter
Modified:
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc Wed Jun 27 10:27:03 2007
@@ -63,7 +63,10 @@
}
YRuby::~YRuby()
-{}
+{
+ y2milestone( "Shutting down ruby interpreter." );
+ ruby_finalize();
+}
YRuby *
@@ -79,8 +82,6 @@
YCPValue
YRuby::destroy()
{
- y2milestone( "Shutting down embedded Ruby interpreter." );
-
if ( _yRuby )
delete _yRuby;
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r39039 - in /branches/tmp/dmacvicar/ruby-yast: CMakeLists.txt cmake/modules/FindYast.cmake examples/ruby/ycp_from_ruby.rb src/ruby/YRuby.cc
by dmacvicar@svn.opensuse.org 26 Jun '07
by dmacvicar@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: dmacvicar
Date: Wed Jun 27 00:22:26 2007
New Revision: 39039
URL: http://svn.opensuse.org/viewcvs/yast?rev=39039&view=rev
Log:
- fix function calling
- fix 64 bit path
Modified:
branches/tmp/dmacvicar/ruby-yast/CMakeLists.txt
branches/tmp/dmacvicar/ruby-yast/cmake/modules/FindYast.cmake
branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
Modified: branches/tmp/dmacvicar/ruby-yast/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/CMake…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/CMakeLists.txt (original)
+++ branches/tmp/dmacvicar/ruby-yast/CMakeLists.txt Wed Jun 27 00:22:26 2007
@@ -1,4 +1,16 @@
PROJECT(yast2-bindings)
+
+# Library
+IF ( DEFINED LIB )
+ SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/${LIB}" )
+ELSE ( DEFINED LIB )
+ IF (CMAKE_SIZEOF_VOID_P MATCHES "8")
+ SET( LIB_SUFFIX "64" )
+ ENDIF(CMAKE_SIZEOF_VOID_P MATCHES "8")
+ SET ( LIB_INSTALL_DIR "${CMAKE_INSTALL_PREFIX}/lib${LIB_SUFFIX}" )
+ENDIF ( DEFINED LIB )
+MESSAGE(STATUS "Libraries will be installed in ${LIB_INSTALL_DIR}" )
+
# where to look first for cmake modules, before ${CMAKE_ROOT}/Modules/ is checked
SET(CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/modules ${CMAKE_MODULE_PATH})
#SET(CMAKE_MODULE_PATH ${CMAKE_INSTALL_PREFIX}/share/cmake/Modules ${CMAKE_MODULE_PATH})
Modified: branches/tmp/dmacvicar/ruby-yast/cmake/modules/FindYast.cmake
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/cmake…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/cmake/modules/FindYast.cmake (original)
+++ branches/tmp/dmacvicar/ruby-yast/cmake/modules/FindYast.cmake Wed Jun 27 00:22:26 2007
@@ -14,7 +14,7 @@
/usr/local/include/YaST2
)
-SET(YAST_PLUGIN_DIR ${CMAKE_INSTALL_PREFIX}/lib/YaST2/plugin)
+SET(YAST_PLUGIN_DIR ${LIB_INSTALL_DIR}/YaST2/plugin)
FIND_LIBRARY(YAST_LIBRARY NAMES y2
PATHS
Modified: branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb (original)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/ycp_from_ruby.rb Wed Jun 27 00:22:26 2007
@@ -1,14 +1,14 @@
require 'yast'
-# m = YaST::Module.new("Arch")
-# puts m.sparc32
-# puts m.arch_short
-# puts m.is_xen
+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 |
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc Wed Jun 27 00:22:26 2007
@@ -128,19 +128,24 @@
return YCPVoid();
}
+ // first element of the list is ignored
int size = argList.size();
+ // make rooms for size-1 arguments to
+ // the ruby function
VALUE values[size-1];
- int i=1;
- for ( ; i < size; ++i )
+ int i=0;
+ for ( ; i < size-1; ++i )
{
- YCPValue v = argList->value(i);
- y2milestone("Adding argument of type %s", v->valuetype_str());
+ // get the
+ YCPValue v = argList->value(i+1);
+ y2milestone("Adding argument %d of type %s", i, v->valuetype_str());
values[i] = ycpvalue_2_rbvalue(v);
}
- y2milestone( "Wll call function '%s' in module '%s' with '%d' arguments", function.c_str(), module_name.c_str(), size);
- VALUE result = rb_funcall( module, rb_intern(function.c_str()), size-1, values );
+ y2milestone( "Wll call function '%s' in module '%s' with '%d' arguments", function.c_str(), module_name.c_str(), size-1);
+ VALUE result = rb_funcall2( module, rb_intern(function.c_str()), size-1, values );
+ //VALUE result = rb_funcall( module, rb_intern(function.c_str()), 2, INT2NUM(2), INT2NUM(3) );
y2milestone( "Called function '%s' in module '%s'", function.c_str(), module_name.c_str());
return rbvalue_2_ycpvalue(result);
}
--
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] r39038 - in /branches/tmp/sh/mod-ui: core/libyui/src/ qt/src/
by sh-sh-sh@svn.opensuse.org 26 Jun '07
by sh-sh-sh@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: sh-sh-sh
Date: Tue Jun 26 17:43:04 2007
New Revision: 39038
URL: http://svn.opensuse.org/viewcvs/yast?rev=39038&view=rev
Log:
migrated PkgSpecial
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
branches/tmp/sh/mod-ui/qt/src/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/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 Tue Jun 26 17:43:04 2007
@@ -2429,9 +2429,9 @@
}
rejectAllOptions( term,optList );
- YCPString subwidget = term->value( argnr )->asString();
+ string subwidgetName = term->value( argnr )->asString()->value();
- return YUI::ui()->createPkgSpecial( parent, opt, subwidget );
+ return YUI::widgetFactory()->createPkgSpecial( parent, subwidgetName );
}
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 Tue Jun 26 17:43:04 2007
@@ -460,7 +460,6 @@
virtual YWidget *createImage( YWidget *parent, YWidgetOpt & opt, YCPString file_name, YCPString defaulttext ) = 0;
virtual YWidget *createIntField( YWidget *parent, YWidgetOpt & opt, const YCPString & label, int minValue, int maxValue, int initialValue ) = 0;
virtual YWidget *createPackageSelector( YWidget *parent, YWidgetOpt & opt, const YCPString & floppyDevice ) = 0;
- virtual YWidget *createPkgSpecial( YWidget *parent, YWidgetOpt & opt, const YCPString & subwidget ) = 0;
// FIXME: Obsolete
// FIXME: Obsolete
// FIXME: Obsolete
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YWidgetFactory.h Tue Jun 26 17:43:04 2007
@@ -42,7 +42,6 @@
class YMenuButton;
class YMultiLineEdit;
class YPackageSelector;
-class YPkgSpecial;
class YProgressBar;
class YPushButton;
class YRadioButton;
@@ -117,7 +116,7 @@
virtual YSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label ) = 0;
virtual YPackageSelector * createPackageSelector ( YWidget * parent ) = 0;
- virtual YPkgSpecial * createPkgSpecial ( YWidget * parent ) = 0; // NCurses only
+ virtual YWidget * createPkgSpecial ( YWidget * parent, const string & subwidgetName ) = 0; // NCurses only
//
// Layout Helpers
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 Tue Jun 26 17:43:04 2007
@@ -444,8 +444,6 @@
/*** Widget creation methods, all reimplemented from YUI ***/
- YContainerWidget * createWeight ( YWidget * parent, YWidgetOpt & opt, YUIDimension dim, long weight);
-
YWidget * createComboBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createImage ( YWidget * parent, YWidgetOpt & opt, YCPByteblock imageData, YCPString fallbackText );
YWidget * createImage ( YWidget * parent, YWidgetOpt & opt, YCPString fileName, YCPString fallbackText );
@@ -460,7 +458,6 @@
YWidget * createMultiSelectionBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createTable ( YWidget * parent, YWidgetOpt & opt, vector<string> header);
YWidget * createTree ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
- YWidget * createPkgSpecial ( YWidget * parent, YWidgetOpt & opt, const YCPString & subwidget );
/*** Widget creation methods for optional widgets, all reimplemented from YUI ***/
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 Tue Jun 26 17:43:04 2007
@@ -136,14 +136,6 @@
}
-YWidget * YQUI::createPkgSpecial ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & subwidget )
-{
- y2error( "The Qt UI does not support PkgSpecial subwidgets!" );
- return 0;
-}
-
YWidget * YQUI::createMenuButton ( YWidget * parent,
YWidgetOpt & opt,
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 Tue Jun 26 17:43:04 2007
@@ -255,8 +255,8 @@
-YPkgSpecial *
-YQWidgetFactory::createPkgSpecial( YWidget * parent )
+YWidget *
+YQWidgetFactory::createPkgSpecial( YWidget * , const string & )
{
YUI_THROW( YUIUnsupportedWidgetException( "YQPkgSpecial" ) ); // NCurses only
return 0;
Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidget…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h Tue Jun 26 17:43:04 2007
@@ -106,7 +106,7 @@
virtual YQSelectionBox * createMultiSelectionBox ( YWidget * parent, const string & label );
virtual YQPackageSelector * createPackageSelector ( YWidget * parent );
- virtual YPkgSpecial * createPkgSpecial ( YWidget * parent ); // NCurses only, will throw exception in the Qt UI
+ virtual YWidget * createPkgSpecial ( YWidget * parent, const string & name ); // 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] r39037 - in /branches/tmp/dmacvicar/ruby-yast: examples/ruby/ src/ruby/
by dmacvicar@svn.opensuse.org 26 Jun '07
by dmacvicar@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: dmacvicar
Date: Tue Jun 26 17:34:54 2007
New Revision: 39037
URL: http://svn.opensuse.org/viewcvs/yast?rev=39037&view=rev
Log:
all parsing and instrospection done. I am in the point where I call
the function. And it segfaults.
Added:
branches/tmp/dmacvicar/ruby-yast/examples/ruby/Duncan.rb
branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp_2.ycp
Modified:
branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp.ycp
branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc
branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.h
Added: branches/tmp/dmacvicar/ruby-yast/examples/ruby/Duncan.rb
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/Duncan.rb (added)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/Duncan.rb Tue Jun 26 17:34:54 2007
@@ -0,0 +1,20 @@
+
+module Duncan
+ def self.multiply_by_eight(a)
+ return 8*a
+ end
+
+ def self.sum(a,b)
+ return a+b;
+ end
+
+ def self.hello(name)
+ puts "hello #{name}"
+ end
+
+ def self.noop
+ end
+
+end
+
+
Modified: 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 (original)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp.ycp Tue Jun 26 17:34:54 2007
@@ -1,7 +1,7 @@
{
import "Duncan";
- string result = multiply_by_eight(10);
+ string result = (string) multiply_by_eight(10);
UI::OpenDialog(
`VBox(
`Label(result),
Added: branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp_2.ycp
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/examp…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp_2.ycp (added)
+++ branches/tmp/dmacvicar/ruby-yast/examples/ruby/ruby_from_ycp_2.ycp Tue Jun 26 17:34:54 2007
@@ -0,0 +1,14 @@
+
+{
+ import "Duncan";
+ //integer result = (integer) Duncan::multiply_by_eight(6);
+ integer result2 = (integer) Duncan::sum(2,3);
+ UI::OpenDialog(
+ `VBox(
+ `Label(sformat("%1", result2)),
+ `PushButton("OK")
+ )
+ );
+ UI::UserInput();
+ UI::CloseDialog();
+}
\ No newline at end of file
Modified: 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 (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/Y2RubyComponent.cc Tue Jun 26 17:34:54 2007
@@ -43,7 +43,7 @@
module.erase (module.size () - 3 /* strlen (".pm") */);
YCPList args;
args->add (YCPString(/*module*/ name));
-
+ args->add (YCPString(/*module*/ module));
// load it
YRuby::loadModule (args);
y2milestone("Module '%s' loaded", name);
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRuby.cc Tue Jun 26 17:34:54 2007
@@ -33,6 +33,8 @@
#define YCP_EXTERNAL_MAGIC "Reference to perl object (v1.0)"
+#include "Y2RubyTypeConv.h"
+
static void prependModulePath()
{
YCPPathSearch::initialize ();
@@ -93,16 +95,20 @@
YCPValue
YRuby::loadModule( YCPList argList )
{
- y2milestone("loadModule 1");
- if ( argList->size() != 1 || ! argList->value(0)->isString() )
+ YRuby::yRuby();
+ //y2milestone("loadModule 1");
+ if ( argList->size() != 2 || ! argList->value(0)->isString() || ! argList->value(1)->isString() )
return YCPError( "Ruby::loadModule() / Ruby::Use() : Bad arguments: String expected!" );
- y2milestone("loadModule 2");
+ //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");
+ string module_path = argList->value(1)->asString()->value();
+ //y2milestone("loadModule 3: '%s'", module_name.c_str());
+ string require_module = "require(\"" + module_path + "\")";
+ //y2milestone("loadModule 3.5");
+ VALUE result = rb_eval_string((require_module).c_str());
+ if ( result = Qfalse )
+ return YCPError( "Ruby::loadModule() / Can't load ruby module '" + module_path + "'" );
+ //y2milestone("loadModule 4");
return YCPVoid();
}
@@ -112,10 +118,30 @@
* @param argList arguments start 1!, 0 is dummy
*/
YCPValue
-YRuby::callInner (string module, string function, bool method,
+YRuby::callInner (string module_name, 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();
+ VALUE module = rb_funcall( rb_mKernel, rb_intern("const_get"), 1, rb_str_new2(module_name.c_str()) );
+ if (module == Qnil)
+ {
+ y2error ("The Ruby module '%s' is not provided by its rb file", module_name.c_str());
+ return YCPVoid();
+ }
+
+ int size = argList.size();
+
+ VALUE values[size-1];
+ int i=1;
+ for ( ; i < size; ++i )
+ {
+ YCPValue v = argList->value(i);
+ y2milestone("Adding argument of type %s", v->valuetype_str());
+ values[i] = ycpvalue_2_rbvalue(v);
+ }
+
+ y2milestone( "Wll call function '%s' in module '%s' with '%d' arguments", function.c_str(), module_name.c_str(), size);
+ VALUE result = rb_funcall( module, rb_intern(function.c_str()), size-1, values );
+ y2milestone( "Called function '%s' in module '%s'", function.c_str(), module_name.c_str());
+ return rbvalue_2_ycpvalue(result);
}
Modified: branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/dmacvicar/ruby-yast/src/r…
==============================================================================
--- branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.cc Tue Jun 26 17:34:54 2007
@@ -92,6 +92,7 @@
*/
virtual bool appendParameter (const YCPValue& arg)
{
+ y2milestone("Adding parameter to function %s::%s of type %s", m_module_name.c_str(), m_local_name.c_str(), arg->valuetype_str());
m_call->add (arg);
return true;
}
@@ -160,7 +161,10 @@
m_all_methods (true)
{
y2milestone("Creating namespace for '%s'", name.c_str());
- VALUE methods_in_module = rb_eval_string(("require(\"" + name + "\")").c_str());
+
+ //y2milestone("loadModule 3.5");
+ //VALUE result = rb_eval_string((require_module).c_str());
+
VALUE module = rb_funcall( rb_mKernel, rb_intern("const_get"), 1, rb_str_new2(name.c_str()) );
if (module == Qnil)
{
@@ -168,6 +172,74 @@
return;
}
y2milestone("The module '%s' was found", name.c_str());
+
+ // we will perform operator- to determine the module methods
+ VALUE moduleklassmethods = rb_funcall( rb_cModule, rb_intern("methods"), 0);
+ VALUE mymodulemethods = rb_funcall( module, rb_intern("methods"), 0);
+ VALUE methods = rb_funcall( mymodulemethods, rb_intern("-"), 1, moduleklassmethods );
+
+ if (methods == Qnil)
+ {
+ y2error ("Can't see methods in module '%s'", name.c_str());
+ return;
+ }
+
+ int i;
+ for(i = 0; i < RARRAY(methods)->len; i++)
+ {
+ VALUE current = RARRAY(methods)->ptr[i];
+ y2milestone("New method: '%s'", RSTRING(current)->ptr);
+
+ constTypePtr sym_tp = Type::Unspec;
+ //sym_tp = parseTypeinfo (*sym_ti)
+ if (sym_tp->isError ())
+ {
+ y2error ("Cannot parse $TYPEINFO{%s}", RSTRING(current)->ptr);
+ continue;
+ }
+ if (sym_tp->isUnspec ())
+ {
+ //sym_tp = new FunctionType (Type::Any, new FunctionType(Type::Any) );
+ // figure out arity.
+ y2milestone("1.");
+ Check_Type(module,T_MODULE);
+ VALUE methodobj = rb_funcall( module, rb_intern("method"), 1, current );
+ //VALUE methodobj = rb_funcall( module, rb_intern("send"), 2, rb_str_new2("method"), current );
+ if ( methodobj == Qnil )
+ {
+ y2error ("Cannot access method object '%s'", RSTRING(current)->ptr);
+ continue;
+ }
+ y2milestone("2.");
+ string signature = "any( ";
+ VALUE rbarity = rb_funcall( methodobj, rb_intern("arity"), 0);
+ y2milestone("3.");
+ int arity = NUM2INT(rbarity);
+ for ( int k=0; k < arity; ++k )
+ {
+ signature += "any";
+ if ( k < (arity - 1) )
+ signature += ",";
+ }
+ signature += ")";
+ y2milestone("going to parse signature: '%s'", signature.c_str());
+ sym_tp = Type::fromSignature(signature);
+ }
+
+ constFunctionTypePtr fun_tp = (constFunctionTypePtr) sym_tp;
+
+ // symbol entry for the function
+ SymbolEntry *fun_se = new SymbolEntry ( this,
+ i,// position. arbitrary numbering. must stay consistent when?
+ RSTRING(current)->ptr, // passed to Ustring, no need to strdup
+ SymbolEntry::c_function,
+ sym_tp);
+ fun_se->setGlobal (true);
+ // enter it to the symbol table
+ enterSymbol (fun_se, 0);
+ y2milestone("method: '%s' added", RSTRING(current)->ptr);
+ y2milestone("%s", symbolsToString().c_str());
+ }
}
YRubyNamespace::~YRubyNamespace ()
Modified: 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 (original)
+++ branches/tmp/dmacvicar/ruby-yast/src/ruby/YRubyNamespace.h Tue Jun 26 17:34:54 2007
@@ -1,3 +1,8 @@
+
+
+
+
+#include <ruby.h>
#include <y2/Y2Namespace.h>
#include <y2/Y2Function.h>
#include <ycp/YStatement.h>
@@ -31,4 +36,6 @@
virtual YCPValue evaluate (bool cse = false);
virtual Y2Function* createFunctionCall (const string name, constFunctionTypePtr requiredType);
+private:
+ VALUE _module_instance;
};
--
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] r39036 - /branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
by sh-sh-sh@svn.opensuse.org 26 Jun '07
by sh-sh-sh@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: sh-sh-sh
Date: Tue Jun 26 17:33:43 2007
New Revision: 39036
URL: http://svn.opensuse.org/viewcvs/yast?rev=39036&view=rev
Log:
change log
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/ChangeLog
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 Tue Jun 26 17:33:43 2007
@@ -194,7 +194,7 @@
* added pure virtual YWidgetFactory::createSpacing()
- Remove from derived factories:
+ Removed from derived factories:
- YWidgetFactory::createHStretch() is no longer virtual and now returns a YSpacing
- YWidgetFactory::createVStretch() is no longer virtual and now returns a YSpacing
@@ -240,3 +240,9 @@
YWidget::setFunctionKey() is called from YCPDialogParser after the widget is
created, so either use the new function in the keyboard handlers or overwrite
YWidget::setFunctionKey().
+
+* YCheckBox:
+ - getValue() -> value()
+ - no longer just boolean values, now using YCheckBoxState enum: _on, _off, _dont_care
+ - YCheckBox constructor doesn't accept an initiallyChecked value any more
+ (but derived classes should so the widgetFactory can pass it on easily)
--
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] r39035 - in /branches/tmp/sh/mod-ui: core/libyui/src/ qt/src/
by sh-sh-sh@svn.opensuse.org 26 Jun '07
by sh-sh-sh@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: sh-sh-sh
Date: Tue Jun 26 17:29:52 2007
New Revision: 39035
URL: http://svn.opensuse.org/viewcvs/yast?rev=39035&view=rev
Log:
- migrated CheckBox
- enabled special handling for not-so-standard properties
Modified:
branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.cc
branches/tmp/sh/mod-ui/core/libyui/src/YApplication.cc
branches/tmp/sh/mod-ui/core/libyui/src/YCPDialogParser.cc
branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.cc
branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.h
branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.cc
branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.h
branches/tmp/sh/mod-ui/core/libyui/src/YEmpty.cc
branches/tmp/sh/mod-ui/core/libyui/src/YFrame.cc
branches/tmp/sh/mod-ui/core/libyui/src/YFrame.h
branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc
branches/tmp/sh/mod-ui/core/libyui/src/YInputField.h
branches/tmp/sh/mod-ui/core/libyui/src/YLabel.cc
branches/tmp/sh/mod-ui/core/libyui/src/YLabel.h
branches/tmp/sh/mod-ui/core/libyui/src/YLayoutBox.cc
branches/tmp/sh/mod-ui/core/libyui/src/YProperty.cc
branches/tmp/sh/mod-ui/core/libyui/src/YProperty.h
branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc
branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h
branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.cc
branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.h
branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.cc
branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.h
branches/tmp/sh/mod-ui/core/libyui/src/YSpacing.cc
branches/tmp/sh/mod-ui/core/libyui/src/YSquash.cc
branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h
branches/tmp/sh/mod-ui/core/libyui/src/YUI_builtins.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.cc
branches/tmp/sh/mod-ui/core/libyui/src/YWidget.h
branches/tmp/sh/mod-ui/qt/src/YQCheckBox.cc
branches/tmp/sh/mod-ui/qt/src/YQCheckBox.h
branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc
branches/tmp/sh/mod-ui/qt/src/YQRadioButton.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
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YAlignment.cc Tue Jun 26 17:29:52 2007
@@ -69,7 +69,7 @@
: YSingleChildContainerWidget( parent )
, priv( new YAlignmentPrivate( horAlign, vertAlign ) )
{
- // NOP
+ YUI_CHECK_NEW( priv );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YApplication.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YApplication.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YApplication.cc Tue Jun 26 17:29:52 2007
@@ -33,7 +33,7 @@
YApplication::YApplication()
: priv( new YApplicationPrivate() )
{
-
+ YUI_CHECK_NEW( priv );
}
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 Tue Jun 26 17:29:52 2007
@@ -41,6 +41,7 @@
#include "YAlignment.h"
#include "YBarGraph.h"
+#include "YCheckBox.h"
#include "YCheckBoxFrame.h"
#include "YComboBox.h"
#include "YDumbTab.h"
@@ -1400,26 +1401,30 @@
* A checkbox widget has two states: Checked and not checked. It returns no
* user input but you can query and change its state via the <tt>Value</tt>
* property.
- *
**/
YWidget *
YCPDialogParser::parseCheckBox( YWidget * parent, YWidgetOpt & opt,
const YCPTerm & term, const YCPList & optList, int argnr )
{
- int s = term->size() - argnr;
- if ( s < 1 || s > 2
- || !term->value(argnr)->isString()
- || (s == 2 && !term->value(argnr+1)->isBoolean()))
+ int size = term->size() - argnr;
+ if ( size < 1 || size > 2
+ || !term->value( argnr )->isString()
+ || ( size == 2 && ! term->value(argnr+1)->isBoolean() ) )
{
y2error( "Invalid arguments for the CheckBox widget: %s",
term->toString().c_str() );
return 0;
}
rejectAllOptions( term,optList );
- YCPBoolean checked( false );
- if ( s == 2 ) checked = term->value( argnr+1 )->asBoolean();
- return YUI::ui()->createCheckBox( parent, opt, term->value( argnr )->asString(), checked->value() );
+
+ string label = term->value( argnr )->asString()->value();
+ bool checked = false;
+
+ if ( size == 2 )
+ checked = term->value( argnr+1 )->asBoolean()->value();
+
+ return YUI::widgetFactory()->createCheckBox( parent, label, checked );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.cc Tue Jun 26 17:29:52 2007
@@ -17,8 +17,6 @@
/-*/
-#include <ycp/YCPSymbol.h>
-#include <ycp/YCPBoolean.h>
#define y2log_component "ui"
#include <ycp/y2log.h>
@@ -27,69 +25,104 @@
#include "YCheckBox.h"
-YCheckBox::YCheckBox( const YWidgetOpt & opt, const YCPString & label )
- : YWidget( opt )
- , label( label )
+struct YCheckBoxPrivate
{
+ YCheckBoxPrivate( const string & label )
+ : label( label )
+ , useBoldFont( false )
+ {}
+
+ string label;
+ bool useBoldFont;
+};
+
+
+YCheckBox::YCheckBox( YWidget * parent, const string & label )
+ : YWidget( parent )
+ , priv( new YCheckBoxPrivate( label ) )
+{
+ YUI_CHECK_NEW( priv );
+}
+
+
+YCheckBox::~YCheckBox()
+{
+ // NOP
}
-void YCheckBox::setLabel( const YCPString & label )
+void YCheckBox::setLabel( const string & newLabel )
{
- this->label = label;
+ priv->label = newLabel;
}
-YCPString YCheckBox::getLabel()
+string YCheckBox::label() const
{
- return label;
+ return priv->label;
}
-YCPValue YCheckBox::changeWidget( const YCPSymbol & property, const YCPValue & newvalue )
+bool YCheckBox::useBoldFont() const
{
- string s = property->symbol();
+ return priv->useBoldFont;
+}
+
+
+void YCheckBox::setUseBoldFont( bool bold )
+{
+ priv->useBoldFont = bold;
+}
+
- if ( s == YUIProperty_Value )
+const YPropertySet &
+YCheckBox::propertySet()
+{
+ static YPropertySet propSet;
+
+ if ( propSet.isEmpty() )
{
- if ( newvalue->isBoolean() ||
- newvalue->isVoid() ) // -> tri-state - neither on nor off
- {
- setValue( newvalue );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "CheckBox: Invalid parameter %s for property `Value. Must be boolean or nil.",
- newvalue->toString().c_str() );
- return YCPBoolean( false );
- }
+ /*
+ * @property boolean Value the on/off state; nil for "don't care" (tristate)
+ * @property string Label the text on the CheckBox
+ */
+
+ propSet.add( YProperty( YUIProperty_Value, YOtherProperty ) );
+ propSet.add( YProperty( YUIProperty_Label, YStringProperty ) );
+ propSet.add( YWidget::propertySet() );
}
- else if ( s == YUIProperty_Label )
+
+ return propSet;
+}
+
+
+bool
+YCheckBox::setProperty( const string & propertyName, const YPropertyValue & val )
+{
+ propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
+
+ if ( propertyName == YUIProperty_Value ) return false; // need special processing
+ else if ( propertyName == YUIProperty_Label ) setLabel( val.stringVal() );
+ else
{
- if ( newvalue->isString() )
- {
- setLabel( newvalue->asString() );
- return YCPBoolean( true );
- }
- else
- {
- y2error( "CheckBox: Invalid parameter %s for property `Label. Must be string.",
- newvalue->toString().c_str() );
- return YCPBoolean( false );
- }
+ YWidget::setProperty( propertyName, val );
}
- else return YWidget::changeWidget( property, newvalue );
-}
+ return true; // success -- no special processing necessary
+}
-YCPValue YCheckBox::queryWidget( const YCPSymbol & property )
+YPropertyValue
+YCheckBox::getProperty( const string & propertyName )
{
- string s = property->symbol();
- if ( s == YUIProperty_Value ) return getValue();
- else if ( s == YUIProperty_Label ) return getLabel();
- else return YWidget::queryWidget( property );
+ propertySet().check( propertyName ); // throws exceptions if not found
+
+ if ( propertyName == YUIProperty_Value ) return YPropertyValue( YOtherProperty );
+ else if ( propertyName == YUIProperty_Label ) return YPropertyValue( label() );
+ else
+ {
+ return YWidget::getProperty( propertyName );
+ }
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCheckBox.h Tue Jun 26 17:29:52 2007
@@ -19,22 +19,35 @@
#ifndef YCheckBox_h
#define YCheckBox_h
-#include "YWidget.h"
-#include <ycp/YCPString.h>
+#include <string>
+#include "YWidget.h"
+#include "ImplPtr.h"
+using std::string;
class YMacroRecorder;
+class YCheckBoxPrivate;
+
+enum YCheckBoxState
+{
+ YCheckBox_dont_care = -1, // tristate
+ YCheckBox_off = 0,
+ YCheckBox_on = 1
+};
+
-/**
- * @short Implementation of the CheckBox widget
- **/
class YCheckBox : public YWidget
{
public:
/**
- * Constructor
+ * Constructor.
+ **/
+ YCheckBox( YWidget * parent, const string & label );
+
+ /**
+ * Destructor.
**/
- YCheckBox( const YWidgetOpt & opt, const YCPString & label );
+ virtual ~YCheckBox();
/**
* Returns a descriptive name of this widget class for logging,
@@ -42,68 +55,124 @@
**/
virtual const char * widgetClass() { return "YCheckBox"; }
-#if 0
+
/**
- * Set a property.
- * Reimplemented from YWidget.
+ * Get the current value:
*
- * This method may throw exceptions, for example
- * - if there is no property with that name
- * - if the expected type and the type mismatch
- * - if the value is out of range
+ * YCheckBox_on CheckBox is checked
+ * YCheckBox_off CheckBox is unchecked
+ *
+ * YCheckBox_dont_care tri-state: CheckBox is greyed out,
+ * neither checked nor unchecked
+ *
+ * The user cannot set YCheckBox_dont_care directly. This status is always
+ * only set from the outside, usually because a setting cannot be clearly
+ * determined. For example, a checkbox
+ *
+ * [ ] Read only
+ *
+ * would be set to "don't care" (by the application, not directly by the
+ * user) when it is to display the read-only state of a group of files
+ * where some are read-only and some are writeable.
+ *
+ * Derived classes are required to implement this function.
+ * (Intentionally not const)
**/
- virtual void setProperty( const YProperty & prop );
+ virtual YCheckBoxState value() = 0;
/**
- * Get a property.
- * Reimplemented from YWidget.
+ * Set the CheckBox value (on/off/don't care).
*
- * This method may throw exceptions, for example
- * - if there is no property with that name
+ * Derived classes are required to implement this.
**/
- virtual YProperty getProperty( const std::string & propertyName );
-#endif
-
+ virtual void setValue( YCheckBoxState state ) = 0;
+
/**
- * Implements the ui command changeWidget.
+ * Simplified access to value(): Return 'true' if the CheckBox is checked.
**/
- YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue );
+ bool isChecked() { return value() == YCheckBox_on; }
/**
- * Implements the ui command queryWidget
+ * Simplified access to setValue(): Check of uncheck the CheckBox.
**/
- YCPValue queryWidget( const YCPSymbol & property );
+ void setChecked( bool checked )
+ { setValue( checked ? YCheckBox_on : YCheckBox_off ); }
/**
- * Set the check box on or off
+ * Simplified access to tri-state ("don't care").
+ **/
+ bool dontCare() { return value() == YCheckBox_dont_care; }
+
+ /**
+ * Simplified access to setting tri-state ("don't care").
**/
- virtual void setValue( const YCPValue & checked ) = 0;
+ void setDontCare() { setValue( YCheckBox_dont_care ); }
+
+ /**
+ * Get the label (the text on the CheckBox).
+ **/
+ string label() const;
/**
- * Returns whether the checkbox is checked.
- * This may return 'true' or 'false' or 'nil' for a tristate check box.
+ * Set the label (the text on the CheckBox).
+ *
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method at the end of the overloaded function.
**/
- virtual YCPValue getValue() = 0;
+ virtual void setLabel( const string & label );
/**
- * Change the check box label. Overload this, but call
- * YCheckBox::setLabel at the end of your own function.
+ * Returns 'true' if a bold font should be used.
**/
- virtual void setLabel( const YCPString & label );
+ bool useBoldFont() const;
/**
- * Get the current check box label. This method cannot be overidden.
- * The value of the label cannot be changed other than by calling setLabel,
- * i.e. not by the ui. Therefore setLabel stores the current label in #label.
+ * Indicate whether or not a bold font should be used.
+ *
+ * Derived classes are free to reimplement this, but they should call this
+ * base class method at the end of the overloaded function.
+ **/
+ virtual void setUseBoldFont( bool bold = true );
+
+ /**
+ * Set a property.
+ * Reimplemented from YWidget.
+ *
+ * This method may throw exceptions, for example
+ * - if there is no property with that name
+ * - if the expected type and the type mismatch
+ * - if the value is out of range
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- YCPString getLabel();
+ virtual bool setProperty( const string & propertyName,
+ const YPropertyValue & val );
+
+ /**
+ * Get a property.
+ * Reimplemented from YWidget.
+ *
+ * This method may throw exceptions, for example
+ * - if there is no property with that name
+ **/
+ virtual YPropertyValue getProperty( const string & propertyName );
+
+ /**
+ * Return this class's property set.
+ * This also initializes the property set upon the first call.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual const YPropertySet & propertySet();
/**
* Get the string of this widget that holds the keyboard shortcut.
*
* Reimplemented from YWidget.
**/
- virtual string shortcutString() { return getLabel()->value(); }
+ virtual string shortcutString() { return label(); }
/**
* Set the string of this widget that holds the keyboard shortcut.
@@ -111,22 +180,14 @@
* Reimplemented from YWidget.
**/
virtual void setShortcutString( const string & str )
- { setLabel( YCPString( str ) ); }
+ { setLabel( str ); }
-
/**
* The name of the widget property that will return user input.
* Inherited from YWidget.
**/
const char *userInputProperty() { return YUIProperty_Value; }
-
-protected:
- /**
- * The CheckBox label
- **/
- YCPString label;
-
private:
@@ -136,6 +197,8 @@
* handled by the abstract libyui level, not by a specific UI.
**/
virtual void saveUserInput( YMacroRecorder *macroRecorder );
+
+ ImplPtr<YCheckBoxPrivate> priv;
};
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.cc Tue Jun 26 17:29:52 2007
@@ -47,6 +47,8 @@
: YSingleChildContainerWidget( parent )
, priv( new YCheckBoxFramePrivate( label ) )
{
+ YUI_CHECK_NEW( priv );
+
#if 0
// FIXME
_debugLabelWidget = this;
@@ -128,7 +130,7 @@
}
-void
+bool
YCheckBoxFrame::setProperty( const string & propertyName, const YPropertyValue & val )
{
propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
@@ -139,6 +141,8 @@
{
YWidget::setProperty( propertyName, val );
}
+
+ return true; // success -- no special processing necessary
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YCheckBoxFrame.h Tue Jun 26 17:29:52 2007
@@ -145,8 +145,12 @@
* - if there is no property with that name
* - if the expected type and the type mismatch
* - if the value is out of range
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- virtual void setProperty( const string & propertyName,
+ virtual bool setProperty( const string & propertyName,
const YPropertyValue & val );
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YEmpty.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YEmpty.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YEmpty.cc Tue Jun 26 17:29:52 2007
@@ -31,7 +31,7 @@
:YWidget( parent )
, priv( new YEmptyPrivate )
{
- // NOP
+ YUI_CHECK_NEW( priv );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YFrame.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YFrame.cc Tue Jun 26 17:29:52 2007
@@ -39,7 +39,7 @@
: YSingleChildContainerWidget( parent )
, priv( new YFramePrivate( YShortcut::cleanShortcutString( label ) ) )
{
- // NOP
+ YUI_CHECK_NEW( priv );
}
@@ -80,7 +80,7 @@
}
-void
+bool
YFrame::setProperty( const string & propertyName, const YPropertyValue & val )
{
propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
@@ -90,6 +90,8 @@
{
YWidget::setProperty( propertyName, val );
}
+
+ return true; // success -- no special processing necessary
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YFrame.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YFrame.h Tue Jun 26 17:29:52 2007
@@ -67,8 +67,12 @@
* - if there is no property with that name
* - if the expected type and the type mismatch
* - if the value is out of range
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- virtual void setProperty( const string & propertyName,
+ virtual bool setProperty( const string & propertyName,
const YPropertyValue & val );
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YInputField.cc Tue Jun 26 17:29:52 2007
@@ -148,7 +148,7 @@
}
-void
+bool
YInputField::setProperty( const string & propertyName, const YPropertyValue & val )
{
propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
@@ -161,6 +161,8 @@
{
YWidget::setProperty( propertyName, val );
}
+
+ return true; // success -- no special processing necessary
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YInputField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YInputField.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YInputField.h Tue Jun 26 17:29:52 2007
@@ -137,9 +137,14 @@
* Set a property.
* Reimplemented from YWidget.
*
- * This method may throw YUIPropertyExceptions.
+ * This function may throw YUIPropertyExceptions.
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- virtual void setProperty( const string & propertyName, const YPropertyValue & val );
+ virtual bool setProperty( const string & propertyName,
+ const YPropertyValue & val );
/**
* Get a property.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YLabel.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YLabel.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YLabel.cc Tue Jun 26 17:29:52 2007
@@ -54,7 +54,7 @@
: YWidget( parent )
, priv( new YLabelPrivate( text, isHeading, isOutputField ) )
{
- // NOP
+ YUI_CHECK_NEW( priv );
}
@@ -123,7 +123,7 @@
}
-void
+bool
YLabel::setProperty( const string & propertyName, const YPropertyValue & val )
{
propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
@@ -135,6 +135,8 @@
{
YWidget::setProperty( propertyName, val );
}
+
+ return true; // success -- no special processing necessary
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YLabel.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YLabel.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YLabel.h Tue Jun 26 17:29:52 2007
@@ -125,8 +125,12 @@
* - if there is no property with that name
* - if the expected type and the type mismatch
* - if the value is out of range
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- virtual void setProperty( const std::string & propertyName,
+ virtual bool setProperty( const string & propertyName,
const YPropertyValue & val );
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YLayoutBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YLayoutBox.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YLayoutBox.cc Tue Jun 26 17:29:52 2007
@@ -55,6 +55,7 @@
: YWidget( parent )
, priv( new YLayoutBoxPrivate( primaryDimension ) )
{
+ YUI_CHECK_NEW( priv );
setChildrenManager( new YWidgetChildrenManager( this ) );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YProperty.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YProperty.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YProperty.cc Tue Jun 26 17:29:52 2007
@@ -101,14 +101,15 @@
if ( it->isReadOnly() )
YUI_THROW( YUISetReadOnlyPropertyException( *it ) );
- if ( it->type() == type )
+ if ( it->type() == type ||
+ it->type() == YOtherProperty ) // "Other" could be anything
return true;
YUIPropertyTypeMismatchException exception( *it, type );
if ( it->type() == YWidgetPtrProperty )
{
- // Kludge for YWidet * properties: Those typically throw an
+ // Kludge for YWidget * properties: Those typically throw an
// exception (and the caller tries again with the correct
// type), so let's at least not appear it in the log file.
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YProperty.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YProperty.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YProperty.h Tue Jun 26 17:29:52 2007
@@ -111,19 +111,19 @@
/**
* Constructor for bool properties.
**/
- YPropertyValue( bool b ):
+ explicit YPropertyValue( bool b ):
_type( YBoolProperty ), _boolVal( b ) {}
/**
* Constructor for numerical (YCP integer) properties.
**/
- YPropertyValue( YInteger num ):
+ explicit YPropertyValue( YInteger num ):
_type( YIntegerProperty ), _integerVal( num ) {}
/**
* Constructor for numerical (YCP integer) properties.
**/
- YPropertyValue( int num ):
+ explicit YPropertyValue( int num ):
_type( YIntegerProperty ), _integerVal( num ) {}
/**
@@ -132,6 +132,9 @@
YPropertyValue( YWidget * widget ):
_type( YWidgetPtrProperty ), _widgetPtrVal( widget ) {}
+ explicit YPropertyValue( YPropertyType type ) :
+ _type( type ) {}
+
/**
* Default constructor
**/
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
Files branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc (original) and branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.cc Tue Jun 26 17:29:52 2007 differ
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YPushButton.h Tue Jun 26 17:29:52 2007
@@ -86,9 +86,13 @@
* Set a property.
* Reimplemented from YWidget.
*
- * This method may throw YUIPropertyExceptions.
+ * This function may throw YUIPropertyExceptions.
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- virtual void setProperty( const string & propertyName,
+ virtual bool setProperty( const string & propertyName,
const YPropertyValue & val );
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.cc Tue Jun 26 17:29:52 2007
@@ -125,7 +125,7 @@
}
-void
+bool
YRadioButton::setProperty( const string & propertyName, const YPropertyValue & val )
{
propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
@@ -136,6 +136,8 @@
{
YWidget::setProperty( propertyName, val );
}
+
+ return true; // success -- no special processing necessary
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YRadioButton.h Tue Jun 26 17:29:52 2007
@@ -132,8 +132,12 @@
* - if there is no property with that name
* - if the expected type and the type mismatch
* - if the value is out of range
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- virtual void setProperty( const string & propertyName,
+ virtual bool setProperty( const string & propertyName,
const YPropertyValue & val );
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.cc Tue Jun 26 17:29:52 2007
@@ -48,6 +48,7 @@
: YSingleChildContainerWidget( parent )
, priv( new YRadioButtonGroupPrivate() )
{
+ YUI_CHECK_NEW( priv );
}
@@ -139,7 +140,7 @@
}
-void
+bool
YRadioButtonGroup::setProperty( const string & propertyName, const YPropertyValue & val )
{
propertySet().check( propertyName, val.type() ); // throws exceptions if not found or type mismatch
@@ -156,7 +157,7 @@
if ( newCurrentButton )
{
newCurrentButton->setValue( true );
- return;
+ return true; // success -- no special processing necessary
}
}
@@ -176,6 +177,8 @@
{
YWidget::setProperty( propertyName, val );
}
+
+ return true; // success -- no special processing necessary
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YRadioButtonGroup.h Tue Jun 26 17:29:52 2007
@@ -93,8 +93,12 @@
* - if there is no property with that name
* - if the expected type and the type mismatch
* - if the value is out of range
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- virtual void setProperty( const std::string & propertyName,
+ virtual bool setProperty( const string & propertyName,
const YPropertyValue & val );
/**
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSpacing.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSpacing.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSpacing.cc Tue Jun 26 17:29:52 2007
@@ -39,6 +39,7 @@
: YWidget( parent )
, priv( new YSpacingPrivate( dim, YUI::ui()->deviceUnits( dim, layoutUnits ) ) )
{
+ YUI_CHECK_NEW( priv );
setStretchable( dim, stretchable );
setStretchable( dim == YD_HORIZ ? YD_VERT : YD_HORIZ, false );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YSquash.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YSquash.cc (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YSquash.cc Tue Jun 26 17:29:52 2007
@@ -39,6 +39,7 @@
: YSingleChildContainerWidget( parent )
, priv( new YSquashPrivate( horSquash, vertSquash ) )
{
+ YUI_CHECK_NEW( priv );
}
Modified: branches/tmp/sh/mod-ui/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUI.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUI.h Tue Jun 26 17:29:52 2007
@@ -340,6 +340,13 @@
YCPValue evaluatePollInput ();
/**
+ * Handlers for not-so-simple property types.
+ **/
+ YCPValue queryWidgetComplexTypes ( YWidget * widget, const string & propertyName );
+ void changeWidgetComplexTypes( YWidget * widget, const string & propertyName, const YCPValue & val );
+
+
+ /**
* This method implements the UI thread in case it is existing.
* The loop consists of calling idleLoop, getting the next
* command from the @ref YCPUIComponent, evaluating it, which
@@ -442,7 +449,6 @@
virtual YWidget *createRichText( YWidget *parent, YWidgetOpt & opt, const YCPString & text ) = 0;
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 *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/YUIException.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/core/libyui/src…
==============================================================================
--- branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h (original)
+++ branches/tmp/sh/mod-ui/core/libyui/src/YUIException.h Tue Jun 26 17:29:52 2007
@@ -572,7 +572,7 @@
YUIBadPropertyArgException( const YProperty & property,
YWidget * widget,
- const string & message )
+ const string & message = "" )
: YUIPropertyException( property, widget )
{ setMsg( message ); }
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 Tue Jun 26 17:29:52 2007
@@ -53,6 +53,7 @@
#include "YCPValueWidgetID.h"
#include "YCPDialogParser.h"
#include "YOptionalWidgetFactory.h"
+#include "YCheckBox.h"
using std::string;
@@ -65,7 +66,7 @@
* widget of this kind. Do not use this to check for ordinary widgets like
* PushButton etc. - just the widgets where the widget documentation explicitly
* states it is an optional widget not supported by all UIs.
- *
+ *
* Returns true if the UI supports the special widget and false if not.
*/
@@ -847,7 +848,7 @@
* @return boolean Returns true on success.
*/
-YCPValue YUI::evaluateChangeWidget( const YCPValue & id_value, const YCPValue & property, const YCPValue & new_value )
+YCPValue YUI::evaluateChangeWidget( const YCPValue & id_value, const YCPValue & property, const YCPValue & newValue )
{
if ( ! YCPDialogParser::isSymbolOrId( id_value ) )
{
@@ -876,7 +877,7 @@
// FIXME: Get rid of this
y2debug( "Old style UI::ChangeWidget() for %s::%s",
widget->widgetClass(), sym->symbol().c_str() );
- ret = widget->changeWidget( sym, new_value );
+ ret = widget->changeWidget( sym, newValue );
// FIXME: Get rid of this
// FIXME: Get rid of this
// FIXME: Get rid of this
@@ -885,15 +886,17 @@
{
// y2milestone( "New style UI::ChangeWidget() for %s::%s", widget->widgetClass(), sym->symbol().c_str() );
+ string propertyName = sym->symbol();
YPropertyValue val;
- if ( new_value->isString() ) val = YPropertyValue( new_value->asString()->value() );
- else if ( new_value->isInteger() ) val = YPropertyValue( new_value->asInteger()->value() );
- else if ( new_value->isBoolean() ) val = YPropertyValue( new_value->asBoolean()->value() );
+ if ( newValue->isString() ) val = YPropertyValue( newValue->asString()->value() );
+ else if ( newValue->isInteger() ) val = YPropertyValue( newValue->asInteger()->value() );
+ else if ( newValue->isBoolean() ) val = YPropertyValue( newValue->asBoolean()->value() );
+ else if ( newValue->isVoid() ) changeWidgetComplexTypes( widget, propertyName, newValue );
else
{
y2error( "Unknown type for property %s::%s: %s",
- widget->widgetClass(), sym->symbol().c_str(), new_value->toString().c_str() );
+ widget->widgetClass(), sym->symbol().c_str(), newValue->toString().c_str() );
unblockEvents();
return YCPBoolean( false );
@@ -901,7 +904,11 @@
try
{
- widget->setProperty( sym->symbol(), val );
+ bool success = widget->setProperty( propertyName, val );
+
+ if ( ! success )
+ changeWidgetComplexTypes( widget, propertyName, newValue );
+
ret = YCPBoolean( true );
}
catch ( YUIPropertyTypeMismatchException & typeMismatchException )
@@ -914,8 +921,8 @@
// YCPStrings or YCPIntegers (which is legal): It's not at all clear if that kind of
// YCPValue should be passed as a YCPString or as a widget ID. So now that YCPString
// failed, let's try again with a widget.
-
- YWidget * refWidget = YCPDialogParser::findWidgetWithId( new_value );
+
+ YWidget * refWidget = YCPDialogParser::findWidgetWithId( newValue );
widget->setProperty( sym->symbol(), YPropertyValue( refWidget ) );
ret = YCPBoolean( true );
}
@@ -941,7 +948,7 @@
else
{
blockEvents(); // We don't want self-generated events from UI::ChangeWidget().
- YCPValue result = widget->changeWidgetTerm( property->asTerm(), new_value );
+ YCPValue result = widget->changeWidgetTerm( property->asTerm(), newValue );
unblockEvents();
return result;
@@ -1000,15 +1007,18 @@
{
// y2debug( "New style UI::QueryWidget() for %s::%s", widget->widgetClass(), sym->symbol().c_str() );
+ string propertyName = sym->symbol();
+
try
{
- YPropertyValue val = widget->getProperty( sym->symbol() );
+ YPropertyValue val = widget->getProperty( propertyName );
switch ( val.type() )
{
case YStringProperty: return YCPString ( val.stringVal() );
case YBoolProperty: return YCPBoolean( val.boolVal() );
case YIntegerProperty: return YCPInteger( val.integerVal() );
+ case YOtherProperty: return queryWidgetComplexTypes( widget, propertyName );
case YWidgetPtrProperty:
{
YWidget * widget = val.widgetPtrVal();
@@ -1046,6 +1056,66 @@
}
+/**
+ * This is the messy part of UI::QueryWidget(): Here all special cases
+ * (property type YOtherProperty) are handled. It's not pretty, but at some
+ * place a mapping from C++ types to YCPValues has to be done.
+ **/
+YCPValue
+YUI::queryWidgetComplexTypes( YWidget * widget, const string & propertyName )
+{
+ if ( propertyName == YUIProperty_Value )
+ {
+ YCheckBox * checkBox = dynamic_cast<YCheckBox *> (widget);
+
+ if ( checkBox )
+ {
+ switch ( checkBox->value() )
+ {
+ case YCheckBox_on: return YCPBoolean( true );
+ case YCheckBox_off: return YCPBoolean( false );
+ case YCheckBox_dont_care: return YCPVoid(); // nil
+ }
+ }
+ }
+
+ y2warning( "Can't handle property %s::%s - returning 'nil'",
+ widget->widgetClass(), propertyName.c_str() );
+
+ return YCPVoid();
+}
+
+
+void
+YUI::changeWidgetComplexTypes( YWidget * widget, const string & propertyName, const YCPValue & val )
+{
+ // y2debug( "%s::%s", widget->widgetClass(), propertyName.c_str() );
+
+ if ( propertyName == YUIProperty_Value )
+ {
+ YCheckBox * checkBox = dynamic_cast<YCheckBox *> (widget);
+
+ if ( checkBox )
+ {
+ if ( val->isBoolean() )
+ {
+ checkBox->setChecked( val->asBoolean()->value() );
+ return;
+ }
+ else if ( val->isVoid() )
+ {
+ checkBox->setDontCare();
+ return;
+ }
+
+ YUI_THROW( YUIBadPropertyArgException( YProperty( propertyName, YOtherProperty ), widget ) );
+ }
+ }
+
+ y2warning( "Can't handle property %s::%s - returning 'nil'",
+ widget->widgetClass(), propertyName.c_str() );
+}
+
/**
* @builtin ReplaceWidget
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 Tue Jun 26 17:29:52 2007
@@ -96,7 +96,7 @@
YWidget::YWidget( const YWidgetOpt & opt )
: priv( new YWidgetPrivate( new YWidgetChildrenRejector( this ) ) )
{
-
+ YUI_CHECK_NEW( priv );
}
// FIXME: Obsolete
// FIXME: Obsolete
@@ -357,7 +357,7 @@
}
-void
+bool
YWidget::setProperty( const std::string & propertyName, const YPropertyValue & val )
{
try
@@ -372,6 +372,8 @@
if ( propertyName == YUIProperty_Enabled ) setEnabled( val.boolVal() );
else if ( propertyName == YUIProperty_Notify ) setNotify ( val.boolVal() );
+
+ return true; // success -- no special processing necessary
}
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 Tue Jun 26 17:29:52 2007
@@ -135,8 +135,12 @@
* - if there is no property with that name
* - if the expected type and the type mismatch
* - if the value is out of range
+ *
+ * This function returns 'true' if the value was successfully set and
+ * 'false' if that value requires special handling (not in error cases:
+ * those are covered by exceptions).
**/
- virtual void setProperty( const string & propertyName,
+ virtual bool setProperty( const string & propertyName,
const YPropertyValue & val );
// FIXME: = 0
Modified: branches/tmp/sh/mod-ui/qt/src/YQCheckBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQCheckB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQCheckBox.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQCheckBox.cc Tue Jun 26 17:29:52 2007
@@ -31,123 +31,125 @@
#define SPACING 8
-YQCheckBox::YQCheckBox( QWidget * parent,
- const YWidgetOpt & opt,
- const YCPString & label,
- bool initiallyChecked )
- : QGroupBox( parent )
- , YCheckBox( opt, label )
- , _dont_care( false )
+YQCheckBox::YQCheckBox( YWidget * parent,
+ const string & label,
+ bool checked )
+ : QGroupBox( (QWidget *) parent->widgetRep() )
+ , YCheckBox( parent, label )
{
setWidgetRep( this );
setFrameStyle( NoFrame );
QBoxLayout * layout = new QBoxLayout( this, QBoxLayout::LeftToRight );
- _qt_checkbox = new QCheckBox( fromUTF8( label->value() ), this );
+ _qt_checkBox = new QCheckBox( fromUTF8( label ), this );
+ YUI_CHECK_NEW( _qt_checkBox );
+
layout->addSpacing( SPACING );
- layout->addWidget( _qt_checkbox );
+ layout->addWidget( _qt_checkBox );
layout->addSpacing( SPACING );
- _qt_checkbox->setFont( opt.boldFont.value() ?
- YQUI::ui()->boldFont() :
- YQUI::ui()->currentFont() );
- _qt_checkbox->setChecked( initiallyChecked );
- connect( _qt_checkbox, SIGNAL( stateChanged( int ) ),
+ _qt_checkBox->setChecked( checked );
+
+ connect( _qt_checkBox, SIGNAL( stateChanged( int ) ),
this, SLOT ( stateChanged( int ) ) );
}
-int YQCheckBox::preferredWidth()
+YQCheckBox::~YQCheckBox()
{
- return 2*SPACING + _qt_checkbox->sizeHint().width();
+ // NOP
}
-int YQCheckBox::preferredHeight()
+YCheckBoxState
+YQCheckBox::value()
{
- return _qt_checkbox->sizeHint().height();
-}
-
+ switch ( _qt_checkBox->state() )
+ {
+ case QButton::On: return YCheckBox_on;
+ case QButton::Off: return YCheckBox_off;
+ case QButton::NoChange: return YCheckBox_dont_care;
+ }
-void YQCheckBox::setSize( int newWidth, int newHeight )
-{
- _qt_checkbox->resize( newWidth - 2*SPACING, newHeight );
- resize( newWidth, newHeight );
+ return YCheckBox_off;
}
-YCPValue
-YQCheckBox::getValue()
+void
+YQCheckBox::setValue( YCheckBoxState newValue )
{
- switch ( _qt_checkbox->state() )
+ switch ( newValue )
{
- case QButton::On: return YCPBoolean( true );
- case QButton::Off: return YCPBoolean( false );
- case QButton::NoChange: return YCPVoid(); // nil
+ case YCheckBox_on:
+ _qt_checkBox->setChecked( true );
+ _qt_checkBox->setTristate( false );
+ break;
+
+ case YCheckBox_off:
+ _qt_checkBox->setChecked( false );
+ _qt_checkBox->setTristate( false );
+ break;
+
+ case YCheckBox_dont_care:
+ _qt_checkBox->setTristate( true );
+ _qt_checkBox->setNoChange();
+ break;
}
-
- y2error( "Unknown QCheckBox state: %d", (int) _qt_checkbox->state() );
- return YCPVoid();
}
-void
-YQCheckBox::setValue( const YCPValue & val )
+void YQCheckBox::setLabel( const string & label )
{
- if ( val->isBoolean() )
- {
- setTristate( false );
- _qt_checkbox->setChecked( val->asBoolean()->value() );
- }
- else // "Nil" -> set TriState: neither on nor off
- {
- setTristate( true );
- }
+ _qt_checkBox->setText( fromUTF8( label ) );
+ YCheckBox::setLabel( label );
}
-bool
-YQCheckBox::isTristate()
+void YQCheckBox::setUseBoldFont( bool useBold )
{
- return _dont_care;
+ _qt_checkBox->setFont( useBold ?
+ YQUI::ui()->boldFont() :
+ YQUI::ui()->currentFont() );
+
+ YCheckBox::setUseBoldFont( useBold );
}
-void
-YQCheckBox::setTristate( bool tristate )
+void YQCheckBox::setEnabled( bool enabled )
{
- _dont_care = tristate;
- _qt_checkbox->setTristate( tristate );
+ _qt_checkBox->setEnabled( enabled );
+ YWidget::setEnabled( enabled );
+}
+
- if ( tristate )
- _qt_checkbox->setNoChange();
+int YQCheckBox::preferredWidth()
+{
+ return 2*SPACING + _qt_checkBox->sizeHint().width();
}
-void YQCheckBox::setLabel( const YCPString & label )
+int YQCheckBox::preferredHeight()
{
- _qt_checkbox->setText( fromUTF8( label->value() ) );
- YCheckBox::setLabel( label );
+ return _qt_checkBox->sizeHint().height();
}
-void YQCheckBox::setEnabled( bool enabled )
+void YQCheckBox::setSize( int newWidth, int newHeight )
{
- _qt_checkbox->setEnabled( enabled );
- YWidget::setEnabled( enabled );
+ _qt_checkBox->resize( newWidth - 2*SPACING, newHeight );
+ resize( newWidth, newHeight );
}
bool YQCheckBox::setKeyboardFocus()
{
- _qt_checkbox->setFocus();
+ _qt_checkBox->setFocus();
return true;
}
-
void YQCheckBox::stateChanged( int newState )
{
// y2milestone( "new state: %d", newState );
Modified: branches/tmp/sh/mod-ui/qt/src/YQCheckBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQCheckB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQCheckBox.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQCheckBox.h Tue Jun 26 17:29:52 2007
@@ -37,69 +37,83 @@
/**
* Constructor.
**/
- YQCheckBox( QWidget * parent,
- const YWidgetOpt & opt,
- const YCPString & label,
- bool initiallyChecked );
+ YQCheckBox( YWidget * parent,
+ const string & label,
+ bool checked );
/**
- * Inherited from YWidget: Sets the enabled state of the
- * widget. All new widgets are enabled per definition. Only
- * enabled widgets can take user input.
+ * Destructor.
**/
- void setEnabled( bool enabled );
+ virtual ~YQCheckBox();
/**
- * Preferred width of the widget.
+ * Get the current value:
*
- * Reimplemented from YWidget.
+ * YCheckBox_on CheckBox is checked
+ * YCheckBox_off CheckBox is unchecked
+ *
+ * YCheckBox_dont_care tri-state: CheckBox is greyed out,
+ * neither checked nor unchecked
+ *
+ * Reimplemented from YCheckBox.
**/
- virtual int preferredWidth();
-
+ virtual YCheckBoxState value();
+
/**
- * Preferred height of the widget.
+ * Set the CheckBox value (on/off/don't care).
*
- * Reimplemented from YWidget.
+ * Reimplemented from YCheckBox.
**/
- virtual int preferredHeight();
+ virtual void setValue( YCheckBoxState state );
/**
- * Set the new size of the widget.
+ * Change the label (the text) on the RadioButton.
*
- * Reimplemented from YWidget.
+ * Reimplemented from YRadioButton.
**/
- virtual void setSize( int newWidth, int newHeight );
+ virtual void setLabel( const string & label );
/**
- * Sets the checked-state of the checkbox
+ * Use a bold font.
+ *
+ * Reimplemented from YRadioButton.
**/
- void setValue( const YCPValue & checked );
+ virtual void setUseBoldFont( bool bold = true );
/**
- * Returns whether the checkbox is checked.
- * This may return 'true' or 'false' or 'nil' for a tristate check box.
+ * Set enabled / disabled state.
+ *
+ * Reimplemented from YWidget.
**/
- YCPValue getValue();
+ virtual void setEnabled( bool enabled );
/**
- * Changes the label of the text entry.
+ * Preferred width of the widget.
+ *
+ * Reimplemented from YWidget.
**/
- void setLabel( const YCPString & label );
+ virtual int preferredWidth();
/**
- * Accept the keyboard focus.
+ * Preferred height of the widget.
+ *
+ * Reimplemented from YWidget.
**/
- virtual bool setKeyboardFocus();
+ virtual int preferredHeight();
/**
- * Returns whether tristate condition is set ( i.e. neither on nor off )
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
**/
- bool isTristate();
+ virtual void setSize( int newWidth, int newHeight );
/**
- * Set tristate condition
+ * Accept the keyboard focus.
+ *
+ * Reimplemented from YWidget.
**/
- void setTristate( bool tristate );
+ virtual bool setKeyboardFocus();
private slots:
@@ -112,16 +126,7 @@
protected:
- /**
- * Pointer to the qt widget that actually does the job
- **/
- QCheckBox * _qt_checkbox;
-
- /**
- * Flag that indicates tristate condition: neither on nor off
- **/
- bool _dont_care;
-
+ QCheckBox * _qt_checkBox;
};
#endif // YQCheckBox_h
Modified: branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQRadioB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQRadioButton.cc Tue Jun 26 17:29:52 2007
@@ -50,13 +50,13 @@
QBoxLayout * layout = new QBoxLayout( this, QBoxLayout::LeftToRight );
- _qt_radiobutton = new QRadioButton( fromUTF8( label ), this );
+ _qt_radioButton = new QRadioButton( fromUTF8( label ), this );
layout->addSpacing( SPACING );
- layout->addWidget( _qt_radiobutton );
+ layout->addWidget( _qt_radioButton );
layout->addSpacing( SPACING );
- _qt_radiobutton->setChecked( checked );
+ _qt_radioButton->setChecked( checked );
- connect ( _qt_radiobutton, SIGNAL( toggled ( bool ) ),
+ connect ( _qt_radioButton, SIGNAL( toggled ( bool ) ),
this, SLOT ( changed ( bool ) ) );
}
@@ -64,7 +64,7 @@
void
YQRadioButton::setUseBoldFont( bool useBold )
{
- _qt_radiobutton->setFont( useBold ?
+ _qt_radioButton->setFont( useBold ?
YQUI::ui()->boldFont() :
YQUI::ui()->currentFont() );
@@ -74,33 +74,33 @@
int YQRadioButton::preferredWidth()
{
- return 2 * SPACING + _qt_radiobutton->sizeHint().width();
+ return 2 * SPACING + _qt_radioButton->sizeHint().width();
}
int YQRadioButton::preferredHeight()
{
- return _qt_radiobutton->sizeHint().height();
+ return _qt_radioButton->sizeHint().height();
}
void YQRadioButton::setSize( int newWidth, int newHeight )
{
- _qt_radiobutton->resize( newWidth - 2*SPACING, newHeight );
+ _qt_radioButton->resize( newWidth - 2*SPACING, newHeight );
resize( newWidth, newHeight );
}
bool YQRadioButton::value()
{
- return _qt_radiobutton->isChecked();
+ return _qt_radioButton->isChecked();
}
void YQRadioButton::setValue( bool newValue )
{
- _qt_radiobutton->blockSignals( true );
- _qt_radiobutton->setChecked( newValue );
+ _qt_radioButton->blockSignals( true );
+ _qt_radioButton->setChecked( newValue );
if ( newValue )
{
@@ -110,33 +110,33 @@
group->uncheckOtherButtons( this );
}
- _qt_radiobutton->blockSignals( false );
+ _qt_radioButton->blockSignals( false );
}
void YQRadioButton::setLabel( const string & label )
{
- _qt_radiobutton->setText( fromUTF8( label ) );
+ _qt_radioButton->setText( fromUTF8( label ) );
YRadioButton::setLabel( label );
}
void YQRadioButton::setEnabled( bool enabled )
{
- _qt_radiobutton->setEnabled( enabled );
+ _qt_radioButton->setEnabled( enabled );
YWidget::setEnabled( enabled );
}
QRadioButton * YQRadioButton::getQtButton()
{
- return _qt_radiobutton;
+ return _qt_radioButton;
}
bool YQRadioButton::setKeyboardFocus()
{
- _qt_radiobutton->setFocus();
+ _qt_radioButton->setFocus();
return true;
}
Modified: branches/tmp/sh/mod-ui/qt/src/YQRadioButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQRadioB…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQRadioButton.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQRadioButton.h Tue Jun 26 17:29:52 2007
@@ -21,11 +21,13 @@
#define YQRadioButton_h
#include <qgroupbox.h>
-
#include "YRadioButton.h"
+
class QRadioButton;
+using std::string;
+
class YQRadioButton : public QGroupBox, public YRadioButton
{
@@ -36,7 +38,7 @@
* Constructor.
**/
YQRadioButton( YWidget * parent,
- const std::string & label,
+ const string & label,
bool checked );
/**
@@ -58,7 +60,7 @@
*
* Reimplemented from YRadioButton.
**/
- virtual void setLabel( const std::string & label );
+ virtual void setLabel( const string & label );
/**
* Use a bold font.
@@ -117,7 +119,7 @@
protected:
- QRadioButton * _qt_radiobutton;
+ QRadioButton * _qt_radioButton;
};
#endif // YQRadioButton_h
Modified: branches/tmp/sh/mod-ui/qt/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI.h?r…
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Tue Jun 26 17:29:52 2007
@@ -446,7 +446,6 @@
YContainerWidget * createWeight ( YWidget * parent, YWidgetOpt & opt, YUIDimension dim, long weight);
- YWidget * createCheckBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, bool checked);
YWidget * createComboBox ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
YWidget * createImage ( YWidget * parent, YWidgetOpt & opt, YCPByteblock imageData, YCPString fallbackText );
YWidget * createImage ( YWidget * parent, YWidgetOpt & opt, YCPString fileName, YCPString fallbackText );
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 Tue Jun 26 17:29:52 2007
@@ -152,14 +152,6 @@
return new YQMenuButton( (QWidget *) ( parent->widgetRep() ), opt, label);
}
-YWidget * YQUI::createCheckBox ( YWidget * parent,
- YWidgetOpt & opt,
- const YCPString & label,
- bool checked )
-{
- return new YQCheckBox( (QWidget *) ( parent->widgetRep() ), opt, label, checked);
-}
-
YWidget * YQUI::createMultiLineEdit( YWidget * parent,
YWidgetOpt & opt,
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 Tue Jun 26 17:29:52 2007
@@ -119,7 +119,10 @@
YQCheckBox *
YQWidgetFactory::createCheckBox( YWidget * parent, const string & label, bool isChecked )
{
- return 0; // FIXME: TO DO
+ YQCheckBox * checkBox = new YQCheckBox( parent, label, isChecked );
+ YUI_CHECK_NEW( checkBox );
+
+ return checkBox;
}
--
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] r39034 - in /branches/tmp/sh/mod-ui/ncurses/src: ./ pkg/
by gs@svn.opensuse.org 26 Jun '07
by gs@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: gs
Date: Tue Jun 26 15:27:24 2007
New Revision: 39034
URL: http://svn.opensuse.org/viewcvs/yast?rev=39034&view=rev
Log:
replace setSize(long, long) by setSize(int, int)
add preferredWidth/Height to most widgets
use YCPDialogParser::parseWidgetTreeTerm() to parse layout
Modified:
branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.cc
branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.h
branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.cc
branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.h
branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc
branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h
branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.cc
branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.h
branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc
branches/tmp/sh/mod-ui/ncurses/src/NCDialog.h
branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.cc
branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.h
branches/tmp/sh/mod-ui/ncurses/src/NCFrame.cc
branches/tmp/sh/mod-ui/ncurses/src/NCFrame.h
branches/tmp/sh/mod-ui/ncurses/src/NCImage.cc
branches/tmp/sh/mod-ui/ncurses/src/NCImage.h
branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc
branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h
branches/tmp/sh/mod-ui/ncurses/src/NCLabel.cc
branches/tmp/sh/mod-ui/ncurses/src/NCLabel.h
branches/tmp/sh/mod-ui/ncurses/src/NCLogView.cc
branches/tmp/sh/mod-ui/ncurses/src/NCLogView.h
branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc
branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.h
branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc
branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.h
branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.cc
branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.h
branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.h
branches/tmp/sh/mod-ui/ncurses/src/NCProgressBar.cc
branches/tmp/sh/mod-ui/ncurses/src/NCProgressBar.h
branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc
branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.h
branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.cc
branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.h
branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.cc
branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.h
branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.cc
branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.h
branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc
branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h
branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc
branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h
branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.cc
branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.h
branches/tmp/sh/mod-ui/ncurses/src/NCSplit.cc
branches/tmp/sh/mod-ui/ncurses/src/NCSplit.h
branches/tmp/sh/mod-ui/ncurses/src/NCSquash.cc
branches/tmp/sh/mod-ui/ncurses/src/NCSquash.h
branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTable.h
branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h
branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc
branches/tmp/sh/mod-ui/ncurses/src/NCTree.h
branches/tmp/sh/mod-ui/ncurses/src/NCWeight.cc
branches/tmp/sh/mod-ui/ncurses/src/NCWeight.h
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.cc
branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCA…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.cc Tue Jun 26 15:27:24 2007
@@ -28,10 +28,10 @@
//
// DESCRIPTION :
//
-NCAlignment::NCAlignment( NCWidget * parent, const YWidgetOpt & opt,
+NCAlignment::NCAlignment( NCWidget * parent,
YAlignmentType halign,
YAlignmentType valign )
- : YAlignment( opt, halign, valign )
+ : YAlignment( halign, valign )
, NCWidget( parent )
{
WIDDBG << endl;
@@ -59,7 +59,7 @@
//
// DESCRIPTION :
//
-void NCAlignment::setSize( long newwidth, long newheight )
+void NCAlignment::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YAlignment::setSize( newwidth, newheight );
@@ -73,7 +73,7 @@
//
// DESCRIPTION :
//
-void NCAlignment::moveChild( YWidget * child, long newx, long newy )
+void NCAlignment::moveChild( YWidget * child, int newx, int newy )
{
NCWidget * cw = dynamic_cast<NCWidget*>(child);
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCA…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCAlignment.h Tue Jun 26 15:27:24 2007
@@ -47,14 +47,21 @@
public:
- NCAlignment( NCWidget * parent, const YWidgetOpt & opt,
- YAlignmentType halign, YAlignmentType valign );
+ NCAlignment( NCWidget * parent, YAlignmentType halign, YAlignmentType valign );
virtual ~NCAlignment();
- virtual long nicesize( YUIDimension dim ) { return YAlignment::nicesize( dim ); }
- virtual void setSize( long newwidth, long newheight );
+ // virtual long nicesize( YUIDimension dim ) { return YAlignment::nicesize( dim ); }
+ virtual int preferredWidth() { return YAlignment::preferredWidth(); }
+ virtual int preferredHeight() { return YAlignment::preferredHeight(); }
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
- virtual void moveChild( YWidget * child, long newx, long newy );
+ virtual void moveChild( YWidget * child, int newx, int newy );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
};
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.cc Tue Jun 26 15:27:24 2007
@@ -74,6 +74,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCCheckBox::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCCheckBox::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -82,7 +92,7 @@
//
// DESCRIPTION :
//
-void NCCheckBox::setSize( long newwidth, long newheight )
+void NCCheckBox::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YCheckBox::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBox.h Tue Jun 26 15:27:24 2007
@@ -69,7 +69,16 @@
virtual ~NCCheckBox();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.cc Tue Jun 26 15:27:24 2007
@@ -92,7 +92,7 @@
//
// DESCRIPTION :
//
-void NCCheckBoxFrame::setSize( long newwidth, long newheight )
+void NCCheckBoxFrame::setSize( int newwidth, int newheight )
{
wsze csze( newheight, newwidth );
wRelocate( wpos( 0 ), csze );
@@ -258,3 +258,8 @@
return YWidget::setKeyboardFocus();
return true;
}
+
+bool NCCheckBoxFrame::value()
+{
+ return getValue();
+}
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCCheckBoxFrame.h Tue Jun 26 15:27:24 2007
@@ -60,7 +60,13 @@
virtual ~NCCheckBoxFrame();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
@@ -72,6 +78,7 @@
virtual bool setKeyboardFocus();
+ virtual bool value();
virtual NCursesEvent wHandleInput( wint_t key );
};
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.cc Tue Jun 26 15:27:24 2007
@@ -79,6 +79,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCComboBox::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCComboBox::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -87,7 +97,7 @@
//
// DESCRIPTION :
//
-void NCComboBox::setSize( long newwidth, long newheight )
+void NCComboBox::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YComboBox::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCComboBox.h Tue Jun 26 15:27:24 2007
@@ -92,7 +92,16 @@
bool selected );
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCD…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCDialog.cc Tue Jun 26 15:27:24 2007
@@ -217,7 +217,7 @@
//
// DESCRIPTION :
//
-void NCDialog::setSize( long newwidth, long newheight )
+void NCDialog::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YDialog::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCD…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCDialog.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCDialog.h Tue Jun 26 15:27:24 2007
@@ -137,7 +137,13 @@
NCursesEvent pollInput();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
protected:
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCE…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.cc Tue Jun 26 15:27:24 2007
@@ -57,7 +57,7 @@
//
// DESCRIPTION :
//
-void NCEmpty::setSize( long newwidth, long newheight )
+void NCEmpty::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YEmpty::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCE…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCEmpty.h Tue Jun 26 15:27:24 2007
@@ -50,8 +50,16 @@
NCEmpty( NCWidget * parent, const YWidgetOpt & opt );
virtual ~NCEmpty();
- virtual long nicesize( YUIDimension dim ){ return YEmpty::nicesize( dim ); }
- virtual void setSize( long newwidth, long newheight );
+ // virtual long nicesize( YUIDimension dim ){ return YEmpty::nicesize( dim ); }
+ virtual int preferredWidth() { return YEmpty::preferredWidth(); }
+ virtual int preferredHeight() { return YEmpty::preferredHeight(); }
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
};
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCF…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCFrame.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCFrame.cc Tue Jun 26 15:27:24 2007
@@ -81,7 +81,7 @@
//
// DESCRIPTION :
//
-void NCFrame::setSize( long newwidth, long newheight )
+void NCFrame::setSize( int newwidth, int newheight )
{
wsze csze( newheight, newwidth );
wRelocate( wpos( 0 ), csze );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCFrame.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCF…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCFrame.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCFrame.h Tue Jun 26 15:27:24 2007
@@ -58,7 +58,13 @@
virtual ~NCFrame();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCImage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCI…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCImage.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCImage.cc Tue Jun 26 15:27:24 2007
@@ -74,7 +74,7 @@
//
// DESCRIPTION :
//
-void NCImage::setSize( long newwidth, long newheight )
+void NCImage::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YImage::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCImage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCI…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCImage.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCImage.h Tue Jun 26 15:27:24 2007
@@ -53,7 +53,13 @@
virtual ~NCImage();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
};
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCI…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCIntField.cc Tue Jun 26 15:27:24 2007
@@ -97,7 +97,7 @@
//
// DESCRIPTION :
//
-void NCIntField::setSize( long newwidth, long newheight )
+void NCIntField::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YIntField::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCI…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCIntField.h Tue Jun 26 15:27:24 2007
@@ -77,7 +77,13 @@
virtual ~NCIntField();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCLabel.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCL…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCLabel.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCLabel.cc Tue Jun 26 15:27:24 2007
@@ -66,6 +66,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCLabel::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCLabel::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -74,7 +84,7 @@
//
// DESCRIPTION :
//
-void NCLabel::setSize( long newwidth, long newheight )
+void NCLabel::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YLabel::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCLabel.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCL…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCLabel.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCLabel.h Tue Jun 26 15:27:24 2007
@@ -57,10 +57,19 @@
virtual ~NCLabel();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
};
///////////////////////////////////////////////////////////////////
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCLogView.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCL…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCLogView.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCLogView.cc Tue Jun 26 15:27:24 2007
@@ -66,6 +66,17 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCLogView::preferredWidth()
+{
+ defsze.W = ( 5 > labelWidht() ? 5 : labelWidht() ) + 2;
+ return wGetDefsze().W;
+}
+
+int NCLogView::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -74,7 +85,7 @@
//
// DESCRIPTION :
//
-void NCLogView::setSize( long newwidth, long newheight )
+void NCLogView::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YLogView::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCLogView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCL…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCLogView.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCLogView.h Tue Jun 26 15:27:24 2007
@@ -62,7 +62,16 @@
virtual ~NCLogView();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
virtual void setLogText( const YCPString & ntext);
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCM…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.cc Tue Jun 26 15:27:24 2007
@@ -69,6 +69,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCMenuButton::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCMenuButton::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -77,7 +87,7 @@
//
// DESCRIPTION :
//
-void NCMenuButton::setSize( long newwidth, long newheight )
+void NCMenuButton::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YMenuButton::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCM…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMenuButton.h Tue Jun 26 15:27:24 2007
@@ -59,7 +59,16 @@
virtual ~NCMenuButton();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual NCursesEvent wHandleInput( wint_t key );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCM…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.cc Tue Jun 26 15:27:24 2007
@@ -66,6 +66,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCMultiLineEditC::preferredWidth()
+{
+ defsze.W = ( 5 > labelWidht() ? 5 : labelWidht() ) + 2
+ return wGetDefsze().W;
+}
+
+int NCMultiLineEdit::preferredHeight()
+{
+ return wGetDefsze().H;
+}
///////////////////////////////////////////////////////////////////
//
//
@@ -74,7 +84,7 @@
//
// DESCRIPTION :
//
-void NCMultiLineEdit::setSize( long newwidth, long newheight )
+void NCMultiLineEdit::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YMultiLineEdit::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCM…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMultiLineEdit.h Tue Jun 26 15:27:24 2007
@@ -69,7 +69,15 @@
virtual ~NCMultiLineEdit();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
virtual void setText( const YCPString & ntext);
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCM…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.cc Tue Jun 26 15:27:24 2007
@@ -65,6 +65,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCMultiSelectionBox::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCMultiSelectionBox::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -73,7 +83,7 @@
//
// DESCRIPTION :
//
-void NCMultiSelectionBox::setSize( long newwidth, long newheight )
+void NCMultiSelectionBox::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YMultiSelectionBox::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCM…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCMultiSelectionBox.h Tue Jun 26 15:27:24 2007
@@ -126,7 +126,16 @@
virtual ~NCMultiSelectionBox();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.cc Tue Jun 26 15:27:24 2007
@@ -76,9 +76,11 @@
if ( ! pkgLayout.isNull() && ui )
{
YWidgetOpt childrenOpt( opt );
- widgetRoot = (YContainerWidget *)ui->createWidgetTree( dynamic_cast<YWidget *>(parent),
- childrenOpt, 0, pkgLayout );
- YCPDialogParser::parseWidgetTreeTerm(dynamic_cast<YWidget *>(parent), childrenOpt, pkgLayout );
+ // widgetRoot = (YContainerWidget *)ui->createWidgetTree( dynamic_cast<YWidget *>(parent),
+ // childrenOpt, 0, pkgLayout );
+ widgetRoot = (YContainerWidget * )YCPDialogParser::parseWidgetTreeTerm( dynamic_cast<YWidget *>(parent),
+ childrenOpt,
+ pkgLayout );
}
// create the PackageSelector (creation with 'new' is required because initialization
@@ -95,7 +97,7 @@
NCDBG << "Widget tree of NCPackageSelector created" << endl;
// get the widget ID of the package table
- YWidget * pkg = ui->widgetWithId( widgetRoot, NCPkgNames::Packages(), true );
+ YWidget * pkg = YDialogParser::findWidgetWithId( widgetRoot, NCPkgNames::Packages() );
pkgList = dynamic_cast<NCPkgTable *>(pkg);
if ( pkgList )
@@ -160,7 +162,7 @@
//
// DESCRIPTION :
//
-void NCPackageSelectorStart::setSize( long newwidth, long newheight )
+void NCPackageSelectorStart::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
NCSplit::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPackageSelectorStart.h Tue Jun 26 15:27:24 2007
@@ -76,7 +76,13 @@
virtual ~NCPackageSelectorStart();
virtual long nicesize( YUIDimension dim ) { return NCSplit::nicesize( dim ); }
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
/**
* Fills the package table with packages belonging to the
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCProgressBar.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCProgressBar.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCProgressBar.cc Tue Jun 26 15:27:24 2007
@@ -77,6 +77,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCProgressBar::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCProgressBar::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -85,7 +95,7 @@
//
// DESCRIPTION :
//
-void NCProgressBar::setSize( long newwidth, long newheight )
+void NCProgressBar::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YProgressBar::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCProgressBar.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCProgressBar.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCProgressBar.h Tue Jun 26 15:27:24 2007
@@ -70,7 +70,16 @@
virtual ~NCProgressBar();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.cc Tue Jun 26 15:27:24 2007
@@ -68,6 +68,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCPushButton::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCPushButton::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -76,7 +86,7 @@
//
// DESCRIPTION :
//
-void NCPushButton::setSize( long newwidth, long newheight )
+void NCPushButton::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YPushButton::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCP…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCPushButton.h Tue Jun 26 15:27:24 2007
@@ -56,7 +56,16 @@
virtual ~NCPushButton();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual NCursesEvent wHandleInput( wint_t key );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.cc Tue Jun 26 15:27:24 2007
@@ -31,18 +31,16 @@
//
// DESCRIPTION :
//
-NCRadioButton::NCRadioButton( NCWidget * parent, const YWidgetOpt & opt,
- YRadioButtonGroup * rbg,
- const YCPString & nlabel,
- bool check )
- : YRadioButton( opt, nlabel, rbg )
+NCRadioButton::NCRadioButton( NCWidget * parent,
+ const YCPString & nlabel )
+ : YRadioButton( parent, nlabel )
, NCWidget( parent )
, checked( false )
{
WIDDBG << endl;
setLabel( nlabel );
hotlabel = &label;
- setValue( check );
+ //setValue( check );
}
///////////////////////////////////////////////////////////////////
@@ -71,6 +69,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCRadioButton::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCRadioButton::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -79,7 +87,7 @@
//
// DESCRIPTION :
//
-void NCRadioButton::setSize( long newwidth, long newheight )
+void NCRadioButton::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YRadioButton::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRadioButton.h Tue Jun 26 15:27:24 2007
@@ -54,19 +54,29 @@
public:
- NCRadioButton( NCWidget * parent, const YWidgetOpt & opt,
- YRadioButtonGroup * rbg,
- const YCPString & label,
- bool checked );
+ NCRadioButton( NCWidget * parent,
+ const YCPString & label );
virtual ~NCRadioButton();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
- virtual void setValue( const YCPBoolean & newval );
- virtual YCPBoolean getValue();
+ // virtual void setValue( const YCPBoolean & newval );
+ // virtual YCPBoolean getValue();
+
+ virtual void setValue ( bool newval ){ checked = newval; }
+ virtual bool value() { return checked; }
virtual NCursesEvent wHandleInput( wint_t key );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.cc Tue Jun 26 15:27:24 2007
@@ -58,7 +58,7 @@
//
// DESCRIPTION :
//
-void NCRadioButtonGroup::setSize( long newwidth, long newheight )
+void NCRadioButtonGroup::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YRadioButtonGroup::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRadioButtonGroup.h Tue Jun 26 15:27:24 2007
@@ -52,8 +52,16 @@
NCRadioButtonGroup( NCWidget * parent, const YWidgetOpt & opt );
virtual ~NCRadioButtonGroup();
- virtual long nicesize( YUIDimension dim ) { return YRadioButtonGroup::nicesize( dim ); }
- virtual void setSize( long newwidth, long newheight );
+ //virtual long nicesize( YUIDimension dim ) { return YRadioButtonGroup::nicesize( dim ); }
+ virtual int preferredWidth() { return YRadioButtonGroup::preferredWidth(); }
+ virtual int preferredHeight() { return YRadioButtonGroup::preferredHeight(); }
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void addRadioButton(YRadioButton *button);
virtual void removeRadioButton(YRadioButton *button);
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.cc Tue Jun 26 15:27:24 2007
@@ -57,7 +57,7 @@
//
// DESCRIPTION :
//
-void NCReplacePoint::setSize( long newwidth, long newheight )
+void NCReplacePoint::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YReplacePoint::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCReplacePoint.h Tue Jun 26 15:27:24 2007
@@ -50,8 +50,16 @@
NCReplacePoint( NCWidget * parent, const YWidgetOpt & opt );
virtual ~NCReplacePoint();
- virtual long nicesize( YUIDimension dim ) { return YReplacePoint::nicesize( dim ); }
- virtual void setSize( long newwidth, long newheight );
+ //virtual long nicesize( YUIDimension dim ) { return YReplacePoint::nicesize( dim ); }
+ virtual int preferredWidth() { return YReplacePoint::preferredWidth(); }
+ virtual int preferredHeight() { return YReplacePoint::preferredHeight(); }
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
};
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRichText.cc Tue Jun 26 15:27:24 2007
@@ -206,6 +206,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCRichText::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCRichText::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -214,7 +224,7 @@
//
// DESCRIPTION :
//
-void NCRichText::setSize( long newwidth, long newheight )
+void NCRichText::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YRichText::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCR…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCRichText.h Tue Jun 26 15:27:24 2007
@@ -204,7 +204,16 @@
virtual ~NCRichText();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.cc Tue Jun 26 15:27:24 2007
@@ -70,6 +70,18 @@
}
}
+int NCSelectionBox::preferredWidth()
+{
+ wsze sze = ( biglist ) ? myPad()->tableSize() + 2 : wGetDefsze();
+ return sze.W > (int)(labelWidht()+2) ? sze.W : (labelWidht()+2);
+}
+
+int NCSelectionBox::preferredHeight()
+{
+ wsze sze = ( biglist ) ? myPad()->tableSize() + 2 : wGetDefsze();
+ return sze.H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -78,7 +90,7 @@
//
// DESCRIPTION :
//
-void NCSelectionBox::setSize( long newwidth, long newheight )
+void NCSelectionBox::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YSelectionBox::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSelectionBox.h Tue Jun 26 15:27:24 2007
@@ -69,7 +69,16 @@
virtual void itemAdded( const YCPString& string, int index, bool selected );
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.cc Tue Jun 26 15:27:24 2007
@@ -71,7 +71,7 @@
//
// DESCRIPTION :
//
-void NCSpacing::setSize( long newwidth, long newheight )
+void NCSpacing::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YSpacing::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSpacing.h Tue Jun 26 15:27:24 2007
@@ -53,7 +53,13 @@
float size, bool horizontal, bool vertical );
virtual ~NCSpacing();
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
};
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSplit.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSplit.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSplit.cc Tue Jun 26 15:27:24 2007
@@ -58,7 +58,7 @@
//
// DESCRIPTION :
//
-void NCSplit::setSize( long newwidth, long newheight )
+void NCSplit::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YSplit::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSplit.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSplit.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSplit.h Tue Jun 26 15:27:24 2007
@@ -54,7 +54,13 @@
virtual ~NCSplit();
virtual long nicesize( YUIDimension dim ) { return YSplit::nicesize( dim ); }
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void moveChild( YWidget * child, long newx, long newy );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSquash.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSquash.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSquash.cc Tue Jun 26 15:27:24 2007
@@ -58,7 +58,7 @@
//
// DESCRIPTION :
//
-void NCSquash::setSize( long newwidth, long newheight )
+void NCSquash::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YSquash::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCSquash.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCS…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCSquash.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCSquash.h Tue Jun 26 15:27:24 2007
@@ -51,8 +51,16 @@
bool hsquash, bool vsquash );
virtual ~NCSquash();
- virtual long nicesize( YUIDimension dim ) { return YSquash::nicesize( dim ); }
- virtual void setSize( long newwidth, long newheight );
+ //virtual long nicesize( YUIDimension dim ) { return YSquash::nicesize( dim ); }
+ virtual int preferredWidth() { return YSquash::preferredWidth(); }
+ virtual int preferredHeight() { return YSquash::preferredHeight(); }
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
};
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTable.cc Tue Jun 26 15:27:24 2007
@@ -80,6 +80,18 @@
return dim == YD_HORIZ ? sze.W : sze.H;
}
+int NCTable::preferredWidth()
+{
+ wsze sze = ( biglist ) ? myPad()->tableSize() + 2 : wGetDefsze();
+ return sze.W;
+}
+
+int NCTable::preferredHeight()
+{
+ wsze sze = ( biglist ) ? myPad()->tableSize() + 2 : wGetDefsze();
+ return sze.H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -88,7 +100,7 @@
//
// DESCRIPTION :
//
-void NCTable::setSize( long newwidth, long newheight )
+void NCTable::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YTable::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTable.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTable.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTable.h Tue Jun 26 15:27:24 2007
@@ -90,7 +90,16 @@
virtual void itemAdded( vector<string> elements, int index );
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.cc Tue Jun 26 15:27:24 2007
@@ -99,6 +99,16 @@
return dim == YD_HORIZ ? wGetDefsze().W : wGetDefsze().H;
}
+int NCTextEntry::preferredWidth()
+{
+ return wGetDefsze().W;
+}
+
+int NCTextEntry::preferredHeight()
+{
+ return wGetDefsze().H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -107,7 +117,7 @@
//
// DESCRIPTION :
//
-void NCTextEntry::setSize( long newwidth, long newheight )
+void NCTextEntry::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YTextEntry::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTextEntry.h Tue Jun 26 15:27:24 2007
@@ -101,7 +101,16 @@
void setReturnOnReturn( bool on_br ) { returnOnReturn_b = on_br; }
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTree.cc Tue Jun 26 15:27:24 2007
@@ -249,6 +249,18 @@
return dim == YD_HORIZ ? sze.W : sze.H;
}
+int NCTree::preferredWidth()
+{
+ wsze sze = wsze::max( defsze, wsze( 0, labelWidht()+2 ) );
+ return sze.W;
+}
+
+int NCTree::preferredHeight()
+{
+ wsze sze = wsze::max( defsze, wsze( 0, labelWidht()+2 ) );
+ return sze.H;
+}
+
///////////////////////////////////////////////////////////////////
//
//
@@ -257,7 +269,7 @@
//
// DESCRIPTION :
//
-void NCTree::setSize( long newwidth, long newheight )
+void NCTree::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YTree::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCTree.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCT…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCTree.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCTree.h Tue Jun 26 15:27:24 2007
@@ -67,7 +67,16 @@
virtual ~NCTree();
virtual long nicesize( YUIDimension dim );
- virtual void setSize( long newwidth, long newheight );
+
+ virtual int preferredWidth();
+ virtual int preferredHeight();
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setLabel( const YCPString & nlabel );
virtual void rebuildTree();
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWeight.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCW…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWeight.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWeight.cc Tue Jun 26 15:27:24 2007
@@ -57,7 +57,7 @@
//
// DESCRIPTION :
//
-void NCWeight::setSize( long newwidth, long newheight )
+void NCWeight::setSize( int newwidth, int newheight )
{
wRelocate( wpos( 0 ), wsze( newheight, newwidth ) );
YWeight::setSize( newwidth, newheight );
Modified: branches/tmp/sh/mod-ui/ncurses/src/NCWeight.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/NCW…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/NCWeight.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/NCWeight.h Tue Jun 26 15:27:24 2007
@@ -52,7 +52,13 @@
virtual long minsize(YUIDimension dim) { return YWeight::minsize( dim ); }
virtual long nicesize( YUIDimension dim ) { return YWeight::nicesize( dim ); }
- virtual void setSize( long newwidth, long newheight );
+
+ /**
+ * Set the new size of the widget.
+ *
+ * Reimplemented from YWidget.
+ **/
+ virtual void setSize( int newWidth, int newHeight );
virtual void setEnabling( bool do_bv ) { NCWidget::setEnabling( enabled=do_bv ); }
};
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.cc Tue Jun 26 15:27:24 2007
@@ -24,6 +24,7 @@
#include "Y2Log.h"
#include <YEvent.h>
+#include "YDialog.h"
#include <ycp/y2log.h>
#include <ycp/Parser.h>
@@ -142,7 +143,7 @@
//
void YNCursesUI::idleLoop( int fd_ycp )
{
- NCDialog * ncd = static_cast<NCDialog *>( currentDialog() );
+ NCDialog * ncd = static_cast<NCDialog *>( YDialog::currentDialog() );
int timeout = 5;
struct timeval tv;
@@ -176,11 +177,21 @@
friend ostream & operator<<( std::ostream & STREAM, const NCtoY2Event & OBJ ) {
STREAM << static_cast<const NCursesEvent &>(OBJ);
+#if 0
if ( OBJ.selection.isNull() ) {
STREAM << "(-)";
} else {
STREAM << "(" << OBJ.selection->valuetype() << ")";
}
+#endif
+ if ( !OBJ.selection )
+ {
+ STREAM << "(-)";
+ }
+ else
+ {
+ STREAM << "(" << OBJ.selection->toString() << ")"; // FIXME valuetype()???
+ }
return STREAM << " for " << OBJ.widget;
}
@@ -209,7 +220,10 @@
return 0;
case menu:
- return new YMenuEvent( selection );
+ if ( selection )
+ return new YMenuEvent( selection->toString() );
+ else
+ return 0;
case cancel:
return new YCancelEvent();
@@ -250,7 +264,7 @@
//
YEvent * YNCursesUI::userInput( unsigned long timeout_millisec )
{
- NCDialog * ncd = static_cast<NCDialog *>( currentDialog() );
+ NCDialog * ncd = static_cast<NCDialog *>( YDialog::currentDialog() );
if ( !ncd ) {
UIERR << "No current NCDialog " << endl;
return 0;
@@ -277,7 +291,7 @@
//
YEvent * YNCursesUI::pollInput()
{
- NCDialog * ncd = static_cast<NCDialog *>( currentDialog() );
+ NCDialog * ncd = static_cast<NCDialog *>( YDialog::currentDialog() );
if ( !ncd ) {
UIERR << "No current NCDialog " << endl;
return 0;
@@ -341,22 +355,22 @@
dimension );
}
-YContainerWidget * YNCursesUI::createReplacePoint( YWidget * parent, YWidgetOpt & opt )
+YSingleChildContainerWidget * YNCursesUI::createReplacePoint( YWidget * parent, YWidgetOpt & opt )
{
ONCREATE;
return new NCReplacePoint( dynamic_cast<NCWidget *>( parent ), opt );
}
-YContainerWidget * YNCursesUI::createAlignment( YWidget * parent, YWidgetOpt & opt,
- YAlignmentType halign,
- YAlignmentType valign )
+YSingleChildContainerWidget * YNCursesUI::createAlignment( YWidget * parent,
+ YAlignmentType halign,
+ YAlignmentType valign )
{
ONCREATE;
- return new NCAlignment( dynamic_cast<NCWidget *>( parent ), opt,
+ return new NCAlignment( dynamic_cast<NCWidget *>( parent ),
halign, valign );
}
-YContainerWidget * YNCursesUI::createSquash( YWidget * parent, YWidgetOpt & opt,
+YSingleChildContainerWidget * YNCursesUI::createSquash( YWidget * parent, YWidgetOpt & opt,
bool hsquash,
bool vsquash )
{
@@ -365,13 +379,7 @@
hsquash, vsquash );
}
-YContainerWidget * YNCursesUI::createRadioButtonGroup( YWidget * parent, YWidgetOpt & opt )
-{
- ONCREATE;
- return new NCRadioButtonGroup( dynamic_cast<NCWidget *>( parent ), opt );
-}
-
-YContainerWidget * YNCursesUI::createFrame( YWidget * parent, YWidgetOpt & opt,
+YSingleChildContainerWidget * YNCursesUI::createFrame( YWidget * parent, YWidgetOpt & opt,
const YCPString & label )
{
ONCREATE;
@@ -379,7 +387,7 @@
label );
}
-YContainerWidget * YNCursesUI::createCheckBoxFrame( YWidget * parent, YWidgetOpt & opt,
+YSingleChildContainerWidget * YNCursesUI::createCheckBoxFrame( YWidget * parent, YWidgetOpt & opt,
const YCPString & label, bool checked )
{
ONCREATE;
@@ -451,14 +459,12 @@
label );
}
-YWidget * YNCursesUI::createRadioButton( YWidget * parent, YWidgetOpt & opt,
- YRadioButtonGroup * rbg,
- const YCPString & label,
- bool checked )
+YWidget * YNCursesUI::createRadioButton( YWidget * parent,
+ const YCPString & label )
{
ONCREATE;
- return new NCRadioButton( dynamic_cast<NCWidget *>( parent ), opt,
- rbg, label, checked );
+ return new NCRadioButton( dynamic_cast<NCWidget *>( parent ),
+ label );
}
YWidget * YNCursesUI::createCheckBox( YWidget * parent, YWidgetOpt & opt,
@@ -660,7 +666,7 @@
{
YCPValue result = YCPVoid();
- YDialog *dialog = YUI::currentDialog();
+ YDialog *dialog = YDialog::currentDialog();
NCPackageSelectorPlugin * plugin = packageSelectorPlugin();
if ( !dialog )
Modified: branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/YNC…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/YNCursesUI.h Tue Jun 26 15:27:24 2007
@@ -25,6 +25,8 @@
#include <Y2.h>
#include "YUI.h"
+#include "YSingleChildContainerWidget.h"
+
#include "NCurses.h"
class YUI;
@@ -118,19 +120,19 @@
/**
* Creates a replace point.
*/
- virtual YContainerWidget * createReplacePoint( YWidget * parent, YWidgetOpt & opt );
+ virtual YSingleChildContainerWidget * createReplacePoint( YWidget * parent, YWidgetOpt & opt );
/**
* Creates an alignment widget
*/
- virtual YContainerWidget * createAlignment( YWidget * parent, YWidgetOpt & opt,
+ virtual YSingleChildContainerWidget * createAlignment( YWidget * parent,
YAlignmentType halign,
YAlignmentType valign);
/**
* Creates a squash widget
*/
- virtual YContainerWidget * createSquash( YWidget * parent, YWidgetOpt & opt,
+ virtual YSingleChildContainerWidget * createSquash( YWidget * parent, YWidgetOpt & opt,
bool hsquash,
bool vsquash );
@@ -142,12 +144,12 @@
/**
* Creates a frame widget
*/
- virtual YContainerWidget * createFrame( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label );
+ virtual YSingleChildContainerWidget * createFrame( YWidget * parent, YWidgetOpt & opt,
+ const YCPString & label );
- virtual YContainerWidget * createCheckBoxFrame( YWidget * parent, YWidgetOpt & opt,
- const YCPString & label,
- bool checked );
+ virtual YSingleChildContainerWidget * createCheckBoxFrame( YWidget * parent, YWidgetOpt & opt,
+ const YCPString & label,
+ bool checked );
//
// Widget creation functions - leaf widgets
//
@@ -221,10 +223,8 @@
* @param label Label of the radio button
* @param rbg the radio button group the new button will belong to
*/
- virtual YWidget * createRadioButton( YWidget * parent, YWidgetOpt & opt,
- //YRadioButtonGroup * rbg,
- const YCPString & label,
- bool checked );
+ virtual YWidget * createRadioButton( YWidget * parent,
+ const YCPString & label );
/**
* Creates a check box
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDeps.cc Tue Jun 26 15:27:24 2007
@@ -129,8 +129,8 @@
vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
- // add the headline
- opt.isHeading.setValue( true );
+ // FIXME: add the headline
+ // opt.isHeading.setValue( true );
head = new NCLabel( vSplit, opt, YCPString("") );
vSplit->addChild( head );
@@ -143,7 +143,8 @@
this);
vSplit->addChild( problemw );
opt.isHStretchable.setValue( true );
- opt.isHeading.setValue( false );
+ // FIXME
+ // opt.isHeading.setValue( false );
//vSplit->addChild( new NCSpacing( vSplit, opt, 0.2, false, true ) );
@@ -161,7 +162,8 @@
vSplit->addChild( solutionw );
opt.isHStretchable.setValue( false );
- opt.isHeading.setValue( true );
+ // FIXME
+ //opt.isHeading.setValue( true );
vSplit->addChild( new NCSpacing( vSplit, opt, 0.6, false, true ) );
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDescr.cc Tue Jun 26 15:27:24 2007
@@ -86,8 +86,8 @@
split->addChild( new NCSpacing( split, opt, 0.8, false, true ) );
- // add the headline
- opt.isHeading.setValue( true );
+ // FIXME - add the headline
+ // opt.isHeading.setValue( true );
headline = new NCLabel( split, opt, YCPString( "" ) );
split->addChild( headline );
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupDiskspace.cc Tue Jun 26 15:27:24 2007
@@ -105,8 +105,8 @@
NCSplit * split = new NCSplit( this, opt, YD_VERT );
addChild( split );
- // add the headline
- opt.isHeading.setValue( true );
+ // FIXME - add the headline
+ // opt.isHeading.setValue( true );
head = new NCLabel( split, opt, YCPString( "" ) );
split->addChild( head );
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSearch.cc Tue Jun 26 15:27:24 2007
@@ -29,6 +29,8 @@
#include "NCPkgNames.h"
#include "NCPackageSelector.h"
+#include "YWidgetID.h"
+
#include "NCi18n.h"
/*
@@ -91,8 +93,8 @@
vSplit->addChild( new NCSpacing( vSplit, opt, 0.8, false, true ) );
- // add the headline
- opt.isHeading.setValue( true );
+ // FIXME - add the headline
+ // opt.isHeading.setValue( true );
NCLabel * head = new NCLabel( vSplit, opt, headline );
vSplit->addChild( head );
@@ -157,12 +159,14 @@
// add the cancel and the ok button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( hSplit3, opt, YCPString(NCPkgNames::OKLabel()) );
- okButton->setId( NCPkgNames::OkButton () );
+ YStringWidgetID * okID = new YStringWidgetID("ok");
+ okButton->setId( okID );
opt.key_Fxx.setValue( 9 );
opt.isVStretchable.setValue( false );
cancelButton = new NCPushButton( hSplit3, opt, YCPString(NCPkgNames::CancelLabel()) );
- cancelButton->setId( NCPkgNames::Cancel () );
+ YStringWidgetID * cancelID = new YStringWidgetID("cancel");
+ cancelButton->setId( cancelID );
opt.isHStretchable.setValue( true );
hSplit3->addChild( new NCSpacing( hSplit3, opt, 0.2, true, false ) );
@@ -281,10 +285,10 @@
postevent.result = YCPNull();
- YCPValue currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
- if ( !currentId.isNull() &&
- currentId->compare( NCPkgNames::Cancel () ) == YO_EQUAL )
+ if ( currentId &&
+ currentId->toString() == "cancel" )
{
postevent = NCursesEvent::cancel;
}
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupSelection.cc Tue Jun 26 15:27:24 2007
@@ -101,8 +101,8 @@
opt.notifyMode.setValue( false );
- //the headline
- opt.isHeading.setValue( true );
+ // FIXME - the headline
+ // opt.isHeading.setValue( true );
NCLabel * head = new NCLabel( split, opt, label );
split->addChild( head );
@@ -142,7 +142,8 @@
// add an OK button
opt.key_Fxx.setValue( 10 );
okButton = new NCPushButton( split, opt, YCPString(NCPkgNames::OKLabel()) );
- okButton->setId( NCPkgNames::OkButton () );
+ YStringWidgetID * okID = new YStringWidgetID("ok");
+ okButton->setId( okID );
split->addChild( okButton );
@@ -310,10 +311,10 @@
postevent.detail = NCursesEvent::NODETAIL;
- YCPValue currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
+ YWidgetID * currentId = dynamic_cast<YWidget *>(postevent.widget)->id();
- if ( !currentId.isNull()
- && currentId->compare( NCPkgNames::OkButton () ) == YO_EQUAL )
+ if ( currentId
+ && currentId->toString() == "ok" )
{
postevent.detail = NCursesEvent::USERDEF ;
// return false means: close the popup
Modified: branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/ncurses/src/pkg…
==============================================================================
--- branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc (original)
+++ branches/tmp/sh/mod-ui/ncurses/src/pkg/NCPkgPopupTable.cc Tue Jun 26 15:27:24 2007
@@ -86,14 +86,14 @@
split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
- // add the headline
- opt.isHeading.setValue( true );
+ // FIXME - add the headline
+ // opt.isHeading.setValue( true );
NCLabel * head = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeLabel()) );
split->addChild( head );
split->addChild( new NCSpacing( split, opt, 0.6, false, true ) );
-
- opt.isHeading.setValue( false );
+ // FIXME
+ // opt.isHeading.setValue( false );
NCLabel * lb1 = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeText1()) );
split->addChild( lb1 );
NCLabel * lb2 = new NCLabel( split, opt, YCPString(NCPkgNames::AutoChangeText2()) );
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
26 Jun '07
Author: benjimanw
Date: Tue Jun 26 15:20:12 2007
New Revision: 39033
URL: http://svn.opensuse.org/viewcvs/yast?rev=39033&view=rev
Log:
Test commit
Modified:
trunk/metapackage/schema/foo.xml
Modified: trunk/metapackage/schema/foo.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/metapackage/schema/foo.xml?rev=3…
==============================================================================
--- trunk/metapackage/schema/foo.xml (original)
+++ trunk/metapackage/schema/foo.xml Tue Jun 26 15:20:12 2007
@@ -1,7 +1,7 @@
<?xml version='1.0'?>
<metapackage xmlns:os="http://opensuse.org/Standards/One_Click_Install" xmlns="http://opensuse.org/Standards/One_Click_Install">
<group distversion="openSUSE Factory">
- <repositories>
+ <repositories>
<repository recommended="true" format="yast">
<name>Main Repository</name>
<summary>This is the main openSUSE catalogue</summary>
@@ -50,4 +50,4 @@
</product>
</products>
</group>
-</metapackage>
\ No newline at end of file
+</metapackage>
--
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] r39032 - in /trunk/metapackage/schema: ./ README foo.xml oneclick.rnc oneclick.rng oneclick.xsd
by mvidner@svn.opensuse.org 26 Jun '07
by mvidner@svn.opensuse.org 26 Jun '07
26 Jun '07
Author: mvidner
Date: Tue Jun 26 13:57:34 2007
New Revision: 39032
URL: http://svn.opensuse.org/viewcvs/yast?rev=39032&view=rev
Log:
Added schema and example from
http://en.opensuse.org/Standards/One_Click_Install
Added:
trunk/metapackage/schema/
trunk/metapackage/schema/README
trunk/metapackage/schema/foo.xml
trunk/metapackage/schema/oneclick.rnc
trunk/metapackage/schema/oneclick.rng
trunk/metapackage/schema/oneclick.xsd
Added: trunk/metapackage/schema/README
URL: http://svn.opensuse.org/viewcvs/yast/trunk/metapackage/schema/README?rev=39…
==============================================================================
--- trunk/metapackage/schema/README (added)
+++ trunk/metapackage/schema/README Tue Jun 26 13:57:34 2007
@@ -0,0 +1,12 @@
+Schemas for http://en.opensuse.org/Standards/One_Click_Install
+rewritten in Relax NG.
+
+Conversion:
+
+trang oneclick.rnc oneclick.rng
+trang oneclick.rnc oneclick.xsd
+
+Validation:
+
+xmllint --noout --relaxng oneclick.rng foo.xml
+jing -c oneclick.rnc foo.xml
Added: trunk/metapackage/schema/foo.xml
URL: http://svn.opensuse.org/viewcvs/yast/trunk/metapackage/schema/foo.xml?rev=3…
==============================================================================
--- trunk/metapackage/schema/foo.xml (added)
+++ trunk/metapackage/schema/foo.xml Tue Jun 26 13:57:34 2007
@@ -0,0 +1,53 @@
+<?xml version='1.0'?>
+<metapackage xmlns:os="http://opensuse.org/Standards/One_Click_Install" xmlns="http://opensuse.org/Standards/One_Click_Install">
+ <group distversion="openSUSE Factory">
+ <repositories>
+ <repository recommended="true" format="yast">
+ <name>Main Repository</name>
+ <summary>This is the main openSUSE catalogue</summary>
+ <summary lang="en_US">This is the main openSUSE catalog</summary>
+ <description>This is the main openSUSE package repository containing blah blah blah</description>
+ <description lang="de">Insert German Here</description>
+ <url>http://download.opensuse.org/distribution/SL-OSS-factory/inst-source</url>
+ <url score="5" location="ie">http://ftp.heanet.ie/mirrors/ftp.opensuse.org/opensuse/distribution/SL-OSS-…</url>
+ </repository>
+ <repository recommended="false">
+ <name>Some Other Repo</name>
+ <summary>Blah Blah</summary>
+ <description>blah blah blah</description>
+ <url>http://example.com</url>
+ </repository>
+ </repositories>
+ <products>
+ <product>
+ <name>MyFavouritePackage</name>
+ <summary>This is my favourite package</summary>
+ <summary lang="en_US">This is my favorite package</summary>
+ <description>Blah blah blah</description>
+ </product>
+ <product type="pattern">
+ <name>SomePattern</name>
+ <summary>Demo other resolveable</summary>
+ <description>Blah blah blah</description>
+ </product>
+ </products>
+ </group>
+ <group distversion="openSUSE 10.2">
+ <repositories>
+ <repository>
+ <name>Main Repository</name>
+ <summary>This is the main openSUSE catalogue</summary>
+ <description>This is the main openSUSE package repository containing blah blah blah</description>
+ <url>http://ftp.heanet.ie/mirrors/ftp.opensuse.org/opensuse/distribution/10.2/re…</url>
+ </repository>
+ </repositories>
+ <products>
+ <product>
+ <name>MyFavouritePackage</name>
+ <summary>This is my favourite package</summary>
+ <summary lang="en_US">This is my favorite package</summary>
+ <description>Blah blah blah</description>
+ </product>
+ </products>
+ </group>
+</metapackage>
\ No newline at end of file
Added: trunk/metapackage/schema/oneclick.rnc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/metapackage/schema/oneclick.rnc?…
==============================================================================
--- trunk/metapackage/schema/oneclick.rnc (added)
+++ trunk/metapackage/schema/oneclick.rnc Tue Jun 26 13:57:34 2007
@@ -0,0 +1,48 @@
+default namespace = "http://opensuse.org/Standards/One_Click_Install"
+
+product = (
+ element name {string},
+ element summary {translateablestring} +,
+ element description {translateablestring} +,
+ attribute type {string} ?, # DEFAULT package
+ attribute recommended {xsd:boolean} ?, # DEFAULT true
+ attribute architectures {string} ?, # DEFAULT all
+ attribute action {string} ? # DEFAULT install
+)
+
+repository = (
+ element name {string},
+ element summary {translateablestring} +,
+ element description {translateablestring} +,
+ element url {mirrorableURL} +,
+ attribute recommended {xsd:boolean} ?, # DEFAULT true
+ attribute format {string} ?, # DEFAULT auto
+ attribute producturi {string} ? # DEFAULT /
+)
+
+translateablestring = (
+ attribute lang {string} ?,
+ string
+)
+
+mirrorableURL = (
+ attribute score {xsd:integer} ?, # DEFAULT 10
+ attribute location {string} ?,
+ string
+)
+
+group = (
+ element repositories {
+ element repository { repository } *
+ },
+ element products {
+ element product { product } *
+ },
+ attribute recommended {xsd:boolean} ?, # DEFAULT true
+ attribute distversion {string}
+)
+
+start =
+element metapackage {
+ element group { group } +
+}
Added: trunk/metapackage/schema/oneclick.rng
URL: http://svn.opensuse.org/viewcvs/yast/trunk/metapackage/schema/oneclick.rng?…
==============================================================================
--- trunk/metapackage/schema/oneclick.rng (added)
+++ trunk/metapackage/schema/oneclick.rng Tue Jun 26 13:57:34 2007
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar ns="http://opensuse.org/Standards/One_Click_Install" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <define name="product">
+ <group>
+ <element name="name">
+ <data type="string" datatypeLibrary=""/>
+ </element>
+ <oneOrMore>
+ <element name="summary">
+ <ref name="translateablestring"/>
+ </element>
+ </oneOrMore>
+ <oneOrMore>
+ <element name="description">
+ <ref name="translateablestring"/>
+ </element>
+ </oneOrMore>
+ <optional>
+ <attribute name="type">
+ <data type="string" datatypeLibrary=""/>
+ </attribute>
+ </optional>
+ <optional>
+ <!-- DEFAULT package -->
+ <attribute name="recommended">
+ <data type="boolean"/>
+ </attribute>
+ </optional>
+ <optional>
+ <!-- DEFAULT true -->
+ <attribute name="architectures">
+ <data type="string" datatypeLibrary=""/>
+ </attribute>
+ </optional>
+ <optional>
+ <!-- DEFAULT all -->
+ <attribute name="action">
+ <data type="string" datatypeLibrary=""/>
+ </attribute>
+ </optional>
+ </group>
+ <!-- DEFAULT install -->
+ </define>
+ <define name="repository">
+ <group>
+ <element name="name">
+ <data type="string" datatypeLibrary=""/>
+ </element>
+ <oneOrMore>
+ <element name="summary">
+ <ref name="translateablestring"/>
+ </element>
+ </oneOrMore>
+ <oneOrMore>
+ <element name="description">
+ <ref name="translateablestring"/>
+ </element>
+ </oneOrMore>
+ <oneOrMore>
+ <element name="url">
+ <ref name="mirrorableURL"/>
+ </element>
+ </oneOrMore>
+ <optional>
+ <attribute name="recommended">
+ <data type="boolean"/>
+ </attribute>
+ </optional>
+ <optional>
+ <!-- DEFAULT true -->
+ <attribute name="format">
+ <data type="string" datatypeLibrary=""/>
+ </attribute>
+ </optional>
+ <optional>
+ <!-- DEFAULT auto -->
+ <attribute name="producturi">
+ <data type="string" datatypeLibrary=""/>
+ </attribute>
+ </optional>
+ </group>
+ <!-- DEFAULT / -->
+ </define>
+ <define name="translateablestring">
+ <optional>
+ <attribute name="lang">
+ <data type="string" datatypeLibrary=""/>
+ </attribute>
+ </optional>
+ <data type="string" datatypeLibrary=""/>
+ </define>
+ <define name="mirrorableURL">
+ <optional>
+ <attribute name="score">
+ <data type="integer"/>
+ </attribute>
+ </optional>
+ <optional>
+ <!-- DEFAULT 10 -->
+ <attribute name="location">
+ <data type="string" datatypeLibrary=""/>
+ </attribute>
+ </optional>
+ <data type="string" datatypeLibrary=""/>
+ </define>
+ <define name="group">
+ <element name="repositories">
+ <zeroOrMore>
+ <element name="repository">
+ <ref name="repository"/>
+ </element>
+ </zeroOrMore>
+ </element>
+ <element name="products">
+ <zeroOrMore>
+ <element name="product">
+ <ref name="product"/>
+ </element>
+ </zeroOrMore>
+ </element>
+ <optional>
+ <attribute name="recommended">
+ <data type="boolean"/>
+ </attribute>
+ </optional>
+ <!-- DEFAULT true -->
+ <attribute name="distversion">
+ <data type="string" datatypeLibrary=""/>
+ </attribute>
+ </define>
+ <start>
+ <element name="metapackage">
+ <oneOrMore>
+ <element name="group">
+ <ref name="group"/>
+ </element>
+ </oneOrMore>
+ </element>
+ </start>
+</grammar>
Added: trunk/metapackage/schema/oneclick.xsd
URL: http://svn.opensuse.org/viewcvs/yast/trunk/metapackage/schema/oneclick.xsd?…
==============================================================================
--- trunk/metapackage/schema/oneclick.xsd (added)
+++ trunk/metapackage/schema/oneclick.xsd Tue Jun 26 13:57:34 2007
@@ -0,0 +1,76 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" targetNamespace="http://opensuse.org/Standards/One_Click_Install" xmlns:o="http://opensuse.org/Standards/One_Click_Install">
+ <xs:complexType name="product">
+ <xs:sequence>
+ <xs:element ref="o:name"/>
+ <xs:element maxOccurs="unbounded" ref="o:summary"/>
+ <xs:element maxOccurs="unbounded" ref="o:description"/>
+ </xs:sequence>
+ <xs:attribute name="type" type="xs:string"/>
+ <xs:attribute name="recommended" type="xs:boolean"/>
+ <xs:attribute name="architectures" type="xs:string"/>
+ <xs:attribute name="action" type="xs:string"/>
+ </xs:complexType>
+ <xs:element name="name" type="xs:string"/>
+ <xs:element name="summary" type="o:translateablestring"/>
+ <xs:element name="description" type="o:translateablestring"/>
+ <xs:complexType name="repository">
+ <xs:sequence>
+ <xs:element ref="o:name"/>
+ <xs:element maxOccurs="unbounded" ref="o:summary"/>
+ <xs:element maxOccurs="unbounded" ref="o:description"/>
+ <xs:element maxOccurs="unbounded" ref="o:url"/>
+ </xs:sequence>
+ <xs:attribute name="recommended" type="xs:boolean"/>
+ <xs:attribute name="format" type="xs:string"/>
+ <xs:attribute name="producturi" type="xs:string"/>
+ </xs:complexType>
+ <xs:element name="url" type="o:mirrorableURL"/>
+ <xs:complexType name="translateablestring">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="lang" type="xs:string"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="mirrorableURL">
+ <xs:simpleContent>
+ <xs:extension base="xs:string">
+ <xs:attribute name="score" type="xs:integer"/>
+ <xs:attribute name="location" type="xs:string"/>
+ </xs:extension>
+ </xs:simpleContent>
+ </xs:complexType>
+ <xs:complexType name="group">
+ <xs:sequence>
+ <xs:element ref="o:repositories"/>
+ <xs:element ref="o:products"/>
+ </xs:sequence>
+ <xs:attribute name="recommended" type="xs:boolean"/>
+ <xs:attribute name="distversion" use="required" type="xs:string"/>
+ </xs:complexType>
+ <xs:element name="repositories">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="o:repository"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="repository" type="o:repository"/>
+ <xs:element name="products">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element minOccurs="0" maxOccurs="unbounded" ref="o:product"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="product" type="o:product"/>
+ <xs:element name="metapackage">
+ <xs:complexType>
+ <xs:sequence>
+ <xs:element maxOccurs="unbounded" ref="o:group"/>
+ </xs:sequence>
+ </xs:complexType>
+ </xs:element>
+ <xs:element name="group" type="o:group"/>
+</xs:schema>
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0