YaST Commits
Threads by month
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- 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
November 2007
- 24 participants
- 864 discussions
Author: sh-sh-sh
Date: Fri Nov 30 17:23:38 2007
New Revision: 42566
URL: http://svn.opensuse.org/viewcvs/yast?rev=42566&view=rev
Log:
Created tag stable-2_16_6 for qt
Added:
tags/stable-2_16_6/qt/
- copied from r42565, trunk/qt/
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
30 Nov '07
Author: sh-sh-sh
Date: Fri Nov 30 17:22:19 2007
New Revision: 42565
URL: http://svn.opensuse.org/viewcvs/yast?rev=42565&view=rev
Log:
Created tag stable-2_16_11 for core
Added:
tags/stable-2_16_11/core/
- copied from r42564, trunk/core/
--
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] r42564 - in /trunk/qt: VERSION package/yast2-qt.changes src/YQDialog.cc yast2-qt.spec.in
by sh-sh-sh@svn.opensuse.org 30 Nov '07
by sh-sh-sh@svn.opensuse.org 30 Nov '07
30 Nov '07
Author: sh-sh-sh
Date: Fri Nov 30 17:22:06 2007
New Revision: 42564
URL: http://svn.opensuse.org/viewcvs/yast?rev=42564&view=rev
Log:
new version for abuild
Modified:
trunk/qt/VERSION
trunk/qt/package/yast2-qt.changes
trunk/qt/src/YQDialog.cc
trunk/qt/yast2-qt.spec.in
Modified: trunk/qt/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/VERSION?rev=42564&r1=42563&r2…
==============================================================================
--- trunk/qt/VERSION (original)
+++ trunk/qt/VERSION Fri Nov 30 17:22:06 2007
@@ -1 +1 @@
-2.16.5
+2.16.6
Modified: trunk/qt/package/yast2-qt.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/package/yast2-qt.changes?rev=…
==============================================================================
--- trunk/qt/package/yast2-qt.changes (original)
+++ trunk/qt/package/yast2-qt.changes Fri Nov 30 17:22:06 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Nov 30 17:20:49 CET 2007 - sh(a)suse.de
+
+- Migrated YQDialog to mod-ui
+- V 2.16.6
+
+-------------------------------------------------------------------
Tue Nov 27 19:08:00 CET 2007 - sh(a)suse.de
- Moved all YCP related code out of YQWizard
Modified: trunk/qt/src/YQDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQDialog.cc?rev=42564&r1=…
==============================================================================
--- trunk/qt/src/YQDialog.cc (original)
+++ trunk/qt/src/YQDialog.cc Fri Nov 30 17:22:06 2007
@@ -208,6 +208,9 @@
_defaultButton = findDefaultButton( childrenBegin(), childrenEnd() );
+ YDialog::setDefaultButton( 0 ); // prevent complaints about multiple default buttons
+ YDialog::setDefaultButton( _defaultButton );
+
return _defaultButton;
}
@@ -314,6 +317,13 @@
_defaultButton = wizardDefaultButton( wizard );
}
+ if ( _defaultButton )
+ {
+ YDialog::setDefaultButton( 0 ); // prevent complaints about multiple default buttons
+ YDialog::setDefaultButton( _defaultButton );
+ }
+
+
YQGenericButton * def = _focusButton ? _focusButton : _defaultButton;
if ( def )
@@ -422,6 +432,10 @@
if ( _defaultButton && ! _focusButton )
_defaultButton->showAsDefault( true );
}
+
+
+ YDialog::setDefaultButton( 0 ); // prevent complaints about multiple default buttons
+ YDialog::setDefaultButton( _defaultButton );
}
Modified: trunk/qt/yast2-qt.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/yast2-qt.spec.in?rev=42564&r1…
==============================================================================
--- trunk/qt/yast2-qt.spec.in (original)
+++ trunk/qt/yast2-qt.spec.in Fri Nov 30 17:22:06 2007
@@ -5,8 +5,8 @@
BuildRequires: dbus-1-devel boost-devel libzypp-devel curl-devel docbook-xsl-stylesheets doxygen libdrm-devel libjpeg-devel libxcrypt-devel libxslt perl-XML-Writer qt3-devel rpm-devel sgml-skel update-desktop-files yast2-devtools yast2-core-devel hal-devel
Summary: -
-BuildRequires: yast2-core-devel >= 2.16.10
-Requires: yast2-core >= 2.16.10
+BuildRequires: yast2-core-devel >= 2.16.11
+Requires: yast2-core >= 2.16.11
Requires: libzypp >= 3.11.8
Provides: yast2_ui
Provides: y2base:/var/lib/YaST2/servers/qt
--
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] r42563 - in /trunk/core: VERSION libyui/src/ChangeLog package/yast2-core.changes
by sh-sh-sh@svn.opensuse.org 30 Nov '07
by sh-sh-sh@svn.opensuse.org 30 Nov '07
30 Nov '07
Author: sh-sh-sh
Date: Fri Nov 30 17:19:57 2007
New Revision: 42563
URL: http://svn.opensuse.org/viewcvs/yast?rev=42563&view=rev
Log:
new version for abuild
Modified:
trunk/core/VERSION
trunk/core/libyui/src/ChangeLog
trunk/core/package/yast2-core.changes
Modified: trunk/core/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/VERSION?rev=42563&r1=42562&…
==============================================================================
--- trunk/core/VERSION (original)
+++ trunk/core/VERSION Fri Nov 30 17:19:57 2007
@@ -1 +1 @@
-2.16.10
+2.16.11
Modified: trunk/core/libyui/src/ChangeLog
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/ChangeLog?rev=42…
==============================================================================
--- trunk/core/libyui/src/ChangeLog (original)
+++ trunk/core/libyui/src/ChangeLog Fri Nov 30 17:19:57 2007
@@ -438,4 +438,16 @@
* Moved WizardCommand parsing out to YCPWizardCommandParser
* Added lots of pure virtual functions to YWizard
* All YCPValue and other YCP related code can now be removed from
- YWizard-derived classes
\ No newline at end of file
+ YWizard-derived classes
+
+
+2007-11-30 sh(a)suse.de
+
+* Migrated YDialog
+* Removed YContainerWidget for good
+* Removed legacy YWidget::queryWidget() and YWidget::changeWidget() methods
+* Dropped support for outdated property handling with old
+ YWidget::queryWidget() and YWidget::changeWidget() methods
+* Dropped support for outdated YWidget( YWidgetOpt ) constructors
+* Removed unneeded YWidgetOpt fields
+* Added basic default button handling to YDialog and YPushButton
\ No newline at end of file
Modified: trunk/core/package/yast2-core.changes
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?…
==============================================================================
--- trunk/core/package/yast2-core.changes (original)
+++ trunk/core/package/yast2-core.changes Fri Nov 30 17:19:57 2007
@@ -1,4 +1,25 @@
-------------------------------------------------------------------
+Fri Nov 30 17:15:47 CET 2007 - sh(a)suse.de
+
+- Removed YContainerWidget for good
+- Removed legacy YWidget::queryWidget() and YWidget::changeWidget()
+ methods
+- Dropped support for outdated property handling with old
+ YWidget::queryWidget() and YWidget::changeWidget() methods
+- Dropped support for outdated YWidget( YWidgetOpt ) constructors
+- Unified Y*WidgetFactory::create*Dialog() methods:
+ - Added pure virtual YWidgetFactory::createDialog( type, colorMode)
+ - Made YWidgetFactory::createMainDialog() and
+ YWidgetFactory::createPopupDialog() non-virtual
+- Moved special YInputField macro handling for passwords
+ to YMacroRecorder (don't record passwords in macros)
+- Removed unneeded YWidgetOpt fields
+- Catch exceptions in evaluateReplaceWidget
+ (more graceful error handling)
+- Added basic default button handling to YDialog, YPushButton
+- V 2.16.11
+
+-------------------------------------------------------------------
Thu Nov 29 17:41:50 CET 2007 - locilka(a)suse.cz
- Added some examples to UI::GetDisplayInfo() documentation.
--
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] r42562 - in /trunk/core/libyui/src: YCPDialogParser.cc YWidgetOpt.h
by sh-sh-sh@svn.opensuse.org 30 Nov '07
by sh-sh-sh@svn.opensuse.org 30 Nov '07
30 Nov '07
Author: sh-sh-sh
Date: Fri Nov 30 17:19:46 2007
New Revision: 42562
URL: http://svn.opensuse.org/viewcvs/yast?rev=42562&view=rev
Log:
Removed obsolete YWidgetOpts
Modified:
trunk/core/libyui/src/YCPDialogParser.cc
trunk/core/libyui/src/YWidgetOpt.h
Modified: trunk/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCPDialogParser.…
==============================================================================
--- trunk/core/libyui/src/YCPDialogParser.cc (original)
+++ trunk/core/libyui/src/YCPDialogParser.cc Fri Nov 30 17:19:46 2007
@@ -166,7 +166,6 @@
else if ( sym == YUIOpt_vstretch ) opt.isVStretchable.setValue( true );
else if ( sym == YUIOpt_hvstretch ) { opt.isHStretchable.setValue( true ); opt.isVStretchable.setValue( true ); }
else if ( sym == YUIOpt_autoShortcut ) opt.autoShortcut.setValue( true );
- else if ( sym == YUIOpt_testMode ) opt.testMode.setValue( true );
else if ( sym == YUIOpt_boldFont ) opt.boldFont.setValue( true );
else if ( sym == YUIOpt_keyEvents ) opt.keyEvents.setValue( true );
else if ( sym == YUIOpt_key_F1 ) opt.key_Fxx.setValue( 1 );
@@ -1183,6 +1182,7 @@
{
string label;
string iconName;
+ bool isDefaultButton = false;
if ( isIconButton )
{
@@ -1219,7 +1219,7 @@
{
string sym = optList->value(o)->asSymbol()->symbol();
- if ( sym == YUIOpt_default ) opt.isDefaultButton.setValue( true );
+ if ( sym == YUIOpt_default ) isDefaultButton = true;
else logUnknownOption( term, optList->value(o) );
}
else logUnknownOption( term, optList->value(o) );
@@ -1227,7 +1227,7 @@
YPushButton * button = YUI::widgetFactory()->createPushButton( parent, label );
- if ( opt.isDefaultButton.value() )
+ if ( isDefaultButton )
button->setDefaultButton();
if ( isIconButton )
Modified: trunk/core/libyui/src/YWidgetOpt.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidgetOpt.h?rev…
==============================================================================
--- trunk/core/libyui/src/YWidgetOpt.h (original)
+++ trunk/core/libyui/src/YWidgetOpt.h Fri Nov 30 17:19:46 2007
@@ -124,18 +124,13 @@
YBoolOpt isVStretchable;
YBoolOpt autoShortcut;
YBoolOpt keyEvents;
- YBoolOpt testMode;
- YBoolOpt boldFont; // YCheckBox, YRadioButton, YLabel
// Widget-specific options
//
// See the respective widget doc in YCPDialogParser::parse???()
- YBoolOpt isDefaultButton; // YPushButton
- YBoolOpt isOutputField; // YLabel
- YBoolOpt autoScrollDown; // YRichText
- YBoolOpt plainTextMode; // YRichText
+ YBoolOpt boldFont; // YCheckBox, YRadioButton, YLabel
YLongOpt key_Fxx; // YPushButton: No. of F-Key (1..24), 0 if none
};
--
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] r42561 - /trunk/core/libyui/doc/examples/DefaultButtons2.ycp
by sh-sh-sh@svn.opensuse.org 30 Nov '07
by sh-sh-sh@svn.opensuse.org 30 Nov '07
30 Nov '07
Author: sh-sh-sh
Date: Fri Nov 30 17:13:19 2007
New Revision: 42561
URL: http://svn.opensuse.org/viewcvs/yast?rev=42561&view=rev
Log:
duplicate IDs
Modified:
trunk/core/libyui/doc/examples/DefaultButtons2.ycp
Modified: trunk/core/libyui/doc/examples/DefaultButtons2.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/doc/examples/Default…
==============================================================================
--- trunk/core/libyui/doc/examples/DefaultButtons2.ycp (original)
+++ trunk/core/libyui/doc/examples/DefaultButtons2.ycp Fri Nov 30 17:13:19 2007
@@ -73,8 +73,8 @@
`Heading( "Current workflow step:" ),
`VSpacing(0.5),
`HSquash( `InputField(`id(`stepName), "Step &Name: " ) ),
- `PushButton(`id(`doit), `opt(`default), "&Do something!" ),
- `PushButton(`id(`doit), `opt(`default), "&Do something!" )
+ `PushButton(`id(`doit1), `opt(`default), "&Do something!" ),
+ `PushButton(`id(`doit2), `opt(`default), "&Do something!" )
) );
foreach ( map step, base_installation_steps, ``{
@@ -110,7 +110,7 @@
show_step( current_step );
}
- if ( button == `doit )
+ if ( button == `doit1 )
{
y2milestone( "Doing something" );
}
--
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] r42560 - in /trunk/core/libyui/src: YDialog.cc YDialog.h YPushButton.cc
by sh-sh-sh@svn.opensuse.org 30 Nov '07
by sh-sh-sh@svn.opensuse.org 30 Nov '07
30 Nov '07
Author: sh-sh-sh
Date: Fri Nov 30 17:12:18 2007
New Revision: 42560
URL: http://svn.opensuse.org/viewcvs/yast?rev=42560&view=rev
Log:
Added default button handling
Modified:
trunk/core/libyui/src/YDialog.cc
trunk/core/libyui/src/YDialog.h
trunk/core/libyui/src/YPushButton.cc
Modified: trunk/core/libyui/src/YDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YDialog.cc?rev=4…
==============================================================================
--- trunk/core/libyui/src/YDialog.cc (original)
+++ trunk/core/libyui/src/YDialog.cc Fri Nov 30 17:12:18 2007
@@ -22,6 +22,7 @@
#include <ycp/YCPSymbol.h>
#include "YDialog.h"
#include "YShortcutManager.h"
+#include "YPushButton.h"
#include "YUIException.h"
using std::string;
@@ -43,6 +44,7 @@
YDialogType dialogType;
YDialogColorMode colorMode;
bool shortcutCheckPostponed;
+ YPushButton * defaultButton;
};
@@ -115,6 +117,26 @@
}
+YPushButton *
+YDialog::defaultButton() const
+{
+ return priv->defaultButton;
+}
+
+
+void
+YDialog::setDefaultButton( YPushButton * newDefaultButton )
+{
+ if ( newDefaultButton && priv->defaultButton ) // already have one?
+ {
+ y2error( "Too many `opt(`default) PushButtons: [%s]",
+ newDefaultButton->label().c_str() );
+ }
+
+ priv->defaultButton = newDefaultButton;
+}
+
+
void
YDialog::setInitialSize()
{
Modified: trunk/core/libyui/src/YDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YDialog.h?rev=42…
==============================================================================
--- trunk/core/libyui/src/YDialog.h (original)
+++ trunk/core/libyui/src/YDialog.h Fri Nov 30 17:12:18 2007
@@ -25,9 +25,10 @@
class YMacroRecorder;
class YShortcutManager;
+class YPushButton;
class YDialogPrivate;
-// See YTypes.h for enum YDialogType and enum YDialogColorMode
+// See YTypes.h for enum YDialogType and enum YDialogColorMode
class YDialog : public YSingleChildContainerWidget
@@ -62,7 +63,7 @@
* Delete the topmost dialog.
*
* Will throw a YUINoDialogException if there is no dialog and 'doThrow' is
- * 'true'.
+ * 'true'.
*
* Returns 'true' if there is another open dialog after deleting,
* 'false' if there is none.
@@ -84,7 +85,7 @@
* Return the current (topmost) dialog.
*
* If there is none, throw a YUINoDialogException if 'doThrow' is 'true'
- * and return 0 if 'doThrow' is false.
+ * and return 0 if 'doThrow' is false.
**/
static YDialog * currentDialog( bool doThrow = true );
@@ -132,6 +133,27 @@
bool shortcutCheckPostponed() const;
/**
+ * Return this dialog's default button: The button that is activated when
+ * the user hits [Return] anywhere in this dialog. Note that this is not
+ * the same as the button that currently has the keyboard focus.
+ *
+ * This might return 0 if there is no default button.
+ **/
+ YPushButton * defaultButton() const;
+
+ /**
+ * Set this dialog's default button (the button that is activated when
+ * the user hits [Return] anywhere in this dialog). 0 means no default
+ * button.
+ *
+ * There should be no more than one default button in a dialog.
+ *
+ * Derived classes are free to overwrite this method, but they should
+ * call this base class method in the new implementation.
+ **/
+ virtual void setDefaultButton( YPushButton * defaultButton );
+
+ /**
* Implements the ui command queryWidget
**/
YCPValue queryWidget( const YCPSymbol & property );
@@ -139,7 +161,7 @@
protected:
static std::stack<YDialog *> _dialogStack;
-
+
private:
ImplPtr<YDialogPrivate> priv;
Modified: trunk/core/libyui/src/YPushButton.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YPushButton.cc?r…
==============================================================================
--- trunk/core/libyui/src/YPushButton.cc (original)
+++ trunk/core/libyui/src/YPushButton.cc Fri Nov 30 17:12:18 2007
@@ -22,6 +22,7 @@
#include "YUI.h"
#include "YApplication.h"
+#include "YDialog.h"
#include "YUISymbols.h"
#include "YPushButton.h"
@@ -57,7 +58,12 @@
YPushButton::~YPushButton()
{
- // NOP
+ YDialog * dialog = findDialog();
+
+ if ( dialog && dialog->defaultButton() == this )
+ {
+ dialog->setDefaultButton( 0 );
+ }
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
[yast-commit] r42559 - in /branches/tmp/coolo/qt4-port: ./ doc/ doc/autodocs/ fonts/ src/ src/pkg/ src/pkg/icons/ testsuite/
by coolo@svn.opensuse.org 30 Nov '07
by coolo@svn.opensuse.org 30 Nov '07
30 Nov '07
Author: coolo
Date: Fri Nov 30 15:01:53 2007
New Revision: 42559
URL: http://svn.opensuse.org/viewcvs/yast?rev=42559&view=rev
Log:
remove automake support now that the spec file should be
fixed - autodocs may be problematic, I don't know
Removed:
branches/tmp/coolo/qt4-port/acinclude.m4
branches/tmp/coolo/qt4-port/configure.in.in
branches/tmp/coolo/qt4-port/doc/Makefile.am
branches/tmp/coolo/qt4-port/doc/autodocs/Makefile.am
branches/tmp/coolo/qt4-port/fonts/Makefile.am
branches/tmp/coolo/qt4-port/src/Makefile.am
branches/tmp/coolo/qt4-port/src/pkg/Makefile.am
branches/tmp/coolo/qt4-port/src/pkg/icons/Makefile.am
branches/tmp/coolo/qt4-port/testsuite/Makefile.am
Modified:
branches/tmp/coolo/qt4-port/Makefile.cvs
branches/tmp/coolo/qt4-port/src/CMakeLists.txt
Modified: branches/tmp/coolo/qt4-port/Makefile.cvs
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/Makefile.c…
==============================================================================
--- branches/tmp/coolo/qt4-port/Makefile.cvs (original)
+++ branches/tmp/coolo/qt4-port/Makefile.cvs Fri Nov 30 15:01:53 2007
@@ -6,18 +6,15 @@
PREFIX = /usr
-configure: all
- ./configure --prefix=$(PREFIX) --libdir=$(PREFIX)/$(LIB)
-
-all:
- y2tool y2autoconf
- y2tool y2automake
- autoreconf --force --install
+configure:
+ mkdir build ;\
+ cd build ;\
+ cmake -DCMAKE_INSTALL_PREFIX=$(PREFIX) -DLIB=$(LIB) ..
install: configure
- make
- make install
+ cd build; \
+ make && make install
-reconf: all
- ./config.status --recheck
- ./config.status
+reconf:
+ cd build ;\
+ cmake rebuild_cache
Modified: branches/tmp/coolo/qt4-port/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/CMakeL…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/CMakeLists.txt (original)
+++ branches/tmp/coolo/qt4-port/src/CMakeLists.txt Fri Nov 30 15:01:53 2007
@@ -2,7 +2,6 @@
ADD_DEFINITIONS(
-DY2LOG=\\\"QT4\\\" ${QT_DEFINITIONS}
-#-DQT3_SUPPORT
-DQT_LOCALEDIR=\\\"${CMAKE_INSTALL_PREFIX}/share/qt4/translations\\\"
-DICONDIR=\\"${Y2QT_ICONDIR}\\"
-DLOCALEDIR=\\\"${Y2QT_LOCALEDIR}\\\"
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0
30 Nov '07
Author: coolo
Date: Fri Nov 30 14:56:02 2007
New Revision: 42558
URL: http://svn.opensuse.org/viewcvs/yast?rev=42558&view=rev
Log:
#ifdefed out everything not compiling so it can be ported
class by class
Modified:
branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgDescriptionDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgDiskUsageList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgLangList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgProductList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.h
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictList.cc Fri Nov 30 14:56:02 2007
@@ -198,11 +198,10 @@
return;
// Write indentation
-
+#if FIXME
for ( int level = 0; level < item->depth(); level++ )
fprintf( file, " " );
-
// Write item
const Q3CheckListItem * checkListItem = dynamic_cast<const Q3CheckListItem *> (item);
@@ -237,6 +236,7 @@
child = child->nextSibling();
}
}
+#endif
}
@@ -255,6 +255,7 @@
if ( longText.isEmpty() )
return;
+#if FIXME
if ( ! header.isEmpty() )
{
parent = new QY2ListViewItem( parent, header );
@@ -292,6 +293,7 @@
new QY2ListViewItem( parent, *it );
++it;
}
+#endif
}
@@ -307,7 +309,9 @@
, _resolutionsHeader( 0 )
{
setBackgroundColor( LIGHT_BLUE );
+#if FIXME
setOpen( true );
+#endif
formatHeading();
YQPkgConflictList::dumpList( this, fromUTF8( _problem->details() ) );
@@ -323,7 +327,9 @@
QPixmap icon = YQIconPool::normalPkgConflict();
setTextColor( BRIGHT_RED );
+#if FIXME
setText( 0, Qt::DisplayRole, fromUTF8( problem()->description() ) );
+#endif
setData( 0, Qt::DecorationRole, icon );
}
@@ -336,7 +342,9 @@
// how to resolve this conflict
_( "Conflict Resolution:" ) );
Q_CHECK_PTR( _resolutionsHeader );
+#if FIXME
_resolutionsHeader->setOpen( true );
+#endif
_resolutionsHeader->setBackgroundColor( LIGHT_GREY );
zypp::ProblemSolutionList solutions = problem()->solutions();
@@ -358,7 +366,9 @@
int alignment )
{
painter->setFont( YQUI::yqApp()->headingFont() );
+#if FIXME
QY2ListViewItem::paintCell( painter, colorGroup, column, width, alignment );
+#endif
}
@@ -368,6 +378,7 @@
int count = 0;
QTreeWidgetItem * item;
+#if FIXME
while ( item = _resolutionsHeader->topLevelItem(count) )
{
YQPkgConflictResolution * res = dynamic_cast<YQPkgConflictResolution *> (item);
@@ -385,6 +396,7 @@
count++;
}
+#endif
return zypp::ProblemSolution_Ptr(); // Null pointer
}
@@ -396,10 +408,10 @@
YQPkgConflictResolution::YQPkgConflictResolution( QY2CheckListItem * parent,
zypp::ProblemSolution_Ptr solution )
: QY2CheckListItem( parent,
- fromUTF8( solution->description() ),
- /*Q3CheckListItem::RadioButton) */
- , _solution( solution ))
+ fromUTF8( solution->description() ) )
+ /*, Q3CheckListItem::RadioButton) */
{
+ _solution = solution;
YQPkgConflictList::dumpList( this, fromUTF8( solution->details() ) );
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgDescriptionDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgDescriptionDialog.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgDescriptionDialog.cc Fri Nov 30 14:56:02 2007
@@ -75,7 +75,7 @@
Q_CHECK_PTR( _pkgList );
_pkgList->resize( _pkgList->width(), 80 );
-
+
// Description view
_pkgDescription = new YQPkgDescriptionView( splitter );
@@ -133,7 +133,7 @@
_pkgList->addPkgItem( *it, tryCastToZyppPkg( zyppObj ) );
}
-
+#if FIXME
// Display description of the first pkg with that name
YQPkgObjListItem * firstItem = dynamic_cast<YQPkgObjListItem *> ( _pkgList->firstChild() );
@@ -142,6 +142,7 @@
_pkgDescription->showDetailsIfVisible( firstItem->selectable() );
else
_pkgDescription->clear();
+#endif
YQUI::ui()->normalCursor();
}
@@ -150,7 +151,11 @@
bool
YQPkgDescriptionDialog::isEmpty() const
{
- return _pkgList->firstChild() == 0;
+#if FIXME
+ return _pkgList->childCount() == 0;
+#else
+ return true;
+#endif
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgDiskUsageList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgDiskUsageList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgDiskUsageList.cc Fri Nov 30 14:56:02 2007
@@ -18,13 +18,12 @@
/-*/
-#define QT3_SUPPORT
-
#define y2log_component "qt-pkg"
#include <ycp/y2log.h>
#include <q3header.h>
#include <qstyle.h>
+#include <QHeaderView>
//Added by qt3to4:
#include <qevent.h>
@@ -114,7 +113,9 @@
y2error( "No entry for mount point %s", partitionDu.dir.c_str() );
}
+#if FIXME
sort();
+#endif
postPendingWarnings();
}
@@ -149,10 +150,12 @@
QSize
YQPkgDiskUsageList::sizeHint() const
{
- int width = header()->headerWidth()
+
#ifdef FIXME
+ int width = header()->headerWidth()
+ style().pixelMetric( QStyle::PM_ScrollBarExtent, verticalScrollBar() );
#else
+ int width = header()->sizeHint().width()
+ 30;
#endif
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgLangList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgLangList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgLangList.cc Fri Nov 30 14:56:02 2007
@@ -36,6 +36,7 @@
y2debug( "Creating language list" );
int numCol = 0;
+#if FIXME
addColumn( "" ); _statusCol = numCol++;
// Translators: Table column heading for language ISO code like "de_DE", "en_US"
@@ -45,6 +46,7 @@
// Full (human readable) language / country name like "German (Austria)"
addColumn( _( "Language" ) ); _summaryCol = numCol++;
setAllColumnsShowFocus( true );
+#endif
connect( this, SIGNAL( selectionChanged ( Q3ListViewItem * ) ),
this, SLOT ( filter() ) );
@@ -172,12 +174,16 @@
YQPkgLangListItem *
YQPkgLangList::selection() const
{
+#if FIXME
Q3ListViewItem * item = selectedItem();
if ( ! item )
return 0;
return dynamic_cast<YQPkgLangListItem *> (item);
+#else
+ return 0;
+#endif
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgList.cc Fri Nov 30 14:56:02 2007
@@ -41,6 +41,7 @@
_srpmStatusCol = -42;
int numCol = 0;
+#if FIXME
addColumn( "" ); _statusCol = numCol++;
// _statusCol = numCol;
addColumn( _( "Package" ) ); _nameCol = numCol++;
@@ -71,6 +72,7 @@
setAllColumnsShowFocus( true );
createActions();
+#endif
createSourceRpmContextMenu();
}
@@ -194,6 +196,7 @@
YQPkgList::setInstallCurrentSourceRpm( bool installSourceRpm,
bool selectNextItem )
{
+#if FIXME
QTreeWidgetItem * listViewItem = selectedItem();
if ( ! listViewItem )
@@ -211,6 +214,7 @@
setSelected( item->nextSibling(), true ); // emits signals
}
}
+#endif
}
@@ -220,6 +224,7 @@
if ( ! _editable )
return;
+#if FIXME
QTreeWidgetItem * listViewItem = firstChild();
while ( listViewItem )
@@ -233,6 +238,7 @@
listViewItem = listViewItem->nextSibling();
}
+#endif
}
@@ -407,6 +413,7 @@
// Write all items
//
+#if FIXME
const QTreeWidgetItem * item = firstChild();
while ( item )
@@ -434,7 +441,7 @@
item = item->nextSibling();
}
-
+#endif
// Clean up
if ( file )
@@ -607,8 +614,9 @@
YQIconPool::disabledPkgNoInst();
}
}
-
+#if FIXME
setPixmap( srpmStatusCol(), icon );
+#endif
}
@@ -753,6 +761,7 @@
int width,
int alignment )
{
+#if FIXME
if ( isDimmed() && ! YQUI::ui()->usingVisionImpairedPalette() )
{
QColorGroup cg = colorGroup;
@@ -795,6 +804,7 @@
QTreeWidgetItem::paintCell( painter, colorGroup, column, width, alignment );
}
}
+#endif
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgObjList.cc Fri Nov 30 14:56:02 2007
@@ -267,6 +267,7 @@
void
YQPkgObjList::setCurrentStatus( ZyppStatus newStatus, bool doSelectNextItem )
{
+#if FIXME
QTreeWidgetItem * listViewItem = selectedItem();
if ( ! listViewItem )
@@ -296,6 +297,7 @@
if ( doSelectNextItem )
selectNextItem();
+#endif
}
@@ -341,6 +343,7 @@
void
YQPkgObjList::selectNextItem()
{
+#if FIXME
QTreeWidgetItem * item = selectedItem();
if ( item && item->nextSibling() )
@@ -349,6 +352,7 @@
ensureItemVisible( item->nextSibling() ); // Scroll if necessary
setSelected( item->nextSibling(), true ); // Emits signals
}
+#endif
}
@@ -519,6 +523,7 @@
void
YQPkgObjList::updateActions( YQPkgObjListItem * item )
{
+#if FIXME
if ( !item)
item = dynamic_cast<YQPkgObjListItem *> ( selectedItem() );
@@ -560,12 +565,14 @@
actionSetCurrentUpdate->setEnabled( false );
actionSetCurrentProtected->setEnabled( false );
}
+#endif
}
void
YQPkgObjList::keyPressEvent( QKeyEvent * event )
{
+#if FIXME
if ( event )
{
unsigned special_combo = ( Qt::ControlButton | Qt::ShiftButton | Qt::AltButton );
@@ -579,7 +586,6 @@
}
}
-
QTreeWidgetItem * selectedListViewItem = selectedItem();
if ( selectedListViewItem )
@@ -681,8 +687,8 @@
}
}
}
-
- Q3ListView::keyPressEvent( event );
+#endif
+ QY2ListView::keyPressEvent( event );
}
@@ -810,6 +816,7 @@
void
YQPkgObjList::exclude( YQPkgObjListItem * item, bool exclude )
{
+#if FIXME
if ( exclude == item->isExcluded() )
return;
@@ -839,6 +846,7 @@
Q3ListView::insertItem( item );
}
}
+#endif
}
@@ -1030,6 +1038,7 @@
void
YQPkgObjListItem::setStatusIcon()
{
+#if FIXME
if ( statusCol() >= 0 )
{
bool enabled = editable() && _pkgObjList->editable();
@@ -1066,7 +1075,7 @@
_selectable->theObj()->summary().c_str() );
}
}
-
+#endif
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.cc Fri Nov 30 14:56:02 2007
@@ -54,6 +54,7 @@
_filterCriteria = RelevantPatches;
int numCol = 0;
+#if FIXME
addColumn( "" ); _statusCol = numCol++;
addColumn( _( "Patch" ) ); _nameCol = numCol++;
addColumn( _( "Summary" ) ); _summaryCol = numCol++;
@@ -75,6 +76,7 @@
setSorting( categoryCol() );
fillList();
+#endif
y2debug( "Creating patch list done" );
}
@@ -233,9 +235,10 @@
}
}
-
+#if FIXME
if ( ! firstChild() )
message( _( "No patches available." ) );
+#endif
y2debug( "patch list filled" );
}
@@ -352,12 +355,16 @@
YQPkgPatchListItem *
YQPkgPatchList::selection() const
{
+#if FIXME
Q3ListViewItem * item = selectedItem();
if ( ! item )
return 0;
return dynamic_cast<YQPkgPatchListItem *> (item);
+#else
+ return 0;
+#endif
}
@@ -588,7 +595,7 @@
* +1 if this > other
**/
int
-YQPkgPatchListItem::compare( Q3ListViewItem * otherListViewItem,
+YQPkgPatchListItem::compare( QTreeWidgetItem * otherListViewItem,
int col,
bool ascending ) const
{
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.h (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatchList.h Fri Nov 30 14:56:02 2007
@@ -273,7 +273,7 @@
*
* Reimplemented from QListViewItem.
**/
- virtual int compare( Q3ListViewItem * other,
+ virtual int compare( QTreeWidgetItem * other,
int col,
bool ascending ) const;
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgPatternList.cc Fri Nov 30 14:56:02 2007
@@ -45,6 +45,7 @@
y2debug( "Creating pattern list" );
int numCol = 0;
+#if FIXME
addColumn( "" ); _statusCol = numCol++;
// Translators: "Pattern" refers to so-called "installation patterns",
@@ -58,10 +59,10 @@
// Can use the same colum for "broken" and "satisfied":
// Both states are mutually exclusive
-
+
_satisfiedIconCol = _summaryCol;
_brokenIconCol = _summaryCol;
-
+
header()->setStretchEnabled( _statusCol , false );
header()->setStretchEnabled( _summaryCol, true );
@@ -79,7 +80,7 @@
fillList();
selectSomething();
}
-
+#endif
y2debug( "Creating pattern list done" );
}
@@ -214,12 +215,16 @@
YQPkgPatternListItem *
YQPkgPatternList::selection() const
{
+#if FIXME
QTreeWidgetItem * item = selectedItem();
if ( ! item )
return 0;
return dynamic_cast<YQPkgPatternListItem *> (item);
+#else
+ return 0;
+#endif
}
@@ -229,6 +234,7 @@
int col,
const QPoint & pos )
{
+#if FIXME
YQPkgPatternCategoryItem * categoryItem
= dynamic_cast<YQPkgPatternCategoryItem *> (listViewItem);
@@ -246,12 +252,14 @@
{
YQPkgObjList::pkgObjClicked( button, listViewItem, col, pos );
}
+#endif
}
void
YQPkgPatternList::selectSomething()
{
+#if FIXME
QTreeWidgetItemIterator it( this );
while ( *it )
@@ -268,6 +276,7 @@
++it;
}
+#endif
}
@@ -346,7 +355,7 @@
if ( otherCategoryItem ) // Patterns without category should always be sorted
return -1; // before any category
- return QTreeWidgetItem::compare( otherListViewItem, col, ascending );
+ return false; //FIXME QTreeWidgetItem::compare( otherListViewItem, col, ascending );
}
@@ -380,7 +389,7 @@
int alignment )
{
painter->setFont( YQUI::yqApp()->headingFont() );
- QY2ListViewItem::paintCell( painter, colorGroup, column, width, alignment );
+ //FIXME QY2ListViewItem::paintCell( painter, colorGroup, column, width, alignment );
}
@@ -403,7 +412,7 @@
void
YQPkgPatternCategoryItem::setOpen( bool open )
{
- QTreeWidgetItem::setOpen( open );
+ //FIXME QTreeWidgetItem::setOpen( open );
setTreeIcon();
}
@@ -411,11 +420,12 @@
void
YQPkgPatternCategoryItem::setTreeIcon()
{
+#if FIXME
setPixmap( _patternList->statusCol(),
isOpen() ?
YQIconPool::treeMinus() :
YQIconPool::treePlus() );
-
+#endif
}
@@ -443,7 +453,7 @@
if ( otherPatternListitem ) // Patterns without category should always be sorted
return 1; // before any category
- return QTreeWidgetItem::compare( otherListViewItem, col, ascending );
+ return false; // FIXME QTreeWidgetItem::compare( otherListViewItem, col, ascending );
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgProductList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgProductList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgProductList.cc Fri Nov 30 14:56:02 2007
@@ -38,6 +38,7 @@
y2debug( "Creating product list" );
int numCol = 0;
+#if FIXME
addColumn( "" ); _statusCol = numCol++;
addColumn( _( "Product" ) ); _nameCol = numCol++;
addColumn( _( "Summary" ) ); _summaryCol = numCol++;
@@ -49,6 +50,7 @@
setSorting( nameCol() );
fillList();
selectSomething();
+#endif
y2debug( "Creating product list done" );
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoList.cc Fri Nov 30 14:56:02 2007
@@ -46,7 +46,7 @@
_urlCol = -1;
int numCol = 0;
-
+#if FIXME
// Column headers for repository list
addColumn( _( "Name" ) ); _nameCol = numCol++;
addColumn( _( "URL" ) ); _urlCol = numCol++;
@@ -59,6 +59,7 @@
fillList();
selectSomething();
+#endif
y2debug( "Creating repository list done" );
}
@@ -105,6 +106,7 @@
void
YQPkgRepoList::filter()
{
+#if FIXME
emit filterStart();
y2milestone( "Collecting packages in selected repositories..." );
@@ -192,6 +194,7 @@
y2debug( "Packages sent to package list. Elapsed time: %f sec", stopWatch.elapsed() / 1000.0 );
emit filterFinished();
+#endif
}
@@ -205,12 +208,16 @@
YQPkgRepoListItem *
YQPkgRepoList::selection() const
{
+#if FIXME
Q3ListViewItem * item = selectedItem();
if ( ! item )
return 0;
return dynamic_cast<YQPkgRepoListItem *> (item);
+#else
+ return 0;
+#endif
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgSelList.cc Fri Nov 30 14:56:02 2007
@@ -37,13 +37,15 @@
y2debug( "Creating selection list" );
int numCol = 0;
+#if FIXME
addColumn( "" ); _statusCol = numCol++;
addColumn( _( "Selection" ) ); _summaryCol = numCol++;
setAllColumnsShowFocus( true );
+#endif
_satisfiedIconCol = _summaryCol;
_brokenIconCol = _summaryCol;
-
+
if ( autoFilter )
{
connect( this, SIGNAL( selectionChanged( QTreeWidgetItem * ) ),
@@ -158,12 +160,16 @@
YQPkgSelListItem *
YQPkgSelList::selection() const
{
+#if FIXME
QTreeWidgetItem * item = selectedItem();
if ( ! item )
return 0;
return dynamic_cast<YQPkgSelListItem *> (item);
+#else
+ return 0;
+#endif
}
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.cc Fri Nov 30 14:56:02 2007
@@ -50,12 +50,14 @@
_nameCol = -42;
_summaryCol = -42;
+#if FIXME
int numCol = 0;
addColumn( _( "Version" ) ); _versionCol = numCol++;
addColumn( _( "Arch." ) ); _archCol = numCol++;
addColumn( _( "Product" ) ); _productCol = numCol++;
addColumn( _( "Repository" ) ); _repoCol = numCol++;
addColumn( _( "URL" ) ); _urlCol = numCol++;
+#endif
_statusCol = _productCol;
_nameCol = _versionCol;
@@ -118,6 +120,7 @@
if ( ! selectable )
return;
+#if FIXME
QY2CheckListItem * root = new QY2CheckListItem( this, selectable->theObj()->name().c_str(),
Q3CheckListItem::Controller );
Q_CHECK_PTR( root );
@@ -149,12 +152,15 @@
if ( selectable->hasInstalledObj() && ! installedIsAvailable )
new YQPkgVersion( this, root, selectable, selectable->installedObj(), false );
+
+#endif
}
void
YQPkgVersionsView::checkForChangedCandidate()
{
+#if FIXME
if ( ! firstChild() || ! _selectable )
return;
@@ -220,6 +226,7 @@
item = item->nextSibling();
}
+#endif
}
@@ -239,15 +246,15 @@
ZyppSel selectable,
ZyppObj zyppObj,
bool enabled )
- : QY2CheckListItem( parent, "",
+ : QY2CheckListItem( parent, "" /*
enabled ?
Q3CheckListItem::RadioButton :
- Q3CheckListItem::Controller ) // cheap way to make it read-only
+ Q3CheckListItem::Controller */ ) // cheap way to make it read-only
, _pkgVersionList( pkgVersionList )
, _selectable( selectable )
, _zyppObj( zyppObj )
{
- setOn( _zyppObj == _selectable->candidateObj() );
+ // FIXME setOn( _zyppObj == _selectable->candidateObj() );
if ( versionCol() >= 0 ) setText( versionCol(), zyppObj->edition().asString().c_str() );
if ( archCol() >= 0 ) setText( archCol(), zyppObj->arch().asString().c_str() );
@@ -274,7 +281,7 @@
if ( _zyppObj->edition() == _selectable->installedObj()->edition() &&
_zyppObj->arch() == _selectable->installedObj()->arch() )
{
- setPixmap( statusCol(), YQIconPool::pkgKeepInstalled() );
+ // FIXME setPixmap( statusCol(), YQIconPool::pkgKeepInstalled() );
setBackgroundColor( QColor( 0xF0, 0xF0, 0xF0 ) ); // light grey
setTextColor( QColor( 0, 0x90, 0 ) ); // green
}
@@ -308,7 +315,7 @@
* +1 if this > other
**/
int
-YQPkgVersion::compare( Q3ListViewItem * otherListViewItem,
+YQPkgVersion::compare( QTreeWidgetItem * otherListViewItem,
int col,
bool ascending ) const
{
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQ…
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.h (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgVersionsView.h Fri Nov 30 14:56:02 2007
@@ -167,7 +167,7 @@
*
* Reimplemented from QListViewItem
**/
- virtual int compare( Q3ListViewItem * other,
+ virtual int compare( QTreeWidgetItem * other,
int col,
bool ascending ) const;
--
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] r42557 - in /trunk: core/libyui/doc/examples/ core/libyui/src/ ncurses/src/ qt/src/
by sh-sh-sh@svn.opensuse.org 30 Nov '07
by sh-sh-sh@svn.opensuse.org 30 Nov '07
30 Nov '07
Author: sh-sh-sh
Date: Fri Nov 30 14:19:17 2007
New Revision: 42557
URL: http://svn.opensuse.org/viewcvs/yast?rev=42557&view=rev
Log:
- Ported YDialog and derived to mod-ui
- Removed YContainerWidget for good
- Removed legacy YWidget::queryWidget() and YWidget::changeWidget()
methods
- Dropped support for outdated property handling with old
YWidget::queryWidget() and YWidget::changeWidget() methods
- Dropped support for outdated YWidget( YWidgetOpt ) constructors
- Unified Y*WidgetFactory::create*Dialog() methods:
- Added pure virtual YWidgetFactory::createDialog( type, colorMode)
- Made YWidgetFactory::createMainDialog() and
YWidgetFactory::createPopupDialog() non-virtual
- Moved special YInputField macro handling for passwords
to YMacroRecorder (don't record passwords in macros)
- Removed unneeded YWidgetOpt fields
- Catch exceptions in evaluateReplaceWidget
(more graceful error handling)
Removed:
trunk/core/libyui/src/YContainerWidget.cc
trunk/core/libyui/src/YContainerWidget.h
Modified:
trunk/core/libyui/doc/examples/DefaultSizeDialogs.ycp
trunk/core/libyui/src/Makefile.am
trunk/core/libyui/src/Y2UINamespace.cc
trunk/core/libyui/src/YCPDialogParser.cc
trunk/core/libyui/src/YCheckBoxFrame.cc
trunk/core/libyui/src/YDialog.cc
trunk/core/libyui/src/YDialog.h
trunk/core/libyui/src/YInputField.cc
trunk/core/libyui/src/YMacroRecorder.cc
trunk/core/libyui/src/YMacroRecorder.h
trunk/core/libyui/src/YTypes.h
trunk/core/libyui/src/YUI.h
trunk/core/libyui/src/YUISymbols.h
trunk/core/libyui/src/YUI_builtins.cc
trunk/core/libyui/src/YWidget.cc
trunk/core/libyui/src/YWidget.h
trunk/core/libyui/src/YWidgetFactory.cc
trunk/core/libyui/src/YWidgetFactory.h
trunk/core/libyui/src/YWidgetOpt.h
trunk/ncurses/src/NCDialog.cc
trunk/ncurses/src/NCDialog.h
trunk/ncurses/src/NCPopup.cc
trunk/ncurses/src/NCPopup.h
trunk/ncurses/src/NCWidgetFactory.cc
trunk/ncurses/src/NCWidgetFactory.h
trunk/ncurses/src/YNCursesUI.cc
trunk/ncurses/src/YNCursesUI.h
trunk/qt/src/YQDialog.cc
trunk/qt/src/YQDialog.h
trunk/qt/src/YQInputField.cc
trunk/qt/src/YQUI.h
trunk/qt/src/YQUI_core.cc
trunk/qt/src/YQWidgetFactory.cc
trunk/qt/src/YQWidgetFactory.h
Modified: trunk/core/libyui/doc/examples/DefaultSizeDialogs.ycp
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/doc/examples/Default…
==============================================================================
--- trunk/core/libyui/doc/examples/DefaultSizeDialogs.ycp (original)
+++ trunk/core/libyui/doc/examples/DefaultSizeDialogs.ycp Fri Nov 30 14:19:17 2007
@@ -35,6 +35,14 @@
);
UI::UserInput();
+ UI::OpenDialog(`opt(`defaultsize),
+ `VBox(
+ `Label( "A fourth main dialog" ),
+ `PushButton(`opt(`default), "OK\nLevel 4" )
+ )
+ );
+ UI::UserInput();
+
UI::OpenDialog( `VBox(
`Label( "And another independent popup dialog" ),
`PushButton(`opt(`default), "OK" )
@@ -46,5 +54,6 @@
UI::CloseDialog(); UI::UserInput();
UI::CloseDialog(); UI::UserInput();
UI::CloseDialog(); UI::UserInput();
+ UI::CloseDialog(); UI::UserInput();
UI::CloseDialog();
}
Modified: trunk/core/libyui/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/Makefile.am?rev=…
==============================================================================
--- trunk/core/libyui/src/Makefile.am (original)
+++ trunk/core/libyui/src/Makefile.am Fri Nov 30 14:19:17 2007
@@ -48,7 +48,6 @@
YCheckBox.cc \
YCheckBoxFrame.cc \
YComboBox.cc \
- YContainerWidget.cc \
YDateField.cc \
YDialog.cc \
YDownloadProgress.cc \
@@ -149,7 +148,6 @@
YCheckBox.h \
YCheckBoxFrame.h \
YComboBox.h \
- YContainerWidget.h \
YDateField.h \
YDialog.h \
YDownloadProgress.h \
Modified: trunk/core/libyui/src/Y2UINamespace.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/Y2UINamespace.cc…
==============================================================================
--- trunk/core/libyui/src/Y2UINamespace.cc (original)
+++ trunk/core/libyui/src/Y2UINamespace.cc Fri Nov 30 14:19:17 2007
@@ -173,8 +173,7 @@
Y2UINamespace::OpenDialog( const YCPTerm & opts, const YCPTerm & dialog_term )
{
if ( YUIComponent::ui() )
- // Notice: Parameter order is switched!
- return YUIComponent::ui()->evaluateOpenDialog( dialog_term, opts );
+ return YUIComponent::ui()->evaluateOpenDialog( opts, dialog_term );
else
return YCPVoid();
}
@@ -183,7 +182,7 @@
YCPValue
Y2UINamespace::OpenDialog( const YCPTerm & dialog_term )
{
- return m_comp->ui()->evaluateOpenDialog( dialog_term );
+ return m_comp->ui()->evaluateOpenDialog( YCPNull(), dialog_term );
}
Modified: trunk/core/libyui/src/YCPDialogParser.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCPDialogParser.…
==============================================================================
--- trunk/core/libyui/src/YCPDialogParser.cc (original)
+++ trunk/core/libyui/src/YCPDialogParser.cc Fri Nov 30 14:19:17 2007
@@ -317,29 +317,6 @@
if ( opt.isHStretchable.value() ) w->setStretchable( YD_HORIZ, true );
if ( opt.isVStretchable.value() ) w->setStretchable( YD_VERT, true );
if ( opt.key_Fxx.value() > 0 ) w->setFunctionKey( opt.key_Fxx.value() );
-
- if ( w->oldStyleConstructor() )
- {
- // FIXME: Obsolete
- // FIXME: Obsolete
- // FIXME: Obsolete
-
- if ( p && ! w->hasParent() )
- {
- w->setParent( p );
- }
-
- if ( ! p->contains( w ) )
- {
- y2warning( "Late adding child %s to %s", w->widgetClass(), p->widgetClass() );
- p->addChild( w );
- }
-
- // FIXME: Obsolete
- // FIXME: Obsolete
- // FIXME: Obsolete
- }
-
}
else
{
@@ -1248,21 +1225,6 @@
else logUnknownOption( term, optList->value(o) );
}
-
- // Look up default function keys unless explicitly set
-
-#if 0
- // FIXME
- // FIXME
- // FIXME
- if ( opt.key_Fxx.value() == 0 )
- opt.key_Fxx.setValue( defaultFunctionKey( YCPString( label ) ) );
- // FIXME
- // FIXME
- // FIXME
-#endif
-
-
YPushButton * button = YUI::widgetFactory()->createPushButton( parent, label );
if ( opt.isDefaultButton.value() )
@@ -1454,10 +1416,10 @@
else logUnknownOption( term, optList->value(o) );
}
- if ( opt.noAutoEnable.value() && opt.invertAutoEnable.value() )
+ if ( invertAutoEnable && ! autoEnable )
{
y2warning( "`opt(noAutoEnable) automatically disables `opt(`invertAutoEnable)" );
- opt.invertAutoEnable.setValue( false );
+ invertAutoEnable = false;
}
YCheckBoxFrame * checkBoxFrame = YUI::widgetFactory()->createCheckBoxFrame( parent, label, checked );
Modified: trunk/core/libyui/src/YCheckBoxFrame.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YCheckBoxFrame.c…
==============================================================================
--- trunk/core/libyui/src/YCheckBoxFrame.cc (original)
+++ trunk/core/libyui/src/YCheckBoxFrame.cc Fri Nov 30 14:19:17 2007
@@ -48,11 +48,6 @@
, priv( new YCheckBoxFramePrivate( label ) )
{
YUI_CHECK_NEW( priv );
-
-#if 0
- // FIXME
- _debugLabelWidget = this;
-#endif
}
Modified: trunk/core/libyui/src/YDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YDialog.cc?rev=4…
==============================================================================
--- trunk/core/libyui/src/YDialog.cc (original)
+++ trunk/core/libyui/src/YDialog.cc Fri Nov 30 14:19:17 2007
@@ -29,21 +29,30 @@
#define VERBOSE_DIALOGS 0
-
std::stack<YDialog *> YDialog::_dialogStack;
-YDialog::YDialog( const YWidgetOpt & opt )
- : YSingleChildContainerWidget( 0 )
+struct YDialogPrivate
{
- _hasDefaultSize.setValue( opt.hasDefaultSize.value() );
- _hasWarnColor.setValue( opt.hasWarnColor.value() );
- _hasInfoColor.setValue( opt.hasInfoColor.value() );
- _isDecorated.setValue( opt.isDecorated.value() );
- _isCentered.setValue( opt.isCentered.value() );
- _hasSmallDecorations.setValue( opt.hasSmallDecorations.value() );
- _shortcutCheckPostponed = false;
+ YDialogPrivate( YDialogType dialogType, YDialogColorMode colorMode )
+ : dialogType( dialogType )
+ , colorMode( colorMode )
+ , shortcutCheckPostponed( false )
+ {}
+
+ YDialogType dialogType;
+ YDialogColorMode colorMode;
+ bool shortcutCheckPostponed;
+};
+
+
+YDialog::YDialog( YDialogType dialogType, YDialogColorMode colorMode )
+ : YSingleChildContainerWidget( 0 )
+ , priv( new YDialogPrivate( dialogType, colorMode ) )
+{
+ YUI_CHECK_NEW( priv );
+
_dialogStack.push( this );
#if VERBOSE_DIALOGS
@@ -60,54 +69,54 @@
}
-YDialog *
-YDialog::currentDialog( bool doThrow )
+YDialogType
+YDialog::dialogType() const
{
- if ( _dialogStack.empty() )
- {
- if ( doThrow )
- YUI_THROW( YUINoDialogException() );
- return 0;
- }
- else
- return _dialogStack.top();
+ return priv->dialogType;
}
-bool
-YDialog::deleteTopmostDialog( bool doThrow )
+YDialogColorMode
+YDialog::colorMode() const
{
- if ( _dialogStack.empty() )
- {
- if ( doThrow )
- YUI_THROW( YUINoDialogException() );
- }
- else
- {
- delete _dialogStack.top();
- _dialogStack.pop();
- }
-
- return ! _dialogStack.empty();
+ return priv->colorMode;
}
void
-YDialog::deleteAllDialogs()
+YDialog::postponeShortcutCheck()
{
- while ( deleteTopmostDialog( false ) )
- {}
+ priv->shortcutCheckPostponed = true;
}
-int
-YDialog::openDialogsCount()
+bool
+YDialog::shortcutCheckPostponed() const
{
- return _dialogStack.size();
+ return priv->shortcutCheckPostponed;
+}
+
+
+void
+YDialog::checkShortcuts( bool force )
+{
+ if ( priv->shortcutCheckPostponed && ! force )
+ {
+ y2debug( "shortcut check postponed" );
+ }
+ else
+ {
+
+ YShortcutManager shortcutManager( this );
+ shortcutManager.checkShortcuts();
+
+ priv->shortcutCheckPostponed = false;
+ }
}
-void YDialog::setInitialSize()
+void
+YDialog::setInitialSize()
{
#if VERBOSE_DIALOGS
y2debug( "Setting initial size for YDialog at %p", this );
@@ -118,88 +127,52 @@
}
-void YDialog::checkShortcuts( bool force )
-{
- if ( _shortcutCheckPostponed && ! force )
- {
- y2debug( "shortcut check postponed" );
- return;
- }
- YShortcutManager shortcutManager( this );
- shortcutManager.checkShortcuts();
- _shortcutCheckPostponed = false;
-}
-
-
-YCPValue YDialog::queryWidget( const YCPSymbol & property )
+YDialog *
+YDialog::currentDialog( bool doThrow )
{
- string symbol = property->symbol();
-
- if ( symbol == YUIProperty_DebugLabel ||
- symbol == YUIProperty_DialogDebugLabel ) return YCPString( dialogDebugLabel() );
- else
+ if ( _dialogStack.empty() )
{
- return YWidget::queryWidget( property );
+ if ( doThrow )
+ YUI_THROW( YUINoDialogException() );
+ return 0;
}
+ else
+ return _dialogStack.top();
}
-string YDialog::dialogDebugLabel()
+bool
+YDialog::deleteTopmostDialog( bool doThrow )
{
-#if 0
- // FIXME
- // FIXME
- // FIXME
-
- if ( _debugLabelWidget )
+ if ( _dialogStack.empty() )
{
- string label = _debugLabelWidget->debugLabel();
-
- if ( ! label.empty() )
- return formatDebugLabel( _debugLabelWidget, label );
+ if ( doThrow )
+ YUI_THROW( YUINoDialogException() );
}
-
- for ( YWidgetListConstIterator * it = parent->childrenBegin();
- it != parent->childrenEnd();
- ++it )
+ else
{
- string label = (*it)->debugLabel();
-
- if ( ! label.empty() )
- return formatDebugLabel( child(i), label );
+ delete _dialogStack.top();
+ _dialogStack.pop();
}
- // FIXME
- // FIXME
- // FIXME
-#endif
-
- return widgetClass();
+ return ! _dialogStack.empty();
}
-string YDialog::formatDebugLabel( YWidget * widget, const string & debLabel )
+void
+YDialog::deleteAllDialogs()
{
- if ( debLabel.empty() )
- return "";
-
- string label = "Dialog with ";
+ while ( deleteTopmostDialog( false ) )
+ {}
+}
- if ( widget->hasChildren() )
- {
- label += debLabel;
- }
- else
- {
- label += widget->widgetClass();
- label += " \"";
- label += debLabel;
- label += "\"";
- }
- return label;
+int
+YDialog::openDialogsCount()
+{
+ return _dialogStack.size();
}
Modified: trunk/core/libyui/src/YDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YDialog.h?rev=42…
==============================================================================
--- trunk/core/libyui/src/YDialog.h (original)
+++ trunk/core/libyui/src/YDialog.h Fri Nov 30 14:19:17 2007
@@ -25,6 +25,9 @@
class YMacroRecorder;
class YShortcutManager;
+class YDialogPrivate;
+
+// See YTypes.h for enum YDialogType and enum YDialogColorMode
class YDialog : public YSingleChildContainerWidget
@@ -32,8 +35,15 @@
protected:
/**
* Constructor.
+ *
+ * 'dialogType' is one of YMainDialog or YPopupDialog.
+ *
+ * 'colorMode' can be set to YDialogWarnColor to use very bright "warning"
+ * colors or YDialogInfoColor to use more prominent, yet not quite as
+ * bright as "warning" colors. Use both only very rarely.
**/
- YDialog( const YWidgetOpt & opt );
+ YDialog( YDialogType dialogType,
+ YDialogColorMode colorMode = YDialogNormalColor );
/**
* Destructor.
@@ -43,6 +53,12 @@
public:
/**
+ * Return a descriptive name of this widget class for logging,
+ * debugging etc.
+ **/
+ virtual const char * widgetClass() const { return "YDialog"; }
+
+ /**
* Delete the topmost dialog.
*
* Will throw a YUINoDialogException if there is no dialog and 'doThrow' is
@@ -79,108 +95,54 @@
{ return currentDialog( doThrow ); }
/**
- * Returns a descriptive name of this widget class for logging,
- * debugging etc.
- **/
- virtual const char * widgetClass() const { return "YDialog"; }
-
- /**
- * Sets the initial dialog size. Honors the `defaultsize option
- * and -geometry
+ * Set the initial dialog size, depending on dialogType:
+ * YMainDialog dialogs get the UI's "default main window" size,
+ * YPopupDialog dialogs use their content's preferred size.
**/
void setInitialSize();
/**
- * Returns true if the dialog has the `defaultsize option set.
- **/
- bool hasDefaultSize() { return _hasDefaultSize.value(); }
-
- /**
- * Returns true if the dialog has the `warncolor option set.
+ * Return this dialog's type (YMainDialog / YPopupDialog).
**/
- bool hasWarnColor() { return _hasWarnColor.value(); }
+ YDialogType dialogType() const;
/**
- * Returns true if the dialog has the `infocolor option set.
+ * Return this dialog's color mode.
**/
- bool hasInfoColor() { return _hasInfoColor.value(); }
+ YDialogColorMode colorMode() const;
/**
- * Returns true if the dialog has the `decorated option set.
- **/
- bool isDecorated() { return _isDecorated.value(); }
-
- /**
- * Returns true if the dialog has the `decorated option set.
- **/
- bool isCentered() { return _isCentered.value(); }
-
- /**
- * Returns true if the dialog has the `smallDecorations option set.
- **/
- bool hasSmallDecorations() { return _hasSmallDecorations.value(); }
-
- /**
- * Checks the keyboard shortcuts of all children of this dialog
- * (not for sub-dialogs!) unless shortcut checks are postponed or 'force'
- * is 'true'.
+ * Checks the keyboard shortcuts of widgets in this dialog unless shortcut
+ * checks are postponed or 'force' is 'true'.
*
* A forced shortcut check resets postponed checking.
**/
void checkShortcuts( bool force = false );
/**
- * From now on, postpone keyboard shortcut checks -
- * i.e. normal ( not forced ) checkKeyboardShortcuts() will do nothing.
- * Reset this mode by forcing a shortcut check with
- * checkKeyboardShortcuts( true ).
+ * From now on, postpone keyboard shortcut checks - i.e. normal (not
+ * forced) checkKeyboardShortcuts() will do nothing. Reset this mode by
+ * forcing a shortcut check with checkKeyboardShortcuts( true ).
**/
- void postponeShortcutCheck() { _shortcutCheckPostponed = true; }
+ void postponeShortcutCheck();
/**
* Return whether or not shortcut checking is currently postponed.
**/
- bool shortcutCheckPostponed() const { return _shortcutCheckPostponed; }
+ bool shortcutCheckPostponed() const;
/**
* Implements the ui command queryWidget
**/
YCPValue queryWidget( const YCPSymbol & property );
- /**
- * Returns a (possibly translated) text describing this dialog for
- * debugging.
- **/
- virtual std::string dialogDebugLabel();
-
- /**
- * Alias for dialogDebugLabel();
- **/
- virtual std::string debugLabel() { return dialogDebugLabel(); }
-
-
protected:
- /**
- * Format a debug label.
- **/
- string formatDebugLabel( YWidget * widget, const string & debLabel );
-
-
- //
- // Data members
- //
+ static std::stack<YDialog *> _dialogStack;
- YBoolOpt _hasDefaultSize;
- YBoolOpt _hasWarnColor;
- YBoolOpt _hasInfoColor;
- YBoolOpt _isDecorated;
- YBoolOpt _isCentered;
- YBoolOpt _hasSmallDecorations;
+private:
- bool _shortcutCheckPostponed;
-
- static std::stack<YDialog *> _dialogStack;
+ ImplPtr<YDialogPrivate> priv;
};
Modified: trunk/core/libyui/src/YInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YInputField.cc?r…
==============================================================================
--- trunk/core/libyui/src/YInputField.cc (original)
+++ trunk/core/libyui/src/YInputField.cc Fri Nov 30 14:19:17 2007
@@ -178,34 +178,9 @@
void
YInputField::saveUserInput( YMacroRecorder *macroRecorder )
{
-#if 0
- // FIXME
- // FIXME
- // FIXME
-
- if ( passwordMode() )
- {
- if ( hasId() )
- {
- string text = "UI::";
- text += YUIBuiltin_ChangeWidget;
- text += "( " + id()->toString() + ", \t`";
- text += YUIProperty_Value;
- text += ", \"<not recording password in plain text>\" );\t// ";
- text += widgetClass();
- text += " \"" + debugLabel() + "\"";
-
- macroRecorder->recordComment( text );
- }
- }
- else
+ if ( ! passwordMode() ) // Don't record passwords in the macro file
{
macroRecorder->recordWidgetProperty( this, YUIProperty_Value );
}
-
- // FIXME
- // FIXME
- // FIXME
-#endif
}
Modified: trunk/core/libyui/src/YMacroRecorder.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YMacroRecorder.c…
==============================================================================
--- trunk/core/libyui/src/YMacroRecorder.cc (original)
+++ trunk/core/libyui/src/YMacroRecorder.cc Fri Nov 30 14:19:17 2007
@@ -30,6 +30,7 @@
#include "YUISymbols.h"
#include "YWidget.h"
+#include "YInputField.h"
#include "YDialog.h"
#include "YMacroRecorder.h"
#include "YUIComponent.h"
@@ -165,14 +166,6 @@
}
-void YMacroRecorder::recordDialogDebugLabel()
-{
- fprintf( _macroFile, "%s%s// %s\n",
- YMACRO_INDENT, YMACRO_INDENT,
- YDialog::currentDialog()->debugLabel().c_str() );
-}
-
-
void YMacroRecorder::recordComment( string text )
{
fprintf( _macroFile, "%s%s// %s\n",
@@ -187,7 +180,6 @@
return;
fprintf( _macroFile, "%s{\n", YMACRO_INDENT );
- recordDialogDebugLabel();
fprintf( _macroFile, "%s%s//\n", YMACRO_INDENT, YMACRO_INDENT );
recordYcpCodeLocation();
recordTimeStamp();
@@ -309,22 +301,41 @@
if ( ! widgetId )
return;
- YCPTerm idTerm( YUISymbol_id ); // `id()
+ YCPTerm idTerm( YUISymbol_id ); // `id()
idTerm->add( widgetId->value() ); // `id( `something )
- YCPValue val = widget->queryWidget( YCPSymbol( propertyName ) );
+ YInputField * inputField = dynamic_cast<YInputField *> (widget);
- fprintf( _macroFile, "%s%sUI::%s( %s,\t`%s,\t%s );\t// %s \"%s\"\n",
- // UI::ChangeWidget( `id( `something ), `Value, 42 ) // YWidget
- YMACRO_INDENT, YMACRO_INDENT,
- YUIBuiltin_ChangeWidget,
- idTerm->toString().c_str(),
- propertyName,
- val->toString().c_str(),
- widget->widgetClass(),
- widget->debugLabel().c_str() );
+ if ( inputField && inputField->passwordMode() )
+ {
+ // Don't record passwords in the macro file
- y2debug( "Recording %s status: %s: %s",
- widget->widgetClass(), propertyName, val->toString().c_str() );
+ string text = "UI::";
+ text += YUIBuiltin_ChangeWidget;
+ text += "( " + idTerm->toString() + ", \t`";
+ text += YUIProperty_Value;
+ text += ", \"<not recording password in plain text>\" );\t// ";
+ text += widget->widgetClass();
+ text += " \"" + widget->debugLabel() + "\"";
+
+ recordComment( text );
+ }
+ else
+ {
+ YCPValue val = YUI::ui()->evaluateQueryWidget( idTerm, YCPSymbol( propertyName ) );
+
+ fprintf( _macroFile, "%s%sUI::%s( %s,\t`%s,\t%s );\t// %s \"%s\"\n",
+ // UI::ChangeWidget( `id( `something ), `Value, 42 ) // YWidget
+ YMACRO_INDENT, YMACRO_INDENT,
+ YUIBuiltin_ChangeWidget,
+ idTerm->toString().c_str(),
+ propertyName,
+ val->toString().c_str(),
+ widget->widgetClass(),
+ widget->debugLabel().c_str() );
+
+ y2debug( "Recording %s status: %s: %s",
+ widget->widgetClass(), propertyName, val->toString().c_str() );
+ }
}
Modified: trunk/core/libyui/src/YMacroRecorder.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YMacroRecorder.h…
==============================================================================
--- trunk/core/libyui/src/YMacroRecorder.h (original)
+++ trunk/core/libyui/src/YMacroRecorder.h Fri Nov 30 14:19:17 2007
@@ -115,11 +115,6 @@
void recordTimeStamp();
/**
- * Record a human-readable identification of the dialog (its heading etc.)
- **/
- void recordDialogDebugLabel();
-
- /**
* The internally used macro file; valid if non-null.
**/
FILE * _macroFile;
Modified: trunk/core/libyui/src/YTypes.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YTypes.h?rev=425…
==============================================================================
--- trunk/core/libyui/src/YTypes.h (original)
+++ trunk/core/libyui/src/YTypes.h Fri Nov 30 14:19:17 2007
@@ -53,4 +53,20 @@
};
+enum YDialogType
+{
+ YMainDialog,
+ YPopupDialog
+};
+
+
+enum YDialogColorMode
+{
+ YDialogNormalColor, // Default
+ YDialogInfoColor, // Brighter colors
+ YDialogWarnColor // Very bright Warning colors
+};
+
+
+
#endif // YTypes_h
Modified: trunk/core/libyui/src/YUI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUI.h?rev=42557&…
==============================================================================
--- trunk/core/libyui/src/YUI.h (original)
+++ trunk/core/libyui/src/YUI.h Fri Nov 30 14:19:17 2007
@@ -48,9 +48,6 @@
class Y2UIFunction;
class YUIBuiltinCallData;
-// FIXME: Obsolete
-class YContainerWidget;
-
struct YUIBuiltinCallData
{
@@ -308,7 +305,7 @@
YCPValue evaluateHasSpecialWidget ( const YCPSymbol & widget );
void evaluateMakeScreenShot ( const YCPString & filename );
void evaluateNormalCursor ();
- YCPBoolean evaluateOpenDialog ( const YCPTerm & term, const YCPTerm & opts = YCPNull() );
+ YCPBoolean evaluateOpenDialog ( const YCPTerm & opts, const YCPTerm & dialogTerm );
void evaluatePlayMacro ( const YCPString & filename );
void evaluatePostponeShortcutCheck ();
YCPValue evaluateQueryWidget ( const YCPValue& value_id, const YCPValue& property );
@@ -441,16 +438,6 @@
**/
virtual YCPString glyph( const YCPSymbol & glyphSymbol ) { return YCPString( "" ); }
-
- // FIXME: Obsolete
- // FIXME: Obsolete
- // FIXME: Obsolete
-public:
- virtual YDialog *createDialog( YWidgetOpt & opt ) = 0;
- // FIXME: Obsolete
- // FIXME: Obsolete
- // FIXME: Obsolete
-
protected:
Modified: trunk/core/libyui/src/YUISymbols.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUISymbols.h?rev…
==============================================================================
--- trunk/core/libyui/src/YUISymbols.h (original)
+++ trunk/core/libyui/src/YUISymbols.h Fri Nov 30 14:19:17 2007
@@ -153,7 +153,6 @@
#define YUIProperty_CurrentSize "CurrentSize"
#define YUIProperty_CurrentItem "CurrentItem"
#define YUIProperty_DebugLabel "DebugLabel"
-#define YUIProperty_DialogDebugLabel "DialogDebugLabel"
#define YUIProperty_EasterEgg "EasterEgg"
#define YUIProperty_Enabled "Enabled"
#define YUIProperty_ExpectedSize "ExpectedSize"
@@ -200,6 +199,7 @@
#define YUIOpt_invertAutoEnable "invertAutoEnable"
#define YUIOpt_keepSorting "keepSorting"
#define YUIOpt_keyEvents "keyEvents"
+#define YUIOpt_mainDialog "mainDialog"
#define YUIOpt_noAutoEnable "noAutoEnable"
#define YUIOpt_notify "notify"
#define YUIOpt_outputField "outputField"
@@ -208,7 +208,6 @@
#define YUIOpt_scaleToFit "scaleToFit"
#define YUIOpt_searchMode "searchMode"
#define YUIOpt_shrinkable "shrinkable"
-#define YUIOpt_smallDecorations "smallDecorations"
#define YUIOpt_stepsEnabled "stepsEnabled"
#define YUIOpt_summaryMode "summaryMode"
#define YUIOpt_testMode "testMode"
Modified: trunk/core/libyui/src/YUI_builtins.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YUI_builtins.cc?…
==============================================================================
--- trunk/core/libyui/src/YUI_builtins.cc (original)
+++ trunk/core/libyui/src/YUI_builtins.cc Fri Nov 30 14:19:17 2007
@@ -24,8 +24,6 @@
#define VERBOSE_REPLACE_WIDGET 0
#define VERBOSE_EVENTS 0
-#define NONFATAL_OPENDIALOG_EXCEPTIONS 0
-
#include <stdio.h>
#include <unistd.h> // pipe()
#include <fcntl.h> // fcntl()
@@ -52,6 +50,7 @@
#include "YReplacePoint.h"
#include "YShortcut.h"
#include "YWizard.h"
+#include "YWidgetFactory.h"
#include "YCPValueWidgetID.h"
#include "YCPDialogParser.h"
#include "YCPItemParser.h"
@@ -705,39 +704,37 @@
* Same as the OpenDialog with one argument, but you can specify options
* with a term of the form <tt><b>`opt</b></tt>.
*
- * The option <tt>`defaultsize</tt> makes the dialog be resized to the default
- * size, for example for the Qt interface the -geometry option is honored and
- * for ncurses the dialog fills the whole window.
- *
- * The option <tt>`centered</tt> centers the dialog to the desktop.
- * This has no effect for popup dialogs that are a child of a `defaultsize dialog
- * that is currently visible.
- *
- * The option <tt>`decorated</tt> add a window border around the dialog, which
- * comes in handy if no window manager is running. This option may be ignored in
- * non-graphical UIs.
- *
- * <tt>`smallDecorations</tt> tells the window manager to use only minimal
- * decorations - in particular, no title bar. This is useful for very small
- * popups (like only a one line label and no button). Don't overuse this.
- * This option is ignored for `defaultsize dialogs.
+ * The <tt>`mainDialog</tt> option creates a "main window" dialog:
+ * The dialog will get a large "default size". In the Qt UI, this typically
+ * means 800x600 pixels large (or using a -geometry command line argument if
+ * present) or full screen. In the NCurses UI, this is always full screen.
+ *
+ * <tt>`defaultsize</tt> is an alias for <tt>`mainDialog</tt>.
*
- * The option <tt>`warncolor</tt> displays the entire dialog in a bright
+ * The <tt>`warncolor</tt> option displays the entire dialog in a bright
* warning color.
*
- * The option <tt>`infocolor</tt> is a less intrusive color.
+ * The <tt>`infocolor</tt> option displays the dialog in a color scheme that is
+ * distinct from the normal colors, but not as bright as warncolor.
+ *
+ * The <tt>`decorated</tt> option is now obsolete, but still accepted to keep
+ * old code working.
+ *
+ * The <tt>`centered</tt> option is now obsolete, but still accepted to keep
+ * old code working.
*
* @param term options
* @param term widget
* @return boolean
*
- * @usage OpenDialog( `opt( `defaultsize ), `Label( "Hi" ) )
+ * @usage OpenDialog( `opt( `defaultsize ), `Label( "Hello, World!" ) )
*/
-YCPBoolean YUI::evaluateOpenDialog( const YCPTerm & dialog_term, const YCPTerm & opts )
+YCPBoolean YUI::evaluateOpenDialog( const YCPTerm & opts, const YCPTerm & dialogTerm )
{
- YWidgetOpt opt;
-
+ YDialogType dialogType = YPopupDialog;
+ YDialogColorMode colorMode = YDialogNormalColor;
+
if ( ! opts.isNull() ) // evaluate `opt() contents
{
YCPList optList = opts->args();
@@ -746,59 +743,48 @@
{
if ( optList->value(o)->isSymbol() )
{
- if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_defaultsize ) opt.hasDefaultSize.setValue( true );
- else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_warncolor ) opt.hasWarnColor.setValue( true );
- else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_infocolor ) opt.hasInfoColor.setValue( true );
- else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_decorated ) opt.isDecorated.setValue( true );
- else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_centered ) opt.isCentered.setValue( true );
- else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_smallDecorations ) opt.hasSmallDecorations.setValue( true );
+ if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_mainDialog ) dialogType = YMainDialog;
+ if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_defaultsize ) dialogType = YMainDialog;
+ else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_infocolor ) colorMode = YDialogInfoColor;
+ else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_warncolor ) colorMode = YDialogWarnColor;
+ else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_decorated ) {} // obsolete
+ else if ( optList->value(o)->asSymbol()->symbol() == YUIOpt_centered ) {} // obsolete
else
y2warning( "Unknown option %s for OpenDialog", opts->value(o)->toString().c_str() );
}
}
}
- blockEvents(); // We don't want self-generated events from UI builtins.
- YDialog *dialog = createDialog( opt );
+ blockEvents(); // Prevent self-generated events from UI built-ins.
- if ( dialog )
+ bool ok = true;
+
+ try
{
-#if NONFATAL_OPENDIALOG_EXCEPTIONS
- try
- {
-#endif
- YWidget * child = YCPDialogParser::parseWidgetTreeTerm( dialog, dialog_term );
+ YDialog * dialog = YUI::widgetFactory()->createDialog( dialogType, colorMode );
+ YUI_CHECK_NEW( dialog );
- if ( child )
- {
- dialog->setInitialSize();
- dialog->checkShortcuts();
- showDialog( dialog );
+ YCPDialogParser::parseWidgetTreeTerm( dialog, dialogTerm );
- unblockEvents();
- return YCPBoolean( true );
- }
- else
- {
- YDialog::deleteTopmostDialog();
- }
-#if NONFATAL_OPENDIALOG_EXCEPTIONS
- }
- catch ( YUIException & exception )
- {
- YUI_CAUGHT( exception );
+ dialog->setInitialSize();
+ dialog->checkShortcuts();
+ showDialog( dialog );
+ }
+ catch ( YUIException & exception )
+ {
+ YUI_CAUGHT( exception );
- // Delete this half-created dialog:
- // Some widgets are in a very undefined state (no children etc.)
- YDialog::deleteTopmostDialog();
+ // Delete this half-created dialog:
+ // Some widgets are in a very undefined state (no children etc.)
+ YDialog::deleteTopmostDialog();
- ycperror( "UI::OpenDialog(): Dialog term parse error" );
- }
-#endif
+ ycperror( "UI::OpenDialog() failed" );
+ ok = false;
}
unblockEvents();
- return YCPBoolean( false );
+
+ return YCPBoolean( ok );
}
@@ -856,7 +842,7 @@
* @return boolean Returns true on success.
*/
-YCPValue YUI::evaluateChangeWidget( const YCPValue & id_value, const YCPValue & property, const YCPValue & newValue )
+YCPValue YUI::evaluateChangeWidget( const YCPValue & idValue, const YCPValue & property, const YCPValue & newValue )
{
YCPValue ret = YCPVoid();
@@ -864,99 +850,61 @@
{
blockEvents(); // We don't want self-generated events from UI::ChangeWidget().
- if ( ! YCPDialogParser::isSymbolOrId( id_value ) )
+ if ( ! YCPDialogParser::isSymbolOrId( idValue ) )
{
YUI_THROW( YUISyntaxErrorException( string( "Expected `id(...) or `symbol, not " ) +
- id_value->toString().c_str() ) );
+ idValue->toString().c_str() ) );
}
- YCPValue id = YCPDialogParser::parseIdTerm( id_value );
+ YCPValue id = YCPDialogParser::parseIdTerm( idValue );
YWidget * widget = YCPDialogParser::findWidgetWithId( id,
true ); // throw if not found
YPropertySet propSet = widget->propertySet();
- if ( propSet.size() == 5 ) // unchanged from YWidget, no properties supported
+ if ( property->isSymbol() )
{
- // FIXME: Get rid of this
- // FIXME: Get rid of this
- // FIXME: Get rid of this
+ string oldShortcutString = widget->shortcutString();
+ string propertyName = property->asSymbol()->symbol();
+ // y2milestone( "New style UI::ChangeWidget() for %s::%s", widget->widgetClass(), propertyName.c_str() );
- if ( property->isSymbol() )
- {
- YCPSymbol sym = property->asSymbol();
- y2debug( "Old style UI::ChangeWidget() for %s::%s",
- widget->widgetClass(), sym->toString().c_str() );
- ret = widget->changeWidget( sym, newValue );
- }
+ YPropertyValue val;
+
+ 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
+ val = YPropertyValue( false ); // Dummy value, will be rejected anyway
+
+ bool success = widget->setProperty( propertyName, val );
+
+ if ( ! success )
{
- y2error( "Bad argument for UI::ChangeWidget(): %s",
- property->toString().c_str() );
+ // Try again with the known special cases
+ success = YCPPropertyHandler::setComplexProperty( widget, propertyName, newValue );
}
-
- // FIXME: Get rid of this
- // FIXME: Get rid of this
- // FIXME: Get rid of this
+
+ ret = YCPBoolean( success );
+
+ if ( oldShortcutString != widget->shortcutString() )
+ YDialog::currentDialog()->checkShortcuts();
+ }
+ else if ( property->isTerm() )
+ {
+ bool success = YCPPropertyHandler::setComplexProperty( widget, property->asTerm(), newValue );
+ ret = YCPBoolean( success );
}
else
{
- try
- {
- if ( property->isSymbol() )
- {
- string oldShortcutString = widget->shortcutString();
- string propertyName = property->asSymbol()->symbol();
- // y2milestone( "New style UI::ChangeWidget() for %s::%s", widget->widgetClass(), propertyName.c_str() );
-
- YPropertyValue val;
-
- 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
- val = YPropertyValue( false ); // Dummy value, will be rejected anyway
-
- bool success = widget->setProperty( propertyName, val );
-
- if ( ! success )
- {
- // Try again with the known special cases
- success = YCPPropertyHandler::setComplexProperty( widget, propertyName, newValue );
- }
-
- ret = YCPBoolean( success );
-
- if ( oldShortcutString != widget->shortcutString() )
- YDialog::currentDialog()->checkShortcuts();
- }
- else if ( property->isTerm() )
- {
- bool success = YCPPropertyHandler::setComplexProperty( widget, property->asTerm(), newValue );
- ret = YCPBoolean( success );
- }
- else
- {
- YUI_THROW( YUISyntaxErrorException( string( "Bad UI::ChangeWidget args: " )
- + property->toString() ) );
- }
- }
- catch( YUIException & exception )
- {
- YUI_CAUGHT( exception );
- ycperror( "UI::ChangeWidget() failed for property %s of %s with ID %s, new value: %s",
- property->toString().c_str(),
- widget->widgetClass(),
- id->toString().c_str(),
- newValue->toString().c_str() );
- }
+ YUI_THROW( YUISyntaxErrorException( string( "Bad UI::ChangeWidget args: " )
+ + property->toString() ) );
}
}
catch( YUIException & exception )
{
YUI_CAUGHT( exception );
ycperror( "UI::ChangeWidget failed: UI::ChangeWidget( %s, %s, %s )",
- id_value->toString().c_str(),
+ idValue->toString().c_str(),
property->toString().c_str(),
newValue->toString().c_str() );
ret = YCPNull();
@@ -985,89 +933,56 @@
* @return any
*/
-YCPValue YUI::evaluateQueryWidget( const YCPValue & id_value, const YCPValue & property )
+YCPValue YUI::evaluateQueryWidget( const YCPValue & idValue, const YCPValue & property )
{
YCPValue ret = YCPVoid();
try
{
- if ( ! YCPDialogParser::isSymbolOrId( id_value ) )
+ if ( ! YCPDialogParser::isSymbolOrId( idValue ) )
{
YUI_THROW( YUISyntaxErrorException( string( "Expected `id(...) or `symbol, not " ) +
- id_value->toString().c_str() ) );
+ idValue->toString().c_str() ) );
}
- YCPValue id = YCPDialogParser::parseIdTerm( id_value );
+ YCPValue id = YCPDialogParser::parseIdTerm( idValue );
YWidget *widget = YCPDialogParser::findWidgetWithId( id,
true ); // throw if not found
YPropertySet propSet = widget->propertySet();
- if ( propSet.size() == 5 ) // unchanged from YWidget, no properties supported
+ if ( property->isSymbol() ) // The normal case: UI::QueryWidget(`myWidget, `SomeProperty)
{
- if ( property->isSymbol() )
+ string propertyName = property->asSymbol()->symbol();
+ YPropertyValue val = widget->getProperty( propertyName );
+
+ switch ( val.type() )
{
- // FIXME: Get rid of this
- // FIXME: Get rid of this
- // FIXME: Get rid of this
- YCPSymbol sym = property->asSymbol();
- y2debug( "Old style UI::QueryWidget() for %s::%s",
- widget->widgetClass(), sym->symbol().c_str() );
- return widget->queryWidget( sym );
- // FIXME: Get rid of this
- // FIXME: Get rid of this
- // FIXME: Get rid of this
+ case YStringProperty: return YCPString ( val.stringVal() );
+ case YBoolProperty: return YCPBoolean( val.boolVal() );
+ case YIntegerProperty: return YCPInteger( val.integerVal() );
+ case YOtherProperty: return YCPPropertyHandler::getComplexProperty( widget, propertyName );
+
+ default:
+ ycperror( "Unknown result for setProperty( %s )", propertyName.c_str() );
+ return YCPVoid();
}
}
+ else if ( property->isTerm() ) // Very rare: UI::QueryWidget(`myTable, `Item("abc", 3) )
+ {
+ return YCPPropertyHandler::getComplexProperty( widget, property->asTerm() );
+ }
else
{
- // y2debug( "New style UI::QueryWidget() for %s::%s", widget->widgetClass(), sym->symbol().c_str() );
-
- try
- {
- if ( property->isSymbol() ) // The normal case: UI::QueryWidget(`myWidget, `SomeProperty)
- {
- string propertyName = property->asSymbol()->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 YCPPropertyHandler::getComplexProperty( widget, propertyName );
-
- default:
- ycperror( "Unknown result for setProperty( %s )", propertyName.c_str() );
- return YCPVoid();
- }
- }
- else if ( property->isTerm() ) // Very rare: UI::QueryWidget(`myTable, `Item("abc", 3) )
- {
- return YCPPropertyHandler::getComplexProperty( widget, property->asTerm() );
- }
- else
- {
- YUI_THROW( YUISyntaxErrorException( string( "Bad UI::QueryWidget args: " )
- + property->toString() ) );
- }
- }
- catch( YUIException & exception )
- {
- YUI_CAUGHT( exception );
- ycperror( "UI::QueryWidget() failed for property %s of %s with ID %s",
- property->toString().c_str(),
- widget->widgetClass(),
- id->toString().c_str() );
-
- }
+ YUI_THROW( YUISyntaxErrorException( string( "Bad UI::QueryWidget args: " )
+ + property->toString() ) );
}
}
catch( YUIException & exception )
{
YUI_CAUGHT( exception );
ycperror( "UI::QueryWidget failed: UI::QueryWidget( %s, %s )",
- id_value->toString().c_str(),
+ idValue->toString().c_str(),
property->toString().c_str() );
ret = YCPNull();
}
@@ -1087,64 +1002,64 @@
*
* @param symbol id
* @param term newWidget
- * @return boolean
+ * @return true if success, false if failed
*/
-YCPBoolean YUI::evaluateReplaceWidget( const YCPValue & id_value, const YCPTerm & newContentTerm )
+YCPBoolean YUI::evaluateReplaceWidget( const YCPValue & idValue, const YCPTerm & newContentTerm )
{
- if ( ! YCPDialogParser::isSymbolOrId( id_value ) )
+ bool success = true;
+
+ try
{
- return YCPNull();
- }
+ if ( ! YCPDialogParser::isSymbolOrId( idValue ) )
+ {
+ YUI_THROW( YUISyntaxErrorException( string( "Expected `id(...) or `symbol, not " ) +
+ idValue->toString().c_str() ) );
+ }
- YCPValue id = YCPDialogParser::parseIdTerm( id_value );
- YWidget * widget = YCPDialogParser::findWidgetWithId( id );
- if ( ! widget ) return YCPBoolean( false );
+ blockEvents(); // Prevent self-generated events
+ YCPValue id = YCPDialogParser::parseIdTerm( idValue );
+ YWidget * widget = YCPDialogParser::findWidgetWithId( id,
+ true ); // throw if not found
+ if ( ! widget ) return YCPBoolean( false );
- YReplacePoint * replacePoint = dynamic_cast<YReplacePoint *> (widget);
+ YReplacePoint * replacePoint = dynamic_cast<YReplacePoint *> (widget);
- if ( ! replacePoint )
- {
- y2error( "ReplaceWidget: widget %s is not a ReplacePoint",
- id->toString().c_str() );
- return YCPBoolean( false );
- }
+ if ( ! replacePoint )
+ YUI_THROW( YUIException( string( "Widget with ID " ) + id->toString() + " is not a ReplacePoint" ) );
#if VERBOSE_REPLACE_WIDGET
- replacePoint->dumpDialogWidgetTree();
+ replacePoint->dumpDialogWidgetTree();
#endif
- YDialog * dialog = YDialog::currentDialog();
-
- YWidget::OptimizeChanges below( *dialog ); // delay screen updates until this block is left
- replacePoint->deleteChildren();
+ YDialog * dialog = YDialog::currentDialog();
- YWidget * child = YCPDialogParser::parseWidgetTreeTerm( replacePoint, newContentTerm );
+ YWidget::OptimizeChanges below( *dialog ); // delay screen updates until this block is left
+ replacePoint->deleteChildren();
- if ( ! child->hasParent() )
- child->setParent( replacePoint );
-
- replacePoint->showChild();
+ YCPDialogParser::parseWidgetTreeTerm( replacePoint, newContentTerm );
+ replacePoint->showChild();
#if VERBOSE_REPLACE_WIDGET
- replacePoint->dumpDialogWidgetTree();
+ replacePoint->dumpDialogWidgetTree();
#endif
- if ( child )
- {
- blockEvents(); // We don't want self-generated events from UI builtins.
-
dialog->setInitialSize();
dialog->checkShortcuts();
-
- unblockEvents();
-
- return YCPBoolean( true );
}
- else
+ catch( YUIException & exception )
{
- YUI_THROW( YUIException( "ReplaceWidget() failed" ) );
- return YCPBoolean( false );
+ YUI_CAUGHT( exception );
+ success = false;
+
+ ycperror( "UI::ReplaceWidget() failed: UI::ReplaceWidget( %s, %s )",
+ idValue->toString().c_str(),
+ newContentTerm->toString().c_str() );
+
}
+
+ unblockEvents();
+
+ return YCPBoolean( success );
}
@@ -1207,12 +1122,12 @@
* @return boolean Returns true on success (i.e. the widget accepted the focus).
*/
-YCPBoolean YUI::evaluateSetFocus( const YCPValue & id_value )
+YCPBoolean YUI::evaluateSetFocus( const YCPValue & idValue )
{
- if ( ! YCPDialogParser::isSymbolOrId( id_value ) )
+ if ( ! YCPDialogParser::isSymbolOrId( idValue ) )
return YCPNull();
- YCPValue id = YCPDialogParser::parseIdTerm( id_value );
+ YCPValue id = YCPDialogParser::parseIdTerm( idValue );
YWidget *widget = YCPDialogParser::findWidgetWithId( id );
if ( ! widget )
@@ -1705,11 +1620,11 @@
* @param symbol widgetId
* @return boolean
*/
-YCPBoolean YUI::evaluateWidgetExists( const YCPValue & id_value )
+YCPBoolean YUI::evaluateWidgetExists( const YCPValue & idValue )
{
- if ( ! YCPDialogParser::isSymbolOrId( id_value ) ) return YCPNull();
+ if ( ! YCPDialogParser::isSymbolOrId( idValue ) ) return YCPNull();
- YCPValue id = YCPDialogParser::parseIdTerm( id_value );
+ YCPValue id = YCPDialogParser::parseIdTerm( idValue );
YWidget *widget = YCPDialogParser::findWidgetWithId( id,
false ); // Don't throw if not found
return widget ? YCPBoolean( true ) : YCPBoolean( false );
Modified: trunk/core/libyui/src/YWidget.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidget.cc?rev=4…
==============================================================================
--- trunk/core/libyui/src/YWidget.cc (original)
+++ trunk/core/libyui/src/YWidget.cc Fri Nov 30 14:19:17 2007
@@ -63,7 +63,6 @@
, notify( false )
, sendKeyEvents( false )
, autoShortcut( false )
- , oldStyleConstructor( false )
, toolkitWidgetRep( 0 )
, id( 0 )
, functionKey( 0 )
@@ -86,7 +85,6 @@
bool notify;
bool sendKeyEvents;
bool autoShortcut;
- bool oldStyleConstructor;
void * toolkitWidgetRep;
YWidgetID * id;
YBothDim<bool> stretch;
@@ -99,20 +97,6 @@
bool YWidget::_usedOperatorNew = false;
-// FIXME: Obsolete
-// FIXME: Obsolete
-// FIXME: Obsolete
-YWidget::YWidget( const YWidgetOpt & opt )
- : priv( new YWidgetPrivate( new YWidgetChildrenRejector( this ) ) )
-{
- YUI_CHECK_NEW( priv );
- priv->oldStyleConstructor = true;
-}
-// FIXME: Obsolete
-// FIXME: Obsolete
-// FIXME: Obsolete
-
-
YWidget::YWidget( YWidget * parent )
: priv( new YWidgetPrivate( new YWidgetChildrenRejector( this ), parent ) )
@@ -271,9 +255,6 @@
YWidget *
YWidget::parent() const
{
- if ( oldStyleConstructor() && ! priv->parent )
- YUI_THROW( YUIException( string( "No parent set yet for " ) + widgetClass() ) );
-
return priv->parent;
}
@@ -300,13 +281,6 @@
}
-bool
-YWidget::oldStyleConstructor() const
-{
- return priv->oldStyleConstructor;
-}
-
-
bool YWidget::sendKeyEvents() const
{
return priv->sendKeyEvents;
@@ -403,14 +377,12 @@
* @property boolean Notify the current notify state (see also `opt( `notify ))
* @property string WidgetClass the widget class of this widget (YLabel, YPushButton, ...)
* @property string DebugLabel (possibly translated) text describing this widget for debugging
- * @property string DialogDebugLabel (possibly translated) text describing this dialog for debugging
**/
propSet.add( YProperty( YUIProperty_Enabled, YBoolProperty ) );
propSet.add( YProperty( YUIProperty_Notify, YBoolProperty ) );
propSet.add( YProperty( YUIProperty_WidgetClass, YStringProperty, true ) ); // read-only
propSet.add( YProperty( YUIProperty_DebugLabel, YStringProperty, true ) ); // read-only
- propSet.add( YProperty( YUIProperty_DialogDebugLabel, YStringProperty, true ) ); // read-only
}
return propSet;
@@ -454,15 +426,6 @@
if ( propertyName == YUIProperty_Notify ) return YPropertyValue( notify() );
if ( propertyName == YUIProperty_WidgetClass ) return YPropertyValue( widgetClass() );
if ( propertyName == YUIProperty_DebugLabel ) return YPropertyValue( debugLabel() );
- if ( propertyName == YUIProperty_DialogDebugLabel )
- {
- YDialog * dialog = findDialog();
-
- if ( dialog )
- return YPropertyValue( dialog->debugLabel() );
- else
- return YPropertyValue( debugLabel() );
- }
return YPropertyValue( false ); // NOTREACHED
}
@@ -724,72 +687,3 @@
}
-// FIXME: Obsolete
-// FIXME: Obsolete
-// FIXME: Obsolete
-
-
-YCPValue YWidget::changeWidget( const YCPSymbol & property, const YCPValue & newvalue )
-{
- string symbol = property->symbol();
-
- if ( ! isValid() )
- {
- y2error( "YWidget::changeWidget( %s ): ERROR: Invalid widget", symbol.c_str() );
-
- return YCPBoolean( false ); // Error
- }
-
- if ( symbol == YUIProperty_Enabled )
- {
- if ( newvalue->isBoolean() )
- {
- bool e = newvalue->asBoolean()->value();
- setEnabled(e);
- priv->enabled = e;
- return YCPBoolean( true );
- }
- else y2error( "Wrong argument %s for widget property `Enabled - boolean expected.",
- newvalue->toString().c_str() );
- }
-
- if ( symbol == YUIProperty_Notify )
- {
- if ( newvalue->isBoolean() )
- {
- setNotify( newvalue->asBoolean()->value() );
- return YCPBoolean( true );
- }
- else y2error( "Wrong argument %s for widget property `Notify - boolean expected.",
- newvalue->toString().c_str() );
- }
-
- return YCPBoolean( false );
-}
-
-
-YCPValue YWidget::queryWidget( const YCPSymbol & property )
-{
- string symbol = property->symbol();
-
- if ( symbol == YUIProperty_Enabled ) return YCPBoolean( isEnabled() );
- if ( symbol == YUIProperty_Notify ) return YCPBoolean( notify() );
- if ( symbol == YUIProperty_WidgetClass ) return YCPString( widgetClass() );
- if ( symbol == YUIProperty_DebugLabel ) return YCPString( debugLabel() );
- if ( symbol == YUIProperty_DialogDebugLabel )
- {
- return YDialog::currentDialog()->queryWidget( property );
- }
- else
- {
- y2error( "Couldn't query unkown widget property %s::%s",
- widgetClass(), symbol.c_str() );
- return YCPVoid();
- }
-}
-
-
-// FIXME: Obsolete
-// FIXME: Obsolete
-// FIXME: Obsolete
-
Modified: trunk/core/libyui/src/YWidget.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidget.h?rev=42…
==============================================================================
--- trunk/core/libyui/src/YWidget.h (original)
+++ trunk/core/libyui/src/YWidget.h Fri Nov 30 14:19:17 2007
@@ -56,14 +56,6 @@
**/
YWidget( YWidget * parent );
- // FIXME: Obsolete
- // FIXME: Obsolete
- // FIXME: Obsolete
- YWidget( const YWidgetOpt & opt );
- // FIXME: Obsolete
- // FIXME: Obsolete
- // FIXME: Obsolete
-
public:
/**
* Destructor.
@@ -142,7 +134,6 @@
**/
virtual bool setProperty( const string & propertyName,
const YPropertyValue & val );
- // FIXME: = 0
/**
* Get a property. Derived classes need to implement this.
@@ -151,7 +142,6 @@
* - if there is no property with that name
**/
virtual YPropertyValue getProperty( const string & propertyName );
- // FIXME: = 0
//
@@ -249,24 +239,6 @@
**/
void setParent( YWidget * newParent );
-
- // FIXME: Throw this out once all widgets are ported!
- // FIXME: Throw this out once all widgets are ported!
- // FIXME: Throw this out once all widgets are ported!
- /**
- * Return 'true' if an old-style constructor was used to create this widget.
- * In that case, setParent() needs to be called from the outside, and for
- * the parent widget, addChild() needs to be called.
- *
- * NOTICE: This function will silently disappear once all widgets are
- * ported in the libyui.
- **/
- bool oldStyleConstructor() const;
- // FIXME: Throw this out once all widgets are ported!
- // FIXME: Throw this out once all widgets are ported!
- // FIXME: Throw this out once all widgets are ported!
-
-
/**
* Traverse up the widget hierarchy and find the dialog this widget belongs
* to. Returns 0 if there is none.
@@ -505,18 +477,6 @@
**/
virtual void setFunctionKey( int fkey_no );
-
-
- // FIXME: Obsolete
- // FIXME: Obsolete
- // FIXME: Obsolete
- virtual YCPValue changeWidget( const YCPSymbol & property, const YCPValue & newvalue );
- virtual YCPValue queryWidget( const YCPSymbol & property );
- // FIXME: Obsolete
- // FIXME: Obsolete
- // FIXME: Obsolete
-
-
/**
* Set the keyboard focus to this widget.
* The default implementation just emits a warning message.
Modified: trunk/core/libyui/src/YWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidgetFactory.c…
==============================================================================
--- trunk/core/libyui/src/YWidgetFactory.cc (original)
+++ trunk/core/libyui/src/YWidgetFactory.cc Fri Nov 30 14:19:17 2007
@@ -33,6 +33,20 @@
}
+YDialog *
+YWidgetFactory::createMainDialog( YDialogColorMode colorMode )
+{
+ return createDialog( YMainDialog, colorMode );
+}
+
+
+YDialog *
+YWidgetFactory::createPopupDialog( YDialogColorMode colorMode )
+{
+ return createDialog( YPopupDialog, colorMode );
+}
+
+
YLayoutBox *
YWidgetFactory::createVBox( YWidget * parent )
{
Modified: trunk/core/libyui/src/YWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidgetFactory.h…
==============================================================================
--- trunk/core/libyui/src/YWidgetFactory.h (original)
+++ trunk/core/libyui/src/YWidgetFactory.h Fri Nov 30 14:19:17 2007
@@ -74,8 +74,9 @@
// Dialogs
//
- virtual YDialog * createMainDialog() = 0;
- virtual YDialog * createPopupDialog() = 0;
+ YDialog * createMainDialog ( YDialogColorMode colorMode = YDialogNormalColor );
+ YDialog * createPopupDialog ( YDialogColorMode colorMode = YDialogNormalColor );
+ virtual YDialog * createDialog ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor ) = 0;
//
// Layout Boxes
Modified: trunk/core/libyui/src/YWidgetOpt.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/libyui/src/YWidgetOpt.h?rev…
==============================================================================
--- trunk/core/libyui/src/YWidgetOpt.h (original)
+++ trunk/core/libyui/src/YWidgetOpt.h Fri Nov 30 14:19:17 2007
@@ -116,15 +116,13 @@
struct YWidgetOpt
{
// Common options for all widgets.
- // See the inline doc in YUIInterpreter::createWidget() for details
- // or ../../doc/autodocs/YWidget-widget.html
+ // See the inline doc in YCPDialogParser for details.
YBoolOpt isDisabled;
YBoolOpt notifyMode;
YBoolOpt isHStretchable;
YBoolOpt isVStretchable;
YBoolOpt autoShortcut;
- YBoolOpt autoAdvance;
YBoolOpt keyEvents;
YBoolOpt testMode;
YBoolOpt boldFont; // YCheckBox, YRadioButton, YLabel
@@ -133,40 +131,12 @@
// Widget-specific options
//
// See the respective widget doc in YCPDialogParser::parse???()
- // or ../../doc/autodocs/???-widget.html
YBoolOpt isDefaultButton; // YPushButton
YBoolOpt isOutputField; // YLabel
YBoolOpt autoScrollDown; // YRichText
YBoolOpt plainTextMode; // YRichText
- YBoolOpt isShrinkable; // YTextEntry
- YBoolOpt isEditable; // YComboBox
- YBoolOpt immediateMode; // YTable
- YBoolOpt keepSorting; // YTable
- YBoolOpt invertAutoEnable; // YCheckBoxFrame
- YBoolOpt noAutoEnable; // YCheckBoxFrame
- YBoolOpt zeroWidth; // YImage
- YBoolOpt zeroHeight; // YImage
- YBoolOpt animated; // YImage
- YBoolOpt tiled; // YImage
- YBoolOpt scaleToFit; // YImage
- YBoolOpt countShowDelta; // YPartitionSplitter
YLongOpt key_Fxx; // YPushButton: No. of F-Key (1..24), 0 if none
-
- YBoolOpt stepsEnabled; // YWizard
- YBoolOpt treeEnabled; // YWizard
-
- // YDialog-specific options
- //
- // These are multiplexed into YWidgetOpt since YDialog inherits
- // YSingleChildContainerWidget which in turn inherits YWidget.
-
- YBoolOpt hasDefaultSize;
- YBoolOpt hasWarnColor;
- YBoolOpt hasInfoColor;
- YBoolOpt isDecorated;
- YBoolOpt isCentered;
- YBoolOpt hasSmallDecorations;
};
Modified: trunk/ncurses/src/NCDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCDialog.cc?rev=4255…
==============================================================================
--- trunk/ncurses/src/NCDialog.cc (original)
+++ trunk/ncurses/src/NCDialog.cc Fri Nov 30 14:19:17 2007
@@ -57,8 +57,9 @@
//
// DESCRIPTION :
//
-NCDialog::NCDialog( const YWidgetOpt & opt )
- : YDialog ( opt )
+NCDialog::NCDialog( YDialogType dialogType,
+ YDialogColorMode colorMode )
+ : YDialog ( dialogType, colorMode )
, pan ( 0 )
, dlgstyle ( 0 )
, inMultiDraw_i( 0 )
@@ -67,8 +68,8 @@
, ncdopts ( DEFAULT )
, popedpos ( -1 )
{
- NCMIL << "NCDialog(opt) derived from YDialog(opt)" << endl;
- _init( opt );
+ NCMIL << "NCDialog() derived from YDialog()" << endl;
+ _init();
}
///////////////////////////////////////////////////////////////////
@@ -79,8 +80,8 @@
//
// DESCRIPTION :
//
-NCDialog::NCDialog( const YWidgetOpt & opt, const wpos at, const bool boxed )
- : YDialog ( opt )
+NCDialog::NCDialog( YDialogType dialogType, const wpos at, const bool boxed )
+ : YDialog ( dialogType, YDialogNormalColor )
, pan ( 0 )
, dlgstyle ( 0 )
, inMultiDraw_i( 0 )
@@ -89,8 +90,8 @@
, ncdopts ( boxed ? POPUP : POPUP|NOBOX )
, popedpos ( at )
{
- NCMIL << "NCDialog(opt, at, boxed) derived from YDialog(opt)" << endl;
- _init( opt );
+ NCMIL << "NCDialog(type, at, boxed) derived from YDialog(opt)" << endl;
+ _init();
}
///////////////////////////////////////////////////////////////////
@@ -101,7 +102,7 @@
//
// DESCRIPTION : Constructor helper
//
-void NCDialog::_init( const YWidgetOpt & opt )
+void NCDialog::_init()
{
NCurses::RememberDlg( this );
@@ -110,9 +111,9 @@
_init_size();
wstate = NC::WSdumb;
- if ( opt.hasWarnColor.value() ) {
+ if ( colorMode() == YDialogWarnColor ) {
mystyleset = NCstyle::WarnStyle;
- } else if ( opt.hasInfoColor.value() ) {
+ } else if ( colorMode() == YDialogInfoColor ) {
mystyleset = NCstyle::InfoStyle;
} else if ( isPopup() ) {
mystyleset = NCstyle::PopupStyle;
@@ -190,7 +191,7 @@
int NCDialog::preferredWidth()
{
- if ( hasDefaultSize() || !childrenCount() )
+ if ( dialogType() == YMainDialog || ! hasChildren() )
return wGetDefsze().W;
wsze csze( firstChild()->preferredHeight(),
firstChild()->preferredWidth() );
@@ -202,7 +203,7 @@
int NCDialog::preferredHeight()
{
- if ( hasDefaultSize() || !childrenCount() ) {
+ if ( dialogType() == YMainDialog || ! hasChildren() ) {
return wGetDefsze().H;
}
wsze csze( firstChild()->preferredHeight(),
Modified: trunk/ncurses/src/NCDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCDialog.h?rev=42557…
==============================================================================
--- trunk/ncurses/src/NCDialog.h (original)
+++ trunk/ncurses/src/NCDialog.h Fri Nov 30 14:19:17 2007
@@ -49,8 +49,7 @@
NCWidget & GetNormal( NCWidget & startwith, SeekDir Direction );
void Activate( SeekDir Direction );
- void _init( const YWidgetOpt & opt );
-
+ void _init();
void _init_size();
protected:
@@ -122,7 +121,8 @@
public:
- NCDialog( const YWidgetOpt & opt );
+ NCDialog( YDialogType dialogType,
+ YDialogColorMode colorMode = YDialogNormalColor );
virtual ~NCDialog();
void showDialog();
@@ -162,7 +162,7 @@
bool hshaddow;
bool vshaddow;
- NCDialog( const YWidgetOpt & opt, const wpos at, const bool boxed = true );
+ NCDialog( YDialogType dialogType, const wpos at, const bool boxed = true );
bool isPopup() const { return (ncdopts & POPUP); }
bool isBoxed() const { return !(ncdopts & NOBOX); }
Modified: trunk/ncurses/src/NCPopup.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCPopup.cc?rev=42557…
==============================================================================
--- trunk/ncurses/src/NCPopup.cc (original)
+++ trunk/ncurses/src/NCPopup.cc Fri Nov 30 14:19:17 2007
@@ -19,9 +19,6 @@
#include "Y2Log.h"
#include "NCPopup.h"
-///////////////////////////////////////////////////////////////////
-
-YWidgetOpt NCPopup::wopt;
///////////////////////////////////////////////////////////////////
//
@@ -32,7 +29,7 @@
// DESCRIPTION :
//
NCPopup::NCPopup( const wpos at, const bool boxed )
- : NCDialog( wopt, at, boxed )
+ : NCDialog( YPopupDialog, at, boxed )
{
}
Modified: trunk/ncurses/src/NCPopup.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCPopup.h?rev=42557&…
==============================================================================
--- trunk/ncurses/src/NCPopup.h (original)
+++ trunk/ncurses/src/NCPopup.h Fri Nov 30 14:19:17 2007
@@ -34,10 +34,6 @@
NCPopup & operator=( const NCPopup & );
NCPopup ( const NCPopup & );
- private:
-
- static YWidgetOpt wopt;
-
protected:
NCursesEvent postevent;
Modified: trunk/ncurses/src/NCWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCWidgetFactory.cc?r…
==============================================================================
--- trunk/ncurses/src/NCWidgetFactory.cc (original)
+++ trunk/ncurses/src/NCWidgetFactory.cc Fri Nov 30 14:19:17 2007
@@ -12,7 +12,8 @@
File: NCWidgetFactory.cc
- Author: Stefan Hundhammer <sh(a)suse.de>
+ Authors: Stefan Hundhammer <sh(a)suse.de>
+ Gabriele Mohr <gs(a)suse.de>
/-*/
@@ -45,23 +46,18 @@
//
NCDialog *
-NCWidgetFactory::createMainDialog()
+NCWidgetFactory::createDialog( YDialogType dialogType, YDialogColorMode colorMode )
{
- return 0; // FIXME: TO DO
-}
-
+ UIDBG << "Flush input buffer - new dialog" << endl;
+ ::flushinp();
+ NCDialog * dialog = new NCDialog( dialogType, colorMode );
+ YUI_CHECK_NEW( dialog );
-NCDialog *
-NCWidgetFactory::createPopupDialog()
-{
- return 0; // FIXME: TO DO
+ return dialog;
}
-
-
-
//
// Common Leaf Widgets
//
Modified: trunk/ncurses/src/NCWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/NCWidgetFactory.h?re…
==============================================================================
--- trunk/ncurses/src/NCWidgetFactory.h (original)
+++ trunk/ncurses/src/NCWidgetFactory.h Fri Nov 30 14:19:17 2007
@@ -71,21 +71,18 @@
// Dialogs
//
- virtual NCDialog * createMainDialog();
- virtual NCDialog * createPopupDialog();
+ virtual NCDialog * createDialog ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor );
//
// Layout Boxes
//
- virtual NCLayoutBox * createLayoutBox( YWidget * parent, YUIDimension dim );
+ virtual NCLayoutBox * createLayoutBox ( YWidget * parent, YUIDimension dim );
+
+ //
+ // Common Leaf Widgets
+ //
- /**
- * Creates a push button.
- * @param label Label of the button
- * @param default_button true if the button should be the dialogs default button
- */
-
virtual NCPushButton * createPushButton ( YWidget * parent,
const string & label );
@@ -139,7 +136,6 @@
/**
* Creates a MultiLineEdit widget
* @param label label above the edit field
- * @param text initial contents of the edit field
*/
virtual NCMultiLineEdit * createMultiLineEdit ( YWidget * parent,
const string & label );
@@ -154,7 +150,7 @@
* Creates a log view widget
* @param label label above the log view
* @param visibleLines default number of vislible lines
- * @param maxLines number of lines to store (use 0 for "all")
+ * @param storedLines number of lines to store (use 0 for "all")
*/
virtual NCLogView * createLogView ( YWidget * parent,
const string & label,
Modified: trunk/ncurses/src/YNCursesUI.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/YNCursesUI.cc?rev=42…
==============================================================================
--- trunk/ncurses/src/YNCursesUI.cc (original)
+++ trunk/ncurses/src/YNCursesUI.cc Fri Nov 30 14:19:17 2007
@@ -309,18 +309,6 @@
//
///////////////////////////////////////////////////////////////////
-YDialog * YNCursesUI::createDialog( YWidgetOpt & opt )
-{
- UIDBG << "Flush input buffer - new dialog" << endl;
- ::flushinp();
-
- NCMIL << "Calling createDialog()" << endl;
- NCDialog * dialog = new NCDialog( opt );
-
- UIDBG << dialog << endl;
- return dialog;
-}
-
void YNCursesUI::showDialog( YDialog * dialog ) {
NCDialog * dlg = dynamic_cast<NCDialog *>( dialog );
UIDBG << dlg << endl;
Modified: trunk/ncurses/src/YNCursesUI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/ncurses/src/YNCursesUI.h?rev=425…
==============================================================================
--- trunk/ncurses/src/YNCursesUI.h (original)
+++ trunk/ncurses/src/YNCursesUI.h Fri Nov 30 14:19:17 2007
@@ -122,11 +122,6 @@
virtual YEvent * pollInput();
/**
- * Inherited from YUIInterpreter. Creates a dialog.
- */
- virtual YDialog * createDialog( YWidgetOpt & opt );
-
- /**
* Inherited from YUIInterpreter. Shows and activates a dialog
*/
virtual void showDialog( YDialog * dialog );
Modified: trunk/qt/src/YQDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQDialog.cc?rev=42557&r1=…
==============================================================================
--- trunk/qt/src/YQDialog.cc (original)
+++ trunk/qt/src/YQDialog.cc Fri Nov 30 14:19:17 2007
@@ -38,14 +38,22 @@
// like "Above", "Below" etc. that clash with some Qt headers.
#include <X11/Xlib.h>
+#define YQMainDialogWFlags 0
-YQDialog::YQDialog( const YWidgetOpt & opt,
- QWidget * qt_parent,
- bool default_size )
- : QWidget( qt_parent,
- 0, // name
- default_size ? 0 : WStyle_Customize | WStyle_DialogBorder | WType_Modal | WStyle_Dialog ) // WFlags
- , YDialog( opt )
+#define YQPopupDialogWFlags \
+ ( WStyle_Customize | \
+ WStyle_Dialog | \
+ WType_Modal | \
+ WStyle_DialogBorder )
+
+
+YQDialog::YQDialog( QWidget * qParent,
+ YDialogType dialogType,
+ YDialogColorMode colorMode )
+ : QWidget( qParent,
+ 0, // name
+ dialogType == YMainDialog ? YQMainDialogWFlags : YQPopupDialogWFlags )
+ , YDialog( dialogType, colorMode )
{
_userResized = false;
_focusButton = 0;
@@ -53,16 +61,16 @@
setWidgetRep( this );
- setCaption( hasDefaultSize() ? "YaST2" : "" );
+ setCaption( dialogType == YMainDialog ? "YaST2" : "" );
setFocusPolicy( QWidget::StrongFocus );
- if ( hasWarnColor() || hasInfoColor() )
+ if ( colorMode != YDialogNormalColor )
{
QColor normalBackground ( 0, 128, 0 );
QColor inputFieldBackground ( 0, 96, 0 );
QColor text = white;
- if ( hasInfoColor() )
+ if ( colorMode == YDialogInfoColor )
{
normalBackground = QColor ( 238, 232, 170 ); // PaleGoldenrod
}
@@ -74,31 +82,6 @@
warnPalette.setNormal( normalColors );
setPalette( warnPalette );
}
-
- _qFrame = new QFrame ( this );
- bool decorate = ! hasDefaultSize() && ! YQUI::ui()->haveWM();
-
-#if 0
- if ( hasSmallDecorations() )
- {
- // None of this works (yet). :-((
-
- clearWFlags( getWFlags() );
- setWFlags( WStyle_Customize | WStyle_DialogBorder | WStyle_StaysOnTop );
- // decorate = true;
- }
-#endif
-
- if ( decorate )
- {
- _qFrame->setFrameStyle ( QFrame::Box | QFrame::Raised );
- _qFrame->setLineWidth(2);
- _qFrame->setMidLineWidth(3);
- }
- else
- {
- _qFrame->setFrameStyle ( QFrame::NoFrame );
- }
}
@@ -111,7 +94,7 @@
{
int preferredWidth;
- if ( hasDefaultSize() )
+ if ( dialogType() == YMainDialog )
{
if ( userResized() )
preferredWidth = _userSize.width();
@@ -120,7 +103,7 @@
}
else
{
- preferredWidth = YDialog::preferredWidth() + 2 * decorationWidth();
+ preferredWidth = YDialog::preferredWidth();
}
int screenWidth = qApp->desktop()->width();
@@ -139,7 +122,7 @@
{
int preferredHeight;
- if ( hasDefaultSize() )
+ if ( dialogType() == YMainDialog )
{
if ( userResized() )
preferredHeight = _userSize.height();
@@ -148,7 +131,7 @@
}
else
{
- preferredHeight = YDialog::preferredHeight() + 2 * decorationWidth();
+ preferredHeight = YDialog::preferredHeight();
}
int screenHeight = qApp->desktop()->height();
@@ -163,19 +146,10 @@
}
-int YQDialog::decorationWidth()
-{
- if ( ! hasDefaultSize() && _qFrame )
- return _qFrame->frameWidth();
- else
- return 0;
-}
-
-
void YQDialog::setEnabled( bool enabled )
{
QWidget::setEnabled( enabled );
- YWidget::setEnabled( enabled );
+ YDialog::setEnabled( enabled );
}
@@ -189,16 +163,9 @@
if ( hasChildren() )
{
- firstChild()->setSize( newWidth - 2 * decorationWidth(),
- newHeight - 2 * decorationWidth() );
-
- QWidget * qChild = (QWidget *) firstChild()->widgetRep();
- qChild->move( decorationWidth(), decorationWidth() );
+ firstChild()->setSize( newWidth, newHeight );
}
- if ( _qFrame )
- _qFrame->resize( newWidth, newHeight );
-
resize( newWidth, newHeight );
}
@@ -619,9 +586,9 @@
void YQDialog::closeEvent( QCloseEvent * event )
{
- // The window manager "close window" button ( and menu, e.g. Alt-F4 ) will be
+ // The window manager "close window" button (and WM menu, e.g. Alt-F4) will be
// handled just like the user had clicked on the `id`( `cancel ) button in
- // that dialog. It's up to the YCP application to handle this ( if desired ).
+ // that dialog. It's up to the YCP application to handle this (if desired).
y2debug( "Ignoring window manager close button." );
event->ignore();
@@ -654,10 +621,8 @@
void
YQDialog::show()
{
- if ( ! hasDefaultSize() && qApp->mainWidget()->isVisible() )
- center( this, qApp->mainWidget() );
- else if ( isCentered() )
- center( this, qApp->desktop() );
+ if ( ! dialogType() == YMainDialog && qApp->mainWidget()->isVisible() )
+ center( this, qApp->mainWidget() );
QWidget::show();
}
Modified: trunk/qt/src/YQDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQDialog.h?rev=42557&r1=4…
==============================================================================
--- trunk/qt/src/YQDialog.h (original)
+++ trunk/qt/src/YQDialog.h Fri Nov 30 14:19:17 2007
@@ -26,7 +26,6 @@
class YQGenericButton;
class YQWizard;
-class QFrame;
class YQDialog : public QWidget, public YDialog
@@ -35,17 +34,27 @@
public:
/**
- * Constructor: Constructor.
+ * Constructor.
+ *
+ * 'dialogType' is one of YMainDialog or YPopupDialog.
+ *
+ * 'colorMode' can be set to YDialogWarnColor to use very bright "warning"
+ * colors or YDialogInfoColor to use more prominent, yet not quite as
+ * bright as "warning" colors. Use both only very rarely.
**/
- YQDialog( const YWidgetOpt & opt,
- QWidget * qt_parent = 0,
- bool default_size = false );
+ YQDialog( QWidget * qParent,
+ YDialogType dialogType,
+ YDialogColorMode colorMode = YDialogNormalColor );
+
+protected:
/**
- * Destructor: Cleans up.
+ * Destructor.
+ * Don't delete a dialog directly, use YDialog::deleteTopmostDialog().
**/
- ~YQDialog();
+ virtual ~YQDialog();
+public:
/**
* Makes this dialog active or inactive
**/
@@ -86,12 +95,6 @@
virtual void setSize( int newWidth, int newHeight );
/**
- * Returns the size of (artificial) window manager decorations, depending
- * on the value of YDialog::isDecorated().
- **/
- int decorationWidth();
-
- /**
* Return this dialog's (first) default button or 0 if none
**/
YQGenericButton * findDefaultButton();
@@ -228,8 +231,6 @@
// Data members
//
- QFrame * _qFrame;
-
bool _userResized;
QSize _userSize;
Modified: trunk/qt/src/YQInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQInputField.cc?rev=42557…
==============================================================================
--- trunk/qt/src/YQInputField.cc (original)
+++ trunk/qt/src/YQInputField.cc Fri Nov 30 14:19:17 2007
@@ -14,7 +14,7 @@
Author: Stefan Hundhammer <sh(a)suse.de>
- textdomain "packages-qt"
+ Textdomain "packages-qt"
/-*/
Modified: trunk/qt/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQUI.h?rev=42557&r1=42556…
==============================================================================
--- trunk/qt/src/YQUI.h (original)
+++ trunk/qt/src/YQUI.h Fri Nov 30 14:19:17 2007
@@ -340,13 +340,6 @@
YEvent * pollInput();
/**
- * Create a dialog.
- *
- * Reimplemented from YUI.
- **/
- YDialog * createDialog( YWidgetOpt & opt );
-
- /**
* Show and activate a dialog.
*
* Reimplemented from YUI.
Modified: trunk/qt/src/YQUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQUI_core.cc?rev=42557&r1…
==============================================================================
--- trunk/qt/src/YQUI_core.cc (original)
+++ trunk/qt/src/YQUI_core.cc Fri Nov 30 14:19:17 2007
@@ -485,6 +485,8 @@
}
+#warning obsolete
+#if 0
YDialog * YQUI::createDialog( YWidgetOpt & opt )
{
bool has_defaultsize = opt.hasDefaultSize.value();
@@ -510,6 +512,7 @@
return dialog;
}
+#endif
void YQUI::showDialog( YDialog * dialog )
@@ -522,7 +525,7 @@
return;
}
- if ( dialog->hasDefaultSize() )
+ if ( dialog->dialogType() == YMainDialog )
{
_widget_stack->addWidget ( qw, ++_main_dialog_id );
_widget_stack->raiseWidget( qw ); // maybe this is not necessary (?)
@@ -559,7 +562,7 @@
return;
}
- if ( dialog->hasDefaultSize() )
+ if ( dialog->dialogType() == YMainDialog )
{
_widget_stack->removeWidget( qw );
@@ -579,6 +582,8 @@
{
qw->hide();
+#warning FIXME
+#if 0
// Clean up the popup stack. libyui guarantees that a dialog will be
// deleted after closeDialog() so it is safe to pop that dialog from
// the popup stack here.
@@ -587,6 +592,7 @@
_popup_stack.pop_back();
else
y2error( "Popup dialog stack corrupted!" );
+#endif
}
}
Modified: trunk/qt/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWidgetFactory.cc?rev=42…
==============================================================================
--- trunk/qt/src/YQWidgetFactory.cc (original)
+++ trunk/qt/src/YQWidgetFactory.cc Fri Nov 30 14:19:17 2007
@@ -47,22 +47,17 @@
//
YQDialog *
-YQWidgetFactory::createMainDialog()
+YQWidgetFactory::createDialog( YDialogType dialogType, YDialogColorMode colorMode )
{
- return 0; // FIXME: TO DO
-}
-
-
+ QWidget * qParent = 0;
+ YQDialog * dialog = new YQDialog( qParent, dialogType, colorMode );
+ YUI_CHECK_NEW( dialog );
-YQDialog *
-YQWidgetFactory::createPopupDialog()
-{
- return 0; // FIXME: TO DO
+ return dialog;
}
-
//
// Layout Boxes
//
Modified: trunk/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/trunk/qt/src/YQWidgetFactory.h?rev=425…
==============================================================================
--- trunk/qt/src/YQWidgetFactory.h (original)
+++ trunk/qt/src/YQWidgetFactory.h Fri Nov 30 14:19:17 2007
@@ -70,14 +70,13 @@
// Dialogs
//
- virtual YQDialog * createMainDialog();
- virtual YQDialog * createPopupDialog();
+ virtual YQDialog * createDialog ( YDialogType dialogType, YDialogColorMode colorMode = YDialogNormalColor );
//
// Layout Boxes
//
- virtual YQLayoutBox * createLayoutBox( YWidget * parent, YUIDimension dim );
+ virtual YQLayoutBox * createLayoutBox ( YWidget * parent, YUIDimension dim );
//
// Common Leaf Widgets
--
To unsubscribe, e-mail: yast-commit+unsubscribe(a)opensuse.org
For additional commands, e-mail: yast-commit+help(a)opensuse.org
1
0