Author: jdsn
Date: Fri Jul 4 12:54:24 2008
New Revision: 48880
URL: http://svn.opensuse.org/viewcvs/yast?rev=48880&view=rev
Log:
sending HWinfo data
Added:
branches/tmp/jdsn/registration/src/RegUtil.cc
branches/tmp/jdsn/registration/src/RegUtil.h
Modified:
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
Modified: branches/tmp/jdsn/registration/src/Makefile.am
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/Makefile.am?rev=48880&r1=48879&r2=48880&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/Makefile.am (original)
+++ branches/tmp/jdsn/registration/src/Makefile.am Fri Jul 4 12:54:24 2008
@@ -16,6 +16,7 @@
RegWizard.cc \
RegWizardPage.cc \
RegUpdateRepoPage.cc \
+ RegUtil.cc \
ConfigEditor.cc \
ConfigInstallInf.h \
ConfigIni.h \
Modified: branches/tmp/jdsn/registration/src/RegHWInfoPage.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegHWInfoPage.cc?rev=48880&r1=48879&r2=48880&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegHWInfoPage.cc (original)
+++ branches/tmp/jdsn/registration/src/RegHWInfoPage.cc Fri Jul 4 12:54:24 2008
@@ -24,8 +24,10 @@
#include
#include
#include
+#include
#include
#include
+#include
#include
#include
#include
@@ -34,6 +36,7 @@
#include "RegHWInfoPage.h"
#include "RegWizard.h"
#include "Reg_i18n.h"
+#include "RegUtil.h"
RegHWInfoPage::RegHWInfoPage()
@@ -136,6 +139,8 @@
void RegHWInfoPage::save()
{
_sendHWInfo = _sendHWInfoCheckBoxFrame->value();
+ if ( _sendHWInfo )
+ sendHWInfo();
}
@@ -148,11 +153,7 @@
bool RegHWInfoPage::sendHWInfo()
{
- if ( _sendHWInfoCheckBoxFrame &&
- _sendHWInfoCheckBoxFrame->isValid() )
- {
- _sendHWInfo = _sendHWInfoCheckBoxFrame->value();
- }
-
- return _sendHWInfo;
+ string myStdout;
+ string myStderr;
+ return runSuseRegister( myStdout, myStderr, "", _sendHWInfo, _sendHWInfo, false);
}
Modified: branches/tmp/jdsn/registration/src/RegHWInfoPage.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegHWInfoPage.h?rev=48880&r1=48879&r2=48880&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegHWInfoPage.h (original)
+++ branches/tmp/jdsn/registration/src/RegHWInfoPage.h Fri Jul 4 12:54:24 2008
@@ -88,6 +88,7 @@
**/
virtual string helpText();
+
/**
* Return 'true' if the user wishes to send hardware and system
* information.
Modified: branches/tmp/jdsn/registration/src/RegMain.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegMain.cc?rev=48880&r1=48879&r2=48880&view=diff
==============================================================================
--- branches/tmp/jdsn/registration/src/RegMain.cc (original)
+++ branches/tmp/jdsn/registration/src/RegMain.cc Fri Jul 4 12:54:24 2008
@@ -48,7 +48,7 @@
RegUpdateRepoPage updateRepoPage( true,
- productFeatures.getString("external_sources_link", "software" ));
+ productFeatures.getString("update_repository", "software" ));
RegHWInfoPage hwInfoPage;
RegRegistrationPage registrationPage;
Added: branches/tmp/jdsn/registration/src/RegUtil.cc
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegUtil.cc?rev=48880&view=auto
==============================================================================
--- branches/tmp/jdsn/registration/src/RegUtil.cc (added)
+++ branches/tmp/jdsn/registration/src/RegUtil.cc Fri Jul 4 12:54:24 2008
@@ -0,0 +1,53 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| |
+| (c) SuSE Linux Products GmbH |
+\----------------------------------------------------------------------/
+
+ Additional functions for registration module
+
+/-*/
+
+#define YUILogComponent "reg"
+#include
+#include
+#include
+#include "RegUtil.h"
+
+int runSuseRegister( string &stdout, string &stderr, const string proxy, bool hwinfo, bool optional, bool forceregistration)
+{
+ yuiMilestone() << "SUSE Register Running \"" << (hwinfo ? "with HW":"without HW") << "\"" << endl;
+
+ string suseRegisterCmd = " umask 0022; http_proxy='" + proxy + "' https_proxy='" + proxy + "' ";
+ suseRegisterCmd = suseRegisterCmd + " /usr/bin/suse_register -y -L ~/.suse_register.log ";
+ suseRegisterCmd = suseRegisterCmd + ( hwinfo ? "":" --no-hw-data " );
+ suseRegisterCmd = suseRegisterCmd + ( optional ? "":" --no-optional " );
+ suseRegisterCmd = suseRegisterCmd + ( forceregistration ? " --force-registration ":"" );
+ suseRegisterCmd = suseRegisterCmd + " >/dev/null 2>&1 ";
+
+ yuiMilestone() << "Cmd for suse_register: \"" << suseRegisterCmd << "\"" << endl;
+ int exitcode = system( suseRegisterCmd.c_str() );
+
+ yuiMilestone() << "SUSE Register Exit Code \"" << hex << exitcode << dec <<"\"" << endl;
+
+ return exitcode;
+}
+
+
+
+void runYastBrowser( const string url, const string proxy, bool textmode)
+{
+ string xulCmd = " http_proxy='" + proxy + "' https_proxy='" + proxy + "' ";
+ xulCmd = xulCmd + " MOZ_DISABLE_PANGO=1 /usr/bin/xulrunner /usr/share/YaST2/yastbrowser/application.ini -url ";
+ xulCmd = xulCmd + "'" + url + "'";
+
+ yuiMilestone() << "Starting YaST Browser: \"" << url << "\"" << endl;
+
+ system ( xulCmd.c_str() );
+}
\ No newline at end of file
Added: branches/tmp/jdsn/registration/src/RegUtil.h
URL: http://svn.opensuse.org/viewcvs/yast/branches/tmp/jdsn/registration/src/RegUtil.h?rev=48880&view=auto
==============================================================================
--- branches/tmp/jdsn/registration/src/RegUtil.h (added)
+++ branches/tmp/jdsn/registration/src/RegUtil.h Fri Jul 4 12:54:24 2008
@@ -0,0 +1,42 @@
+/*---------------------------------------------------------------------\
+| |
+| __ __ ____ _____ ____ |
+| \ \ / /_ _/ ___|_ _|___ \ |
+| \ V / _` \___ \ | | __) | |
+| | | (_| |___) || | / __/ |
+| |_|\__,_|____/ |_| |_____| |
+| |
+| |
+| (c) SuSE Linux Products GmbH |
+\----------------------------------------------------------------------/
+
+ Additional functions for registration module
+
+/-*/
+
+#ifndef regutil_h
+#define regutil_h
+
+
+
+/**
+ * Call suse_register script
+ *
+ * Runs the suse_register script with a system call. STDOUT and STDERR will be stored
+ * in the first two call-by-reference pointers. Return value is the exit code.
+ * Three bool variables (hwinfo, optional, forceregistration) control the operation mode of suse_register.
+ * Proxy is supported via the proxy variable.
+ **/
+
+int runSuseRegister( string &stdout, string &stderr, const string proxy = "", bool hwinfo = false, bool optional = false, bool forceregistration = false);
+
+/**
+ * Start the YaST Browser and show the registration page passed via
+ * the url parameter. Proxy is supported via the proxy variable.
+ * Switch to textmode bowser by setting textmode to true.
+ *
+ **/
+
+void runYastBrowser( const string url, const string proxy = "", bool textmode = false );
+
+#endif
--
To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org
For additional commands, e-mail: yast-commit+help@opensuse.org