Ticket #5677: schemawiz.patch
File schemawiz.patch, 3.1 KB (added by , 16 years ago) |
---|
-
libs/libmyth/schemawizard.cpp
1 1 #include <unistd.h> // for isatty() on Windows 2 2 3 #include "dialogbox.h"4 3 #include "langsettings.h" 5 4 #include "mythcontext.h" 6 5 #include "schemawizard.h" 7 6 #include "util.h" 8 7 9 8 #include "libmythdb/mythtimer.h" 9 #include "libmythui/mythdialogbox.h" 10 10 #include "libmythui/mythmainwindow.h" 11 #include "libmythui/myththemebase.h" 11 12 #include "libmythui/mythuihelper.h" 12 13 13 14 14 15 static SchemaUpgradeWizard * c_wizard = 0; 15 16 17 static MythThemeBase * themeBase = 0; 16 18 17 19 SchemaUpgradeWizard::SchemaUpgradeWizard(const QString &DBSchemaSetting, 18 20 const QString &upgradeSchemaVal) … … 328 330 329 331 if (gui) 330 332 { 331 DialogBox* dlg;333 MythDialogBox * dlg; 332 334 MythScreenStack * pop; 333 335 MythMainWindow * win = gContext->GetMainWindow(); 334 336 … … 336 338 win = TempMainWindow(true); 337 339 338 340 pop = win->GetStack("popup stack"); 341 if (!pop) 342 pop = win->GetMainStack(); 343 if (!pop) 344 return MYTH_SCHEMA_ERROR; 339 345 340 dlg = new DialogBox(win, message); 346 347 348 dlg = new MythDialogBox(message, pop, "schema prompt"); 349 if (!dlg->Create()) 350 return MYTH_SCHEMA_ERROR; 351 352 pop->AddScreen(dlg); 341 353 dlg->AddButton(QObject::tr("Exit")); 342 354 343 355 if (returnValue == MYTH_SCHEMA_ERROR) … … 349 361 if (m_expertMode) 350 362 dlg->AddButton(QObject::tr("Use current schema")); 351 363 352 DialogCode selected = dlg->exec(); 364 DialogCode selected = (DialogCode)(int)dlg->exec(); 365 printf("Got exec() = %d\n", selected); 353 366 354 367 // The annoying extra confirmation: 355 368 if (kDialogCodeButton1 == selected || … … 376 389 if (connections) 377 390 message += "\n\n" + warnOtherCl; 378 391 379 DialogBox *dlg2 = new DialogBox(win, message); 392 MythDialogBox *dlg2 = new MythDialogBox(message, pop, 393 "schema extra popup"); 394 if (!dlg2->Create()) 395 return MYTH_SCHEMA_ERROR; 396 pop->AddScreen(dlg2); 380 397 381 398 dlg2->AddButton(QObject::tr("Exit")); 382 399 if (upgradable) … … 384 401 if (m_expertMode) 385 402 dlg2->AddButton(QObject::tr("Use current schema")); 386 403 387 selected = dlg2->exec();404 selected = (DialogCode)(int)dlg->exec(); 388 405 389 406 dlg2->deleteLater(); 390 407 } … … 471 488 472 489 win->Init(); 473 490 gContext->SetMainWindow(win); 491 492 themeBase = new MythThemeBase(); 493 474 494 m_createdTempWindow = true; 475 495 476 496 LanguageSettings::prompt(); … … 481 501 482 502 void SchemaUpgradeWizard::EndTempWindow(void) 483 503 { 504 delete themeBase; 484 505 gContext->SetMainWindow(NULL); 485 506 DestroyMythMainWindow(); 486 507 m_createdTempWindow = false;