Commit 16eefb3a authored by Pawel Polanski's avatar Pawel Polanski Committed by Daniel Teske

Publis to Ovi: Implementing PublishStep with wipe function

Make Publish to Ovi no so "hardcoded"
and base it upon custom steps.

Now the code is recleaned and rebuild after
freeze

Change-Id: I555136d58f728d563eb7dabcb48f314ce4a19003
Reviewed-on: http://codereview.qt.nokia.com/92Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 32b45799
......@@ -52,6 +52,7 @@ class Qt4BuildConfiguration;
class Qt4Project;
namespace Internal {
class Qt4SymbianTarget;
class S60PublishStep;
namespace Constants {
const char * const REJECTED_VENDOR_NAMES_VENDOR = "Vendor";
......@@ -144,25 +145,21 @@ signals:
void finished();
public slots:
void runClean();
void runQMake(int result);
void runBuild(int result);
void runCreateSis(int result);
void endBuild(int result);
void publishStepFinished(bool succeeded);
void printMessage(QString message, bool error);
private:
void runStep(int result, const QString& buildStep, const QString& command, QProcess* currProc, QProcess* prevProc);
bool nextStep();
bool runStep();
bool sisExists(QString &sisFile);
private:
QColor m_errorColor;
QColor m_commandColor;
QColor m_okColor;
QColor m_normalColor;
QProcess* m_cleanProc;
QProcess* m_qmakeProc;
QProcess* m_buildProc;
QProcess* m_createSisProc;
Qt4BuildConfiguration * m_qt4bc;
const Qt4SymbianTarget * m_activeTargetOfProject;
Qt4Project * m_qt4project;
......@@ -176,9 +173,59 @@ private:
QString m_appUid;
QString m_displayName;
QList<S60PublishStep *> m_publishSteps;
bool m_finishedAndSuccessful;
};
class S60PublishStep : public QObject
{
Q_OBJECT
public:
explicit S60PublishStep(bool mandatory, QObject *parent = 0);
virtual void start() = 0;
virtual QString displayDescription() const = 0;
bool succeeded() const;
bool mandatory() const;
signals:
void finished(bool succeeded);
void output(QString output, bool error);
protected:
void setSucceeded(bool succeeded);
private:
bool m_succeeded;
bool m_mandatory;
};
class S60CommandPublishStep : public S60PublishStep
{
Q_OBJECT
public:
explicit S60CommandPublishStep(const Qt4BuildConfiguration& bc,
const QString &command,
const QString &name,
bool mandatory = true,
QObject *parent = 0);
virtual void start();
virtual QString displayDescription() const;
private slots:
void processFinished(int exitCode);
private:
QProcess* m_proc;
const QString m_command;
const QString m_name;
};
} // namespace Internal
} // namespace Qt4ProjectManager
......
......@@ -35,6 +35,7 @@
#include <QtGui/QDesktopServices>
#include <QtGui/QAbstractButton>
#include <QtGui/QScrollBar>
#include <QtCore/QProcess>
namespace Qt4ProjectManager {
......@@ -75,11 +76,30 @@ void S60PublishingResultsPageOvi::packageCreationFinished()
void S60PublishingResultsPageOvi::updateResultsPage(const QString& status, QColor c)
{
const bool atBottom = isScrollbarAtBottom();
QTextCursor cur(ui->resultsTextBrowser->document());
QTextCharFormat tcf = cur.charFormat();
tcf.setForeground(c);
cur.movePosition(QTextCursor::End);
cur.insertText(status, tcf);
if (atBottom)
scrollToBottom();
}
bool S60PublishingResultsPageOvi::isScrollbarAtBottom() const
{
QScrollBar *scrollBar = ui->resultsTextBrowser->verticalScrollBar();
return scrollBar->value() == scrollBar->maximum();
}
void S60PublishingResultsPageOvi::scrollToBottom()
{
QScrollBar *scrollBar = ui->resultsTextBrowser->verticalScrollBar();
scrollBar->setValue(scrollBar->maximum());
// QPlainTextEdit destroys the first calls value in case of multiline
// text, so make sure that the scroll bar actually gets the value set.
// Is a noop if the first call succeeded.
scrollBar->setValue(scrollBar->maximum());
}
void S60PublishingResultsPageOvi::openFileLocation()
......
......@@ -53,13 +53,15 @@ public:
virtual void initializePage();
virtual bool isComplete() const;
signals:
public slots:
void updateResultsPage(const QString &status, QColor c);
void openFileLocation();
void packageCreationFinished();
private:
void scrollToBottom();
bool isScrollbarAtBottom() const;
private:
Ui::S60PublishingResultsPageOvi *ui;
S60PublisherOvi * const m_publisher;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment