Mailinglist Archive: yast-commit (490 mails)

< Previous Next >
[yast-commit] r38976 - in /branches/tmp/sh/mod-ui/qt/src: YQEmpty.cc YQEmpty.h YQSpacing.cc YQSpacing.h YQUI.h YQUI_widgets.cc YQWidgetFactory.cc YQWidgetFactory.h YQWizard.cc
  • From: sh-sh-sh@xxxxxxxxxxxxxxxx
  • Date: Fri, 22 Jun 2007 17:13:07 -0000
  • Message-id: <20070622171307.790B8C5391@xxxxxxxxxxxxxxxx>
Author: sh-sh-sh
Date: Fri Jun 22 19:13:07 2007
New Revision: 38976

URL: http://svn.opensuse.org/viewcvs/yast?rev=38976&view=rev
Log:
migrated spacing and empty

Modified:
    branches/tmp/sh/mod-ui/qt/src/YQEmpty.cc
    branches/tmp/sh/mod-ui/qt/src/YQEmpty.h
    branches/tmp/sh/mod-ui/qt/src/YQSpacing.cc
    branches/tmp/sh/mod-ui/qt/src/YQSpacing.h
    branches/tmp/sh/mod-ui/qt/src/YQUI.h
    branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
    branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
    branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
    branches/tmp/sh/mod-ui/qt/src/YQWizard.cc

Modified: branches/tmp/sh/mod-ui/qt/src/YQEmpty.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQEmpty.cc?rev=38976&r1=38975&r2=38976&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQEmpty.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQEmpty.cc Fri Jun 22 19:13:07 2007
@@ -20,14 +20,20 @@
 #include "YQEmpty.h"
 
 
-YQEmpty::YQEmpty( QWidget * parent, const YWidgetOpt &     opt )
-    : QWidget( parent )
-    , YEmpty( opt )
+YQEmpty::YQEmpty( YWidget * parent )
+    : QWidget( (QWidget *) parent->widgetRep() )
+    , YEmpty( parent )
 {
     setWidgetRep( this );
 }
 
 
+YQEmpty::~YQEmpty()
+{
+    // NOP
+}
+
+
 void YQEmpty::setSize( long newWidth, long newHeight )
 {
     resize( newWidth, newHeight );

Modified: branches/tmp/sh/mod-ui/qt/src/YQEmpty.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQEmpty.h?rev=38976&r1=38975&r2=38976&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQEmpty.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQEmpty.h Fri Jun 22 19:13:07 2007
@@ -16,8 +16,6 @@
 
 /-*/
 
-// -*- c++ -*-
-
 #ifndef YQEmpty_h
 #define YQEmpty_h
 
@@ -31,15 +29,22 @@
 
 public:
     /**
-     * Constructor
-     */
-    YQEmpty( QWidget * parent, const YWidgetOpt & opt );
+     * Constructor.
+     **/
+    YQEmpty( YWidget * parent );
+
+    /**
+     * Destructor.
+     **/
+    virtual ~YQEmpty();
     
     /**
-     * Sets the new size of the widget.
+     * Sets a new size.
+     *
      * Reimplemented from YWidget.
-     */
-    void setSize( long newWidth, long newHeight );
+     **/
+    virtual void setSize( long newWidth, long newHeight );
 };
 
+
 #endif // YQEmpty_h

Modified: branches/tmp/sh/mod-ui/qt/src/YQSpacing.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSpacing.cc?rev=38976&r1=38975&r2=38976&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSpacing.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSpacing.cc Fri Jun 22 19:13:07 2007
@@ -20,21 +20,26 @@
 #include "YQSpacing.h"
 
 
-YQSpacing::YQSpacing( QWidget *                parent,
-                     const YWidgetOpt &    opt,
-                     float                     size,
-                     bool                      horizontal,
-                     bool                      vertical )
-    : QWidget( parent )
-    , YSpacing( opt, size, horizontal, vertical )
+YQSpacing::YQSpacing( YWidget *                parent,
+                     YUIDimension      dim,
+                     bool              stretchable,
+                     YLayoutSize_t     layoutUnits )
+    : QWidget( (QWidget *) parent->widgetRep() )
+    , YSpacing( parent, dim, stretchable, layoutUnits )
 {
     setWidgetRep( this );
 }
 
 
+YQSpacing::~YQSpacing()
+{
+    // NOP
+}
+
+
 void YQSpacing::setSize( long newWidth, long newHeight )
 {
-    resize( newWidth, newHeight );
+    QWidget::resize( newWidth, newHeight );
 }
 
 

Modified: branches/tmp/sh/mod-ui/qt/src/YQSpacing.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQSpacing.h?rev=38976&r1=38975&r2=38976&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQSpacing.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQSpacing.h Fri Jun 22 19:13:07 2007
@@ -16,8 +16,6 @@
 
 /-*/
 
-// -*- c++ -*-
-
 #ifndef YQSpacing_h
 #define YQSpacing_h
 
@@ -32,18 +30,24 @@
 public:
     /**
      * Constructor.
-     */
-    YQSpacing( QWidget *               parent,
-              const YWidgetOpt &   opt,
-              float                    size,
-              bool                     horizontal,
-              bool                     vertical );
+     **/
+    YQSpacing( YWidget *       parent,
+              YUIDimension     dim,
+              bool             stretchable     = false,
+              YLayoutSize_t    layoutUnits     = 0.0 );
+
+    virtual ~YQSpacing();
 
     /**
-     * Sets the new size of the widget.
+     * Set a new size for layout purposes.
+     *
+     * This does not change the spacing size, i.e. the size this widget would
+     * like to get during layout.
+     *
      * Reimplemented from YWidget.
      */
-    void setSize( long newWidth, long newHeight );
+    virtual void setSize( long newWidth, long newHeight );
 };
 
+
 #endif // YQSpacing_h

Modified: branches/tmp/sh/mod-ui/qt/src/YQUI.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI.h?rev=38976&r1=38975&r2=38976&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI.h Fri Jun 22 19:13:07 2007
@@ -449,7 +449,6 @@
 
     YWidget * createCheckBox           ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, bool checked);
     YWidget * createComboBox           ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
-    YWidget * createEmpty              ( YWidget * parent, YWidgetOpt & opt);
     YWidget * createImage              ( YWidget * parent, YWidgetOpt & opt, YCPByteblock imageData,       YCPString fallbackText );
     YWidget * createImage              ( YWidget * parent, YWidgetOpt & opt, YCPString    fileName,        YCPString fallbackText );
     YWidget * createIntField           ( YWidget * parent, YWidgetOpt & opt, const YCPString & label, int minValue, int maxValue, int initialValue);
@@ -461,7 +460,6 @@
     YWidget * createRichText           ( YWidget * parent, YWidgetOpt & opt, const YCPString & text);
     YWidget * createSelectionBox       ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
     YWidget * createMultiSelectionBox  ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);
-    YWidget * createSpacing            ( YWidget * parent, YWidgetOpt & opt, float size, bool horizontal, bool vertical);
     YWidget * createTable              ( YWidget * parent, YWidgetOpt & opt, vector<string> header);
     YWidget * createTextEntry          ( YWidget * parent, YWidgetOpt & opt, const std::string & label, bool passwordMode );
     YWidget * createTree               ( YWidget * parent, YWidgetOpt & opt, const YCPString & label);

Modified: branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc?rev=38976&r1=38975&r2=38976&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQUI_widgets.cc Fri Jun 22 19:13:07 2007
@@ -28,8 +28,6 @@
 #include "YQDialog.h"
 #include "YQDownloadProgress.h"
 #include "YQDumbTab.h"
-#include "YQEmpty.h"
-#include "YQFrame.h"
 #include "YQImage.h"
 #include "YQIntField.h"
 #include "YQLogView.h"
@@ -56,23 +54,6 @@
 
 
 
-YWidget * YQUI::createEmpty            ( YWidget *             parent,
-                                         YWidgetOpt &              opt )
-{
-    return new YQEmpty( (QWidget *) parent->widgetRep(), opt );
-}
-
-YWidget * YQUI::createSpacing          ( YWidget *             parent,
-                                         YWidgetOpt &              opt,
-                                         float                 size,
-                                         bool                  horizontal,
-                                         bool                  vertical )
-{
-    return new YQSpacing( (QWidget *) parent->widgetRep(), opt, size, horizontal, vertical);
-}
-
-
-
 YContainerWidget * YQUI::createSquash  ( YWidget *             parent,
                                          YWidgetOpt &              opt,
                                          bool                  hsquash,

Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc?rev=38976&r1=38975&r2=38976&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.cc Fri Jun 22 19:13:07 2007
@@ -269,42 +269,24 @@
 // Layout Helpers
 //
 
-YQEmpty *
-YQWidgetFactory::createHStretch( YWidget * parent )
-{
-    return 0; // FIXME: TO DO
-}
-
-
-
-YQEmpty *
-YQWidgetFactory::createVStretch( YWidget * parent )
-{
-    return 0; // FIXME: TO DO
-}
-
-
-
-YQEmpty *
-YQWidgetFactory::createHSpacing( YWidget * parent, YLayoutSize_t size  )
-{
-    return 0; // FIXME: TO DO
-}
-
-
-
-YQEmpty *
-YQWidgetFactory::createVSpacing( YWidget * parent, YLayoutSize_t size )
+YQSpacing *
+YQWidgetFactory::createSpacing( YWidget * parent, YUIDimension dim, bool stretchable, YLayoutSize_t size )
 {
-    return 0; // FIXME: TO DO
+    YQSpacing * spacing = new YQSpacing( parent, dim, stretchable, size );
+    YUI_CHECK_NEW( spacing );
+    
+    return spacing;
+    
 }
 
 
-
 YQEmpty *
 YQWidgetFactory::createEmpty( YWidget * parent )
 {
-    return 0; // FIXME: TO DO
+    YQEmpty * empty = new YQEmpty( parent );
+    YUI_CHECK_NEW( empty );
+
+    return empty;
 }
 
 

Modified: branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h?rev=38976&r1=38975&r2=38976&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWidgetFactory.h Fri Jun 22 19:13:07 2007
@@ -44,6 +44,7 @@
 #include "YQReplacePoint.h"
 #include "YQRichText.h"
 #include "YQSelectionBox.h"
+#include "YQSpacing.h"
 #include "YQSquash.h"
 #include "YQTable.h"
 #include "YQTree.h"
@@ -119,12 +120,8 @@
     // Layout Helpers
     //
 
-    virtual YQEmpty *          createHStretch          ( YWidget * parent );
-    virtual YQEmpty *          createVStretch          ( YWidget * parent );
-    virtual YQEmpty *          createHSpacing          ( YWidget * parent, YLayoutSize_t size = 1.0 );
-    virtual YQEmpty *          createVSpacing          ( YWidget * parent, YLayoutSize_t size = 1.0 );
+    virtual YQSpacing *                createSpacing           ( YWidget * parent, YUIDimension dim, bool stretchable = false, YLayoutSize_t size = 0.0 );
     virtual YQEmpty *          createEmpty             ( YWidget * parent );
-
     virtual YQAlignment *      createAlignment         ( YWidget * parent, YAlignmentType horAlignment, YAlignmentType vertAlignment );
     virtual YQSquash *         createSquash            ( YWidget * parent, bool hSquash, bool vSquash );
 

Modified: branches/tmp/sh/mod-ui/qt/src/YQWizard.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/sh/mod-ui/qt/src/YQWizard.cc?rev=38976&r1=38975&r2=38976&view=diff
==============================================================================
--- branches/tmp/sh/mod-ui/qt/src/YQWizard.cc (original)
+++ branches/tmp/sh/mod-ui/qt/src/YQWizard.cc Fri Jun 22 19:13:07 2007
@@ -1123,11 +1123,8 @@
     // Initial YEmpty widget contents of replace point
     //
 
-    YWidgetOpt widgetOpt;
-    YQEmpty * empty = new YQEmpty( (QWidget *) replacePoint->widgetRep(), widgetOpt );
-#warning obsolete
-    empty->setParent( replacePoint );
-    replacePoint->addChild( empty );
+    YUI::widgetFactory()->createEmpty( replacePoint );
+    replacePoint->showChild();
 }
 
 

--
To unsubscribe, e-mail: yast-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: yast-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages