[Scummvm-cvs-logs] SF.net SVN: scummvm:[48917] tools/trunk/gui

criezy at users.sourceforge.net criezy at users.sourceforge.net
Mon May 3 18:56:17 CEST 2010


Revision: 48917
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48917&view=rev
Author:   criezy
Date:     2010-05-03 16:56:16 +0000 (Mon, 03 May 2010)

Log Message:
-----------
Implement several enhancements in the tools GUI:
1) On the last page, add the possibility to restart the wizard instead of closing the application.
2) In the process page, when the tool has finished running the "processing data..." text is now erased. Also green success message or red error message is now printed below the process output.
3) The Cancel button is now disabled in the last page (since there is nothing to cancel).

Modified Paths:
--------------
    tools/trunk/gui/main.cpp
    tools/trunk/gui/main.h
    tools/trunk/gui/pages.cpp
    tools/trunk/gui/pages.h

Modified: tools/trunk/gui/main.cpp
===================================================================
--- tools/trunk/gui/main.cpp	2010-05-03 16:50:47 UTC (rev 48916)
+++ tools/trunk/gui/main.cpp	2010-05-03 16:56:16 UTC (rev 48917)
@@ -460,6 +460,10 @@
 	_prev->Enable(enable);
 }
 
+void WizardButtons::enableCancel(bool enable) {
+	_cancel->Enable(enable);
+}
+
 void WizardButtons::showFinish(bool show) {
 	if (show)
 		_next->SetLabel(wxT("Finish!"));

Modified: tools/trunk/gui/main.h
===================================================================
--- tools/trunk/gui/main.h	2010-05-03 16:50:47 UTC (rev 48916)
+++ tools/trunk/gui/main.h	2010-05-03 16:56:16 UTC (rev 48917)
@@ -170,6 +170,10 @@
 	 */
 	void enablePrevious(bool enable);
 
+	/**
+	 * Enables the cancel button.
+	 */
+	void enableCancel(bool enable);
 
 	/**
 	 * Display the previous/next button.

Modified: tools/trunk/gui/pages.cpp
===================================================================
--- tools/trunk/gui/pages.cpp	2010-05-03 16:50:47 UTC (rev 48916)
+++ tools/trunk/gui/pages.cpp	2010-05-03 16:56:16 UTC (rev 48917)
@@ -192,6 +192,7 @@
 	buttons->setLineLabel(wxT("ScummVM Tools"));
 
 	buttons->showNavigation(false);
+	buttons->enableCancel(true);
 
 	WizardPage::updateButtons(panel, buttons);
 }
@@ -1268,7 +1269,8 @@
 
 	sizer->AddSpacer(15);
 
-	sizer->Add(new wxStaticText(panel, wxID_ANY, wxT("Processing data...")), wxSizerFlags().Expand().Border(wxLEFT, 20));
+	_processingText = new wxStaticText(panel, wxID_ANY, wxT("Processing data..."));
+	sizer->Add(_processingText, wxSizerFlags().Expand().Border(wxLEFT, 20));
 
 	_outwin = new wxTextCtrl(panel, wxID_ANY, wxT(""), wxDefaultPosition, wxDefaultSize,
 		wxTE_MULTILINE | wxTE_READONLY, wxDefaultValidator, wxT("OutputWindow"));
@@ -1277,6 +1279,9 @@
 	_gauge = new wxGauge(panel, wxID_ANY, _output.total, wxDefaultPosition, wxDefaultSize,
 		wxGA_HORIZONTAL, wxDefaultValidator, wxT("ProgressBar"));
 	sizer->Add(_gauge, wxSizerFlags(0).Expand().Border(wxBOTTOM | wxLEFT | wxRIGHT, 10));
+	
+	_finishText = new wxStaticText(panel, wxID_ANY, wxString());
+	sizer->Add(_finishText, wxSizerFlags().Expand().Border(wxLEFT, 20));
 
 	panel->SetSizer(sizer);
 
@@ -1365,6 +1370,14 @@
 		// Update UI
 		if (_topframe)
 			updateButtons(panel, _topframe->_buttons);
+		_processingText->SetLabel(wxString());
+		if (_success) {
+			_finishText->SetOwnForegroundColour(wxColour(0, 200, 0));
+			_finishText->SetLabel(wxT("Tool completed successfully"));
+		} else {
+			_finishText->SetOwnForegroundColour(wxColour(200, 0, 0));
+			_finishText->SetLabel(wxT("Tool ended with errors"));
+		}
 		return false;
 	}
 
@@ -1514,6 +1527,11 @@
 	displayOut->SetValue(true);
 	sizer->Add(displayOut);
 
+	wxCheckBox *processOther = new wxCheckBox(panel, wxID_ANY, wxT("Process another file"), wxDefaultPosition, wxDefaultSize,
+		0, wxDefaultValidator, wxT("ProcessOther"));
+	processOther->SetValue(false);
+	sizer->Add(processOther);
+
 	SetAlignedSizer(panel, sizer);
 
 	return panel;
@@ -1531,7 +1549,12 @@
 #else
 #endif
 	}
-	_topframe->Close(true);
+
+	wxCheckBox *restart = static_cast<wxCheckBox *>(panel->FindWindowByName(wxT("ProcessOther")));
+	if (restart->GetValue())
+		switchPage(new IntroPage(_configuration));
+	else
+		_topframe->Close(true);
 }
 
 wxString FinishPage::getHelp() {
@@ -1541,6 +1564,7 @@
 void FinishPage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
 	buttons->enablePrevious(false);
 	buttons->showFinish(true);
+	buttons->enableCancel(false);
 
 	WizardPage::updateButtons(panel, buttons);
 }
@@ -1564,18 +1588,28 @@
 		wxT("The execution of the tool failed. You can try running the wizard again and ensure that the file paths are accurate.")),
 		wxSizerFlags(1).Expand());
 
+	wxCheckBox *processOther = new wxCheckBox(panel, wxID_ANY, wxT("Restart the wizard"), wxDefaultPosition, wxDefaultSize,
+		0, wxDefaultValidator, wxT("ProcessOther"));
+	processOther->SetValue(false);
+	sizer->Add(processOther);
+
 	SetAlignedSizer(panel, sizer);
 
 	return panel;
 }
 
 void FailurePage::onNext(wxWindow *panel) {
-	_topframe->Close(true);
+	wxCheckBox *restart = static_cast<wxCheckBox *>(panel->FindWindowByName(wxT("ProcessOther")));
+	if (restart->GetValue())
+		switchPage(new IntroPage(_configuration));
+	else
+		_topframe->Close(true);
 }
 
 void FailurePage::updateButtons(wxWindow *panel, WizardButtons *buttons) {
 	buttons->enablePrevious(false);
 	buttons->showFinish(true);
+	buttons->enableCancel(false);
 
 	WizardPage::updateButtons(panel, buttons);
 }

Modified: tools/trunk/gui/pages.h
===================================================================
--- tools/trunk/gui/pages.h	2010-05-03 16:50:47 UTC (rev 48916)
+++ tools/trunk/gui/pages.h	2010-05-03 16:56:16 UTC (rev 48917)
@@ -448,6 +448,9 @@
 	wxTextCtrl *_outwin;
 	/** Gauge showing progress */
 	wxGauge *_gauge;
+	/** Labels */
+	wxStaticText *_processingText;
+	wxStaticText *_finishText;
 	/** The thread which the tool is run in */
 	ProcessToolThread *_thread;
 	/** The structure to exchange output between thread & gui */


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list