Author: sh-sh-sh
Date: Thu Jul 3 16:42:54 2008
New Revision: 48843
URL: http://svn.opensuse.org/viewcvs/yast?rev=48843&view=rev
Log:
registration page + beautification
Added:
branches/tmp/jdsn/registration/src/RegRegistrationPage.cc
branches/tmp/jdsn/registration/src/RegRegistrationPage.h
Modified:
branches/tmp/jdsn/registration/src/ (props changed)
branches/tmp/jdsn/registration/src/Makefile.am
branches/tmp/jdsn/registration/src/RegHWInfoPage.cc
branches/tmp/jdsn/registration/src/RegHWInfoPage.h
branches/tmp/jdsn/registration/src/RegMain.cc
branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc
Modified: branches/tmp/jdsn/registration/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/Makefile.am?rev=48843&r1=48842&r2=48843&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/Makefile.am (original)
+++ branches/tmp/jdsn/registration/src/Makefile.am Thu Jul 3 16:42:54 2008
@@ -19,6 +19,7 @@
ConfigInstallInf.h \
ConfigIni.h \
RegHWInfoPage.cc \
+ RegRegistrationPage.cc \
WizardEmulation.cc
yast2_registration_LDADD = -L$(top_srcdir)/src -lyui -lrudeconfig
Modified: branches/tmp/jdsn/registration/src/RegHWInfoPage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegHWInfoPage.cc?rev=48843&r1=48842&r2=48843&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegHWInfoPage.cc (original)
+++ branches/tmp/jdsn/registration/src/RegHWInfoPage.cc Thu Jul 3 16:42:54 2008
@@ -1,4 +1,4 @@
-// Wizard page for "Update Repository"
+// Wizard page for "Hardware and System Information"
#define YUILogComponent "reg"
@@ -87,7 +87,8 @@
YWidgetFactory * fac = YUI::widgetFactory(); // shortcut
- YAlignment * outerMarginBox = fac->createMarginBox( parent, 1.5, 0.3 );
+ YSquash * squash = fac->createHSquash( parent );
+ YAlignment * outerMarginBox = fac->createMarginBox( squash, 1.5, 0.3 );
YLayoutBox * vbox = fac->createVBox( outerMarginBox );
string explanationText =
@@ -101,7 +102,8 @@
_sendHWInfoCheckBoxFrame =
fac->createCheckBoxFrame( vbox, _( "Send Hardware and System Information" ), _sendHWInfo );
YAlignment * innerMarginBox = fac->createMarginBox( _sendHWInfoCheckBoxFrame, 1.5, 0.7 );
- _hwInfoRichText = fac->createRichText( innerMarginBox, _hwInfoText, true ); // plainText
+ YAlignment * minSize = fac->createMinSize( innerMarginBox, 70, 12 );
+ _hwInfoRichText = fac->createRichText( minSize, _hwInfoText, true ); // plainText
}
Modified: branches/tmp/jdsn/registration/src/RegHWInfoPage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegHWInfoPage.h?rev=48843&r1=48842&r2=48843&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegHWInfoPage.h (original)
+++ branches/tmp/jdsn/registration/src/RegHWInfoPage.h Thu Jul 3 16:42:54 2008
@@ -74,9 +74,10 @@
virtual string helpText();
/**
- * Return 'true' if updates are enabled. If the page is currently shown,
- * this will retrieve the status of the CheckBoxFrame. Otherwise, it
- * returns the stored value.
+ * Return 'true' if the user wishes to send hardware and system
+ * information.
+ * If the page is currently shown, this will retrieve the status of the
+ * CheckBoxFrame. Otherwise, it returns the stored value.
**/
bool sendHWInfo();
Modified: branches/tmp/jdsn/registration/src/RegMain.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegMain.cc?rev=48843&r1=48842&r2=48843&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegMain.cc (original)
+++ branches/tmp/jdsn/registration/src/RegMain.cc Thu Jul 3 16:42:54 2008
@@ -19,6 +19,7 @@
#include "RegWizard.h"
#include "RegUpdateRepoPage.h"
#include "RegHWInfoPage.h"
+#include "RegRegistrationPage.h"
#include "ConfigIni.h"
@@ -36,12 +37,10 @@
RegUpdateRepoPage updateRepoPage( true,
productFeatures.getString("external_sources_link", "software" ));
RegHWInfoPage hwInfoPage;
- RegUpdateRepoPage updateRepoPage2( true, "Page 2" );
- RegUpdateRepoPage updateRepoPage3( true, "Page 3" );
+ RegRegistrationPage registrationPage;
- updateRepoPage.setNextPage ( &hwInfoPage );
- hwInfoPage.setNextPage ( &updateRepoPage2 );
- updateRepoPage2.setNextPage( &updateRepoPage3 );
+ updateRepoPage.setNextPage ( &hwInfoPage );
+ hwInfoPage.setNextPage ( ®istrationPage );
RegWizard::regWizard()->showPage( &updateRepoPage );
bool success = RegWizard::runWorkflow();
Added: branches/tmp/jdsn/registration/src/RegRegistrationPage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegRegistrationPage.cc?rev=48843&view=auto
==============================================================================
--- branches/tmp/jdsn/registration/src/RegRegistrationPage.cc (added)
+++ branches/tmp/jdsn/registration/src/RegRegistrationPage.cc Thu Jul 3 16:42:54 2008
@@ -0,0 +1,124 @@
+// Wizard page for "Registration"
+
+
+#define YUILogComponent "reg"
+#include
+
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+#include
+
+#include "RegRegistrationPage.h"
+#include "RegWizard.h"
+#include "Reg_i18n.h"
+
+
+
+RegRegistrationPage::RegRegistrationPage()
+ : _registerNow( false )
+{
+ forgetWidgets();
+}
+
+
+RegRegistrationPage::~RegRegistrationPage()
+{
+ // NOP
+}
+
+
+void RegRegistrationPage::init()
+{
+ // TO DO: Obtain some info?
+}
+
+
+void RegRegistrationPage::createWidgets( YWidget * parent )
+{
+ YWizard * wizard = RegWizard::regWizard()->wizard();
+ YUI_CHECK_PTR( wizard );
+
+ wizard->setDialogHeading( _( "Registration" ) );
+ wizard->setDialogIcon( YUI::app()->iconBasePath() + "yast-product-registration.png" );
+ wizard->setHelpText( helpText() );
+
+ YWidgetFactory * fac = YUI::widgetFactory(); // shortcut
+
+ YSquash * squash = fac->createHVSquash( parent );
+ YAlignment * outerMarginBox = fac->createMarginBox( squash, 7, 1.5 );
+ YLayoutBox * vbox = fac->createVBox( outerMarginBox );
+
+ string explanationText =
+ _( "If you purchased the product, you are entitled to register for\n"
+ "installation support." );
+ YAlignment * left = fac->createLeft( vbox );
+ fac->createLabel( left, explanationText );
+
+ fac->createVSpacing( vbox, 0.8 );
+
+ _registerNowCheckBoxFrame =
+ fac->createCheckBoxFrame( vbox, _( "Register &Now" ), _registerNow );
+ YAlignment * innerMarginBox = fac->createMarginBox( _registerNowCheckBoxFrame, 1.5, 0.7 );
+ YAlignment * minSize = fac->createMinSize( innerMarginBox, 50, 12 );
+
+ string text =
+ _(
+ "<h3>openSUSE Product Registration</h3>"
+ "<p>In the next step, a browser will open with the openSUSE registration page.</p>"
+ "<p>You will need your openSUSE <b>registration key</b>. You can find that key printed "
+ "on the openSUSE DVD box. "
+ "Once you are registered, you are entitled to installation support "
+ "according to the terms printed on the package.</p>"
+ "<p><b>Note</b>: You cannot register the free download version.</p>"
+ );
+
+ _richText = fac->createRichText( minSize, text );
+
+ // workaround for known bug - remove in some weeks (2008-07-03 sh)
+
+ _registerNowCheckBoxFrame->setValue( true );
+ _registerNowCheckBoxFrame->setValue( _registerNow );
+}
+
+
+string RegRegistrationPage::helpText()
+{
+ string text =
+ _( "Help text for registration page" );
+
+ // TO DO: Help text
+
+ return text;
+}
+
+
+void RegRegistrationPage::save()
+{
+ _registerNow = _registerNowCheckBoxFrame->value();
+}
+
+
+void RegRegistrationPage::forgetWidgets()
+{
+ _registerNowCheckBoxFrame = 0;
+ _richText = 0;
+}
+
+
+bool RegRegistrationPage::registerNow()
+{
+ if ( _registerNowCheckBoxFrame &&
+ _registerNowCheckBoxFrame->isValid() )
+ {
+ _registerNow = _registerNowCheckBoxFrame->value();
+ }
+
+ return _registerNow;
+}
Added: branches/tmp/jdsn/registration/src/RegRegistrationPage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegRegistrationPage.h?rev=48843&view=auto
==============================================================================
--- branches/tmp/jdsn/registration/src/RegRegistrationPage.h (added)
+++ branches/tmp/jdsn/registration/src/RegRegistrationPage.h Thu Jul 3 16:42:54 2008
@@ -0,0 +1,92 @@
+// Wizard page for "Registration"
+
+#ifndef RegRegistrationPage_h
+#define RegRegistrationPage_h
+
+#include "RegWizardPage.h"
+#include <string>
+
+using std::string;
+
+class YCheckBoxFrame;
+class YRichText;
+
+
+/**
+ * Wizard page for "Registration" in the registration workflow.
+ *
+ * This class holds the data of this page, regardless whether or not this page
+ * is currently displayed.
+ **/
+class RegRegistrationPage: public RegWizardPage
+{
+public:
+ /**
+ * Constructor.
+ *
+ * This does not create any widget yet or show any page content; it only
+ * stores the parameters for later use when show() is called.
+ **/
+ RegRegistrationPage();
+
+ /**
+ * Destructor.
+ **/
+ virtual ~RegRegistrationPage();
+
+ /**
+ * Initialize internal data. This is called in show() just before widgets
+ * are created.
+ *
+ * Reimplemented from RegWizardPage.
+ **/
+ virtual void init();
+
+ /**
+ * Create the widgets for this page.
+ *
+ * Implemented from RegWizardPage.
+ **/
+ virtual void createWidgets( YWidget * parent );
+
+ /**
+ * Clear all pointers to internally stored widgets. This should not delete
+ * the widgets, just set all internally stored pointers to widgets etc. to
+ * 0.
+ *
+ * Reimplemented from RegWizardPage.
+ **/
+ virtual void forgetWidgets();
+
+ /**
+ * Save the widget values to the internal values.
+ *
+ * Reimplemented from RegWizardPage.
+ **/
+ virtual void save();
+
+ /**
+ * Return the help text for this wizard page.
+ *
+ * Reimplemented from RegWizardPage.
+ **/
+ virtual string helpText();
+
+ /**
+ * Return 'true' if the user wishes to register.
+ * As long as this page is shown, this will retrieve the status of the
+ * CheckBoxFrame. Otherwise, it returns the stored value.
+ **/
+ bool registerNow();
+
+
+private:
+
+ bool _registerNow;
+
+ YCheckBoxFrame * _registerNowCheckBoxFrame;
+ YRichText * _richText;
+};
+
+
+#endif // RegRegistrationPage_h
Modified: branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc?rev=48843&r1=48842&r2=48843&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc (original)
+++ branches/tmp/jdsn/registration/src/RegUpdateRepoPage.cc Thu Jul 3 16:42:54 2008
@@ -48,7 +48,7 @@
YUI_CHECK_PTR( wizard );
wizard->setDialogHeading( _( "Update Repository" ) );
- wizard->setDialogIcon( YUI::app()->iconBasePath() + "yast-product-registration.png" );
+ wizard->setDialogIcon( YUI::app()->iconBasePath() + "yast-update.png" );
wizard->setHelpText( helpText() );
YWidgetFactory * fac = YUI::widgetFactory(); // shortcut
@@ -59,7 +59,8 @@
string explanationText =
_( "You should update your system on a regular basis\n"
"to keep it secure." );
- fac->createLabel( vbox, explanationText );
+ YAlignment * left = fac->createLeft( vbox );
+ fac->createLabel( left, explanationText );
fac->createVSpacing( vbox, 0.8 );
@@ -72,6 +73,8 @@
YAlignment * left2 = fac->createLeft( innerVBox );
_updateRepoURLLabel = fac->createOutputField( left2, _updateRepoURL );
+
+ fac->createVSpacing( vbox, 4 );
}
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org