wizard.cxx (19720aa2) wizard.cxx (281431db)
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 102 unchanged lines hidden (view full) ---

111 {
112 String aMgrName = String::CreateFromAscii( "dkt" );
113 FirstStartWizard::pResMgr = ResMgr::CreateResMgr( OUStringToOString( aMgrName, RTL_TEXTENCODING_UTF8 ));
114 }
115 return FirstStartWizard::pResMgr;
116}
117
118FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAcceptance, const rtl::OUString &rLicensePath )
1/**************************************************************
2 *
3 * Licensed to the Apache Software Foundation (ASF) under one
4 * or more contributor license agreements. See the NOTICE file
5 * distributed with this work for additional information
6 * regarding copyright ownership. The ASF licenses this file
7 * to you under the Apache License, Version 2.0 (the
8 * "License"); you may not use this file except in compliance

--- 102 unchanged lines hidden (view full) ---

111 {
112 String aMgrName = String::CreateFromAscii( "dkt" );
113 FirstStartWizard::pResMgr = ResMgr::CreateResMgr( OUStringToOString( aMgrName, RTL_TEXTENCODING_UTF8 ));
114 }
115 return FirstStartWizard::pResMgr;
116}
117
118FirstStartWizard::FirstStartWizard( Window* pParent, sal_Bool bLicenseNeedsAcceptance, const rtl::OUString &rLicensePath )
119 :RoadmapWizard( pParent, WizardResId(DLG_FIRSTSTART_WIZARD),
120 WZB_NEXT|WZB_PREVIOUS|WZB_FINISH|WZB_CANCEL|WZB_HELP)
119 :RoadmapWizard( pParent,
120 WizardResId(DLG_FIRSTSTART_WIZARD),
121 WZB_NEXT|WZB_PREVIOUS|WZB_FINISH|WZB_CANCEL|WZB_HELP)
121 ,m_bOverride(sal_False)
122 ,m_bOverride(sal_False)
123 , m_lastState( STATE_WELCOME )
122 ,m_aDefaultPath(0)
123 ,m_aMigrationPath(0)
124 ,m_bDone(sal_False)
125 ,m_bLicenseNeedsAcceptance( bLicenseNeedsAcceptance )
126 ,m_bLicenseWasAccepted(sal_False)
127 ,m_bAutomaticUpdChk(sal_True)
128 ,m_aThrobber(this, WizardResId(CTRL_THROBBER))
129 ,m_aLicensePath( rLicensePath )
130{
131 FreeResource();
124 ,m_aDefaultPath(0)
125 ,m_aMigrationPath(0)
126 ,m_bDone(sal_False)
127 ,m_bLicenseNeedsAcceptance( bLicenseNeedsAcceptance )
128 ,m_bLicenseWasAccepted(sal_False)
129 ,m_bAutomaticUpdChk(sal_True)
130 ,m_aThrobber(this, WizardResId(CTRL_THROBBER))
131 ,m_aLicensePath( rLicensePath )
132{
133 FreeResource();
132 // ---
133// enableState(STATE_USER, sal_False);
134// enableState(STATE_REGISTRATION, sal_False);
135
136 Size aTPSize(TP_WIDTH, TP_HEIGHT);
137 SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT));
138
139 //set help id
140 m_pPrevPage->SetHelpId(HID_FIRSTSTART_PREV);
141 m_pNextPage->SetHelpId(HID_FIRSTSTART_NEXT);
142 m_pCancel->SetHelpId(HID_FIRSTSTART_CANCEL);
143 m_pFinish->SetHelpId(HID_FIRSTSTART_FINISH);
134
135 Size aTPSize(TP_WIDTH, TP_HEIGHT);
136 SetPageSizePixel(LogicToPixel(aTPSize, MAP_APPFONT));
137
138 //set help id
139 m_pPrevPage->SetHelpId(HID_FIRSTSTART_PREV);
140 m_pNextPage->SetHelpId(HID_FIRSTSTART_NEXT);
141 m_pCancel->SetHelpId(HID_FIRSTSTART_CANCEL);
142 m_pFinish->SetHelpId(HID_FIRSTSTART_FINISH);
144 // m_pHelp->SetUniqueId(UID_FIRSTSTART_HELP);
145 m_pHelp->Hide();
146 m_pHelp->Disable();
147
148 // save button lables
149 m_sNext = m_pNextPage->GetText();
150 m_sCancel = m_pCancel->GetText();
151
152 // save cancel click handler

--- 15 unchanged lines hidden (view full) ---

168{
169 enableButtons(0xff, sal_False);
170}
171
172::svt::RoadmapWizardTypes::PathId FirstStartWizard::defineWizardPagesDependingFromContext()
173{
174 ::svt::RoadmapWizardTypes::PathId aDefaultPath = 0;
175
143 m_pHelp->Hide();
144 m_pHelp->Disable();
145
146 // save button lables
147 m_sNext = m_pNextPage->GetText();
148 m_sCancel = m_pCancel->GetText();
149
150 // save cancel click handler

--- 15 unchanged lines hidden (view full) ---

166{
167 enableButtons(0xff, sal_False);
168}
169
170::svt::RoadmapWizardTypes::PathId FirstStartWizard::defineWizardPagesDependingFromContext()
171{
172 ::svt::RoadmapWizardTypes::PathId aDefaultPath = 0;
173
176 sal_Bool bPage_Welcome = sal_True;
177 sal_Bool bPage_Migration = sal_True;
174 sal_Bool bPage_Migration = sal_True;
178 sal_Bool bPage_User = sal_True;
179 sal_Bool bPage_UpdateCheck = sal_True;
180
181 bPage_Migration = Migration::checkMigration();
182 bPage_UpdateCheck = showOnlineUpdatePage();
183
184 WizardPath aPath;
175 sal_Bool bPage_UpdateCheck = sal_True;
176
177 bPage_Migration = Migration::checkMigration();
178 bPage_UpdateCheck = showOnlineUpdatePage();
179
180 WizardPath aPath;
185 if (bPage_Welcome)
186 aPath.push_back(STATE_WELCOME);
181 aPath.push_back(STATE_WELCOME);
187 if (bPage_Migration)
182 if (bPage_Migration)
183 {
188 aPath.push_back(STATE_MIGRATION);
184 aPath.push_back(STATE_MIGRATION);
189 if (bPage_User)
190 aPath.push_back(STATE_USER);
185 }
186 aPath.push_back(STATE_USER);
187 m_lastState = STATE_USER;
191 if (bPage_UpdateCheck)
188 if (bPage_UpdateCheck)
189 {
192 aPath.push_back(STATE_UPDATE_CHECK);
190 aPath.push_back(STATE_UPDATE_CHECK);
191 m_lastState = STATE_UPDATE_CHECK;
192 }
193
194 declarePath(aDefaultPath, aPath);
195
196 // a) If license must be accepted by the user, all direct links
197 // to wizard tab pages must be disabled. Because such pages
198 // should be accessible only in case license was accepted !
199 // b) But if no license should be shown at all ...
200 // such direct links can be enabled by default.
201 sal_Bool bAllowDirectLink = true;
202
193
194 declarePath(aDefaultPath, aPath);
195
196 // a) If license must be accepted by the user, all direct links
197 // to wizard tab pages must be disabled. Because such pages
198 // should be accessible only in case license was accepted !
199 // b) But if no license should be shown at all ...
200 // such direct links can be enabled by default.
201 sal_Bool bAllowDirectLink = true;
202
203 if (bPage_User)
204 enableState(STATE_USER, bAllowDirectLink);
205 if (bPage_UpdateCheck)
206 enableState(STATE_UPDATE_CHECK, bAllowDirectLink);
203 enableState(STATE_USER, bAllowDirectLink);
207 if (bPage_Migration)
208 enableState(STATE_MIGRATION, bAllowDirectLink);
204 if (bPage_Migration)
205 enableState(STATE_MIGRATION, bAllowDirectLink);
206 if (bPage_UpdateCheck)
207 enableState(STATE_UPDATE_CHECK, bAllowDirectLink);
209
210 return aDefaultPath;
211}
212
213// catch F1 and disable help
214long FirstStartWizard::PreNotify( NotifyEvent& rNEvt )
215{
216 if( rNEvt.GetType() == EVENT_KEYINPUT )

--- 30 unchanged lines hidden (view full) ---

247 break;
248 case STATE_LICENSE:
249 m_pCancel->SetText(String(WizardResId(STR_LICENSE_DECLINE)));
250 m_pNextPage->SetText(String(WizardResId(STR_LICENSE_ACCEPT)));
251 enableButtons(WZB_NEXT, sal_False);
252 // attach warning dialog to cancel/decline button
253 m_pCancel->SetClickHdl( LINK(this, FirstStartWizard, DeclineHdl) );
254 break;
208
209 return aDefaultPath;
210}
211
212// catch F1 and disable help
213long FirstStartWizard::PreNotify( NotifyEvent& rNEvt )
214{
215 if( rNEvt.GetType() == EVENT_KEYINPUT )

--- 30 unchanged lines hidden (view full) ---

246 break;
247 case STATE_LICENSE:
248 m_pCancel->SetText(String(WizardResId(STR_LICENSE_DECLINE)));
249 m_pNextPage->SetText(String(WizardResId(STR_LICENSE_ACCEPT)));
250 enableButtons(WZB_NEXT, sal_False);
251 // attach warning dialog to cancel/decline button
252 m_pCancel->SetClickHdl( LINK(this, FirstStartWizard, DeclineHdl) );
253 break;
255 case STATE_REGISTRATION:
254 }
255 if ( _nState == m_lastState )
256 {
256 enableButtons(WZB_NEXT, sal_False);
257 enableButtons(WZB_FINISH, sal_True);
258 defaultButton(WZB_FINISH);
257 enableButtons(WZB_NEXT, sal_False);
258 enableButtons(WZB_FINISH, sal_True);
259 defaultButton(WZB_FINISH);
259 break;
260 }
260 }
261
262 // focus
263
264}
265
266IMPL_LINK( FirstStartWizard, DeclineHdl, PushButton *, EMPTYARG )
267{
268 QueryBox aBox(this, WizardResId(QB_ASK_DECLINE));
269 sal_Int32 ret = aBox.Execute();
270 if ( ret == BUTTON_OK || ret == BUTTON_YES)
271 {

--- 259 unchanged lines hidden ---
261}
262
263IMPL_LINK( FirstStartWizard, DeclineHdl, PushButton *, EMPTYARG )
264{
265 QueryBox aBox(this, WizardResId(QB_ASK_DECLINE));
266 sal_Int32 ret = aBox.Execute();
267 if ( ret == BUTTON_OK || ret == BUTTON_YES)
268 {

--- 259 unchanged lines hidden ---