Author: coolo
Date: Sun Dec 2 16:50:25 2007
New Revision: 42570
URL: http://svn.opensuse.org/viewcvs/yast?rev=42570&view=rev
Log:
merge Huha's ydialog changes
Modified:
branches/tmp/coolo/qt4-port/VERSION
branches/tmp/coolo/qt4-port/package/yast2-qt4.changes
branches/tmp/coolo/qt4-port/src/CMakeLists.txt
branches/tmp/coolo/qt4-port/src/YQDialog.cc
branches/tmp/coolo/qt4-port/src/YQDialog.h
branches/tmp/coolo/qt4-port/src/YQInputField.cc
branches/tmp/coolo/qt4-port/src/YQUI.h
branches/tmp/coolo/qt4-port/src/YQUI_core.cc
branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc
branches/tmp/coolo/qt4-port/src/YQWidgetFactory.h
branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc
branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc
branches/tmp/coolo/qt4-port/yast2-qt4.spec.in
Modified: branches/tmp/coolo/qt4-port/VERSION
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/VERSION?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/VERSION (original)
+++ branches/tmp/coolo/qt4-port/VERSION Sun Dec 2 16:50:25 2007
@@ -1 +1 @@
-2.16.5
+2.16.6
Modified: branches/tmp/coolo/qt4-port/package/yast2-qt4.changes
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/package/yast2-qt4.changes?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/package/yast2-qt4.changes (original)
+++ branches/tmp/coolo/qt4-port/package/yast2-qt4.changes Sun Dec 2 16:50:25 2007
@@ -1,4 +1,10 @@
-------------------------------------------------------------------
+Fri Nov 30 17:20:49 CET 2007 - sh@suse.de
+
+- Migrated YQDialog to mod-ui
+- V 2.16.6
+
+-------------------------------------------------------------------
Tue Nov 27 19:08:00 CET 2007 - sh@suse.de
- Moved all YCP related code out of YQWizard
Modified: branches/tmp/coolo/qt4-port/src/CMakeLists.txt
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/CMakeLists.txt?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/CMakeLists.txt (original)
+++ branches/tmp/coolo/qt4-port/src/CMakeLists.txt Sun Dec 2 16:50:25 2007
@@ -47,7 +47,7 @@
INSTALL(TARGETS py2qt4 LIBRARY DESTINATION ${YAST_PLUGIN_DIR} )
-ADD_SUBDIRECTORY(pkg)
+#ADD_SUBDIRECTORY(pkg)
#SET_TARGET_PROPERTIES( y2lang_qt4 PROPERTIES PREFIX "" )
Modified: branches/tmp/coolo/qt4-port/src/YQDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDialog.cc?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDialog.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQDialog.cc Sun Dec 2 16:50:25 2007
@@ -39,32 +39,32 @@
// like "Above", "Below" etc. that clash with some Qt headers.
#include
+#define YQMainDialogWFlags Qt::Window
-YQDialog::YQDialog( const YWidgetOpt & opt,
- QWidget * qt_parent,
- bool default_size )
- : QWidget( qt_parent,
- default_size ? Qt::Widget : Qt::Window ) // WFlags
- , YDialog( opt )
+#define YQPopupDialogWFlags Qt::Widget
+
+YQDialog::YQDialog( QWidget * qParent,
+ YDialogType dialogType,
+ YDialogColorMode colorMode )
+ : QWidget( qParent,
+ dialogType == YMainDialog ? YQMainDialogWFlags : YQPopupDialogWFlags )
+ , YDialog( dialogType, colorMode )
{
_userResized = false;
_focusButton = 0;
_defaultButton = 0;
setWidgetRep( this );
- setWindowTitle( hasDefaultSize() ? "YaST2" : "" );
+ setWindowTitle( dialogType == YMainDialog ? "YaST2" : "" );
setFocusPolicy( Qt::StrongFocus );
- if ( ! default_size )
- setWindowModality( Qt::WindowModal );
-
- if ( hasWarnColor() || hasInfoColor() )
+ if ( colorMode != YDialogNormalColor )
{
QColor normalBackground ( 0, 128, 0 );
QColor inputFieldBackground ( 0, 96, 0 );
QColor text = Qt::white;
- if ( hasInfoColor() )
+ if ( colorMode == YDialogInfoColor )
{
normalBackground = QColor ( 238, 232, 170 ); // PaleGoldenrod
}
@@ -76,31 +76,6 @@
warnPalette.setCurrentColorGroup(QPalette::Active);
setPalette( warnPalette );
}
-
- _qFrame = new Q3Frame ( this );
- bool decorate = ! hasDefaultSize() && ! YQUI::ui()->haveWM();
-
-#if 0
- if ( hasSmallDecorations() )
- {
- // None of this works (yet). :-((
-
- clearWFlags( getWFlags() );
- setWFlags( Qt::WStyle_Customize | Qt::WStyle_DialogBorder | Qt::WStyle_StaysOnTop );
- // decorate = true;
- }
-#endif
-
- if ( decorate )
- {
- _qFrame->setFrameStyle ( Q3Frame::Box | Q3Frame::Raised );
- _qFrame->setLineWidth(2);
- _qFrame->setMidLineWidth(3);
- }
- else
- {
- _qFrame->setFrameStyle ( Q3Frame::NoFrame );
- }
}
@@ -113,7 +88,7 @@
{
int preferredWidth;
- if ( hasDefaultSize() )
+ if ( dialogType() == YMainDialog )
{
if ( userResized() )
preferredWidth = _userSize.width();
@@ -122,7 +97,7 @@
}
else
{
- preferredWidth = YDialog::preferredWidth() + 2 * decorationWidth();
+ preferredWidth = YDialog::preferredWidth();
}
int screenWidth = qApp->desktop()->width();
@@ -141,7 +116,7 @@
{
int preferredHeight;
- if ( hasDefaultSize() )
+ if ( dialogType() == YMainDialog )
{
if ( userResized() )
preferredHeight = _userSize.height();
@@ -150,7 +125,7 @@
}
else
{
- preferredHeight = YDialog::preferredHeight() + 2 * decorationWidth();
+ preferredHeight = YDialog::preferredHeight();
}
int screenHeight = qApp->desktop()->height();
@@ -165,19 +140,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 );
}
@@ -191,16 +157,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 );
}
@@ -243,6 +202,9 @@
_defaultButton = findDefaultButton( childrenBegin(), childrenEnd() );
+ YDialog::setDefaultButton( 0 ); // prevent complaints about multiple default buttons
+ YDialog::setDefaultButton( _defaultButton );
+
return _defaultButton;
}
@@ -349,6 +311,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 )
@@ -427,7 +396,7 @@
void
-YQDialog::setDefaultButton( YQGenericButton * newDefaultButton )
+YQDialog::setDefaultButton( YPushButton * newDefaultButton )
{
if ( _defaultButton &&
newDefaultButton &&
@@ -441,13 +410,13 @@
else
{
y2error( "Too many `opt(`default) PushButtons: [%s]",
- qPrintable(newDefaultButton->text()) );
+ newDefaultButton->label().c_str() );
newDefaultButton->setDefaultButton( false );
return;
}
}
- _defaultButton = newDefaultButton;
+ _defaultButton = dynamic_cast(newDefaultButton);
if ( _defaultButton )
{
@@ -457,6 +426,10 @@
if ( _defaultButton && ! _focusButton )
_defaultButton->showAsDefault( true );
}
+
+
+ YDialog::setDefaultButton( 0 ); // prevent complaints about multiple default buttons
+ YDialog::setDefaultButton( _defaultButton );
}
@@ -621,9 +594,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();
@@ -656,16 +629,11 @@
void
YQDialog::show()
{
- //if ( ! hasDefaultSize() && qApp->mainWidget()->isVisible() )
- if ( ! hasDefaultSize() )
- {
- // will use topwidget anyway
- center( this, 0 );
- }
- else if ( isCentered() )
- {
- center( this, qApp->desktop() );
- }
+#if FIXME
+ if ( ! dialogType() == YMainDialog && qApp->mainWidget()->isVisible() )
+ center( this, qApp->mainWidget() );
+#endif
+
QWidget::show();
}
Modified: branches/tmp/coolo/qt4-port/src/YQDialog.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQDialog.h?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQDialog.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQDialog.h Sun Dec 2 16:50:25 2007
@@ -28,8 +28,6 @@
class YQGenericButton;
class YQWizard;
-class Q3Frame;
-
class YQDialog : public QWidget, public YDialog
{
@@ -37,17 +35,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
**/
@@ -88,12 +96,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();
@@ -136,7 +138,7 @@
* [Return] if no other button has the keyboard focus.
* 'newDefaultButton' may be 0 if the former default button is destroyed.
**/
- void setDefaultButton( YQGenericButton * newDefaultButton );
+ void setDefaultButton( YPushButton * newDefaultButton );
/**
* Ensure presence of no more than one single default button.
@@ -230,8 +232,6 @@
// Data members
//
- Q3Frame * _qFrame;
-
bool _userResized;
QSize _userSize;
Modified: branches/tmp/coolo/qt4-port/src/YQInputField.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQInputField.cc?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQInputField.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQInputField.cc Sun Dec 2 16:50:25 2007
@@ -14,7 +14,7 @@
Author: Stefan Hundhammer
- textdomain "packages-qt"
+ Textdomain "packages-qt"
/-*/
Modified: branches/tmp/coolo/qt4-port/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI.h?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI.h Sun Dec 2 16:50:25 2007
@@ -341,13 +341,6 @@
YEvent * pollInput();
/**
- * Create a dialog.
- *
- * Reimplemented from YUI.
- **/
- YDialog * createDialog( YWidgetOpt & opt );
-
- /**
* Show and activate a dialog.
*
* Reimplemented from YUI.
Modified: branches/tmp/coolo/qt4-port/src/YQUI_core.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQUI_core.cc?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQUI_core.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQUI_core.cc Sun Dec 2 16:50:25 2007
@@ -516,6 +516,8 @@
}
+#warning obsolete
+#if 0
YDialog * YQUI::createDialog( YWidgetOpt & opt )
{
init_ui();
@@ -537,6 +539,7 @@
return dialog;
}
+#endif
void YQUI::showDialog( YDialog * dialog )
@@ -549,7 +552,7 @@
return;
}
- if ( dialog->hasDefaultSize() )
+ if ( dialog->dialogType() == YMainDialog )
{
_widget_stack->addWidget ( qw );
_widget_stack->setCurrentWidget( qw );
@@ -587,7 +590,7 @@
return;
}
- if ( dialog->hasDefaultSize() )
+ if ( dialog->dialogType() == YMainDialog )
{
_widget_stack->removeWidget( qw );
}
@@ -595,6 +598,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.
@@ -603,6 +608,7 @@
_popup_stack.pop_back();
else
y2error( "Popup dialog stack corrupted!" );
+#endif
}
}
Modified: branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc (original)
+++ branches/tmp/coolo/qt4-port/src/YQWidgetFactory.cc Sun Dec 2 16:50:25 2007
@@ -48,22 +48,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: branches/tmp/coolo/qt4-port/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/YQWidgetFactory.h?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/YQWidgetFactory.h (original)
+++ branches/tmp/coolo/qt4-port/src/YQWidgetFactory.h Sun Dec 2 16:50:25 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
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgConflictDialog.cc Sun Dec 2 16:50:25 2007
@@ -361,7 +361,7 @@
QString heading = QString( "<h2>%1</h2>" ).arg( _( "Create Dependency Resolver Test Case" ) );
QString msg =
- _( "<p>Use this to generate extensive logs to help tracking down bugs in the dependency resolver."
+ _( "<p>Use this to generate extensive logs to help tracking down bugs in the dependency resolver. "
"The logs will be stored in directory <br><tt>%1</tt></p>" ).arg( testCaseDir );
int button_no = QMessageBox::information( 0, // parent
Modified: branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc (original)
+++ branches/tmp/coolo/qt4-port/src/pkg/YQPkgRepoFilterView.cc Sun Dec 2 16:50:25 2007
@@ -97,7 +97,11 @@
// Translators: This is a combo box where the user can apply a secondary filter
// in addition to the primary filter by repository - one of
- // "all packages", "RPM groups", "search", "summary"
+ // "All packages", "RPM groups", "search", "summary"
+ //
+ // And yes, the colon really belongs there since this is one of the very
+ // few cases where a combo box label is left to the combo box rather than
+ // above it.
_secondaryFilters = new QY2ComboTabWidget( _( "&Secondary Filter:" ), vbox );
Q_CHECK_PTR( _secondaryFilters );
Modified: branches/tmp/coolo/qt4-port/yast2-qt4.spec.in
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/coolo/qt4-port/yast2-qt4.spec.in?rev=42570&r1=42569&r2=42570&view=diff
==============================================================================
--- branches/tmp/coolo/qt4-port/yast2-qt4.spec.in (original)
+++ branches/tmp/coolo/qt4-port/yast2-qt4.spec.in Sun Dec 2 16:50:25 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 libqt4-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:/usr/lib/YaST2/servers/qt
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org