Maemo: Small improvements to Extras-devel publisher.

This commit is contained in:
Christian Kandeler
2010-11-24 18:35:52 +01:00
parent f3d5fd835e
commit f8e89a92db
6 changed files with 20 additions and 19 deletions

View File

@@ -76,7 +76,7 @@ Qt::ItemFlags MaemoPublishedProjectModel::flags(const QModelIndex &index) const
{ {
if (index.column() != IncludeColumn) if (index.column() != IncludeColumn)
return QFileSystemModel::flags(index); return QFileSystemModel::flags(index);
return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable | Qt::ItemIsSelectable; return Qt::ItemIsEnabled | Qt::ItemIsUserCheckable;
} }
QVariant MaemoPublishedProjectModel::data(const QModelIndex &index, QVariant MaemoPublishedProjectModel::data(const QModelIndex &index,

View File

@@ -41,7 +41,6 @@
#ifndef MAEMOPUBLISHEDPROJECTMODEL_H #ifndef MAEMOPUBLISHEDPROJECTMODEL_H
#define MAEMOPUBLISHEDPROJECTMODEL_H #define MAEMOPUBLISHEDPROJECTMODEL_H
#include <QtCore/QPersistentModelIndex>
#include <QtCore/QSet> #include <QtCore/QSet>
#include <QtCore/QStringList> #include <QtCore/QStringList>
#include <QtGui/QFileSystemModel> #include <QtGui/QFileSystemModel>
@@ -67,7 +66,6 @@ private:
virtual Qt::ItemFlags flags(const QModelIndex &index) const; virtual Qt::ItemFlags flags(const QModelIndex &index) const;
QSet<QString> m_filesToExclude; QSet<QString> m_filesToExclude;
QPersistentModelIndex m_rootIndex;
}; };
} // namespace Internal } // namespace Internal

View File

@@ -210,6 +210,7 @@ bool MaemoPublisherFremantleFree::copyRecursively(const QString &srcFilePath,
QDir::toNativeSeparators(tgtFilePath))); QDir::toNativeSeparators(tgtFilePath)));
return false; return false;
} }
QCoreApplication::processEvents();
if (tgtFilePath == m_tmpProjectDir + QLatin1String("/debian/rules")) { if (tgtFilePath == m_tmpProjectDir + QLatin1String("/debian/rules")) {
QFile rulesFile(tgtFilePath); QFile rulesFile(tgtFilePath);
@@ -520,6 +521,9 @@ void MaemoPublisherFremantleFree::setState(State newState)
case StartingScp: case StartingScp:
case PreparingToUploadFile: case PreparingToUploadFile:
case UploadingFile: case UploadingFile:
// TODO: Can we ensure the remote scp exits, e.g. by sending
// an illegal sequence of bytes? (Probably not, if
// we are currently uploading a file.)
disconnect(m_uploader.data(), 0, this, 0); disconnect(m_uploader.data(), 0, this, 0);
m_uploader = SshRemoteProcessRunner::Ptr(); m_uploader = SshRemoteProcessRunner::Ptr();
break; break;

View File

@@ -33,13 +33,13 @@
namespace Qt4ProjectManager { namespace Qt4ProjectManager {
namespace Internal { namespace Internal {
typedef MaemoPublisherFremantleFree MPSFF; typedef MaemoPublisherFremantleFree MPFF;
MaemoPublishingResultPageFremantleFree::MaemoPublishingResultPageFremantleFree(MPSFF *publisher, MaemoPublishingResultPageFremantleFree::MaemoPublishingResultPageFremantleFree(MPFF *publisher,
QWidget *parent) : QWizardPage(parent), m_publisher(publisher), QWidget *parent) : QWizardPage(parent), m_publisher(publisher),
ui(new Ui::MaemoPublishingResultPageFremantleFree) ui(new Ui::MaemoPublishingResultPageFremantleFree)
{ {
m_lastOutputType = MPSFF::StatusOutput; m_lastOutputType = MPFF::StatusOutput;
ui->setupUi(this); ui->setupUi(this);
} }
@@ -61,27 +61,27 @@ void MaemoPublishingResultPageFremantleFree::initializePage()
void MaemoPublishingResultPageFremantleFree::handleFinished() void MaemoPublishingResultPageFremantleFree::handleFinished()
{ {
handleProgress(m_publisher->resultString(), MPSFF::StatusOutput); handleProgress(m_publisher->resultString(), MPFF::StatusOutput);
m_isComplete = true; m_isComplete = true;
cancelButton()->setEnabled(false); cancelButton()->setEnabled(false);
emit completeChanged(); emit completeChanged();
} }
void MaemoPublishingResultPageFremantleFree::handleProgress(const QString &text, void MaemoPublishingResultPageFremantleFree::handleProgress(const QString &text,
MPSFF::OutputType type) MPFF::OutputType type)
{ {
const QString color = QLatin1String(type == MPSFF::StatusOutput const QString color = QLatin1String(type == MPFF::StatusOutput
|| type == MPSFF::ToolStatusOutput ? "blue" : "red"); || type == MPFF::ToolStatusOutput ? "blue" : "red");
ui->progressTextEdit->setTextColor(QColor(color)); ui->progressTextEdit->setTextColor(QColor(color));
const bool bold = type == MPSFF::StatusOutput const bool bold = type == MPFF::StatusOutput
|| type == MPSFF::ErrorOutput ? true : false; || type == MPFF::ErrorOutput ? true : false;
QFont font = ui->progressTextEdit->currentFont(); QFont font = ui->progressTextEdit->currentFont();
font.setBold(bold); font.setBold(bold);
ui->progressTextEdit->setCurrentFont(font); ui->progressTextEdit->setCurrentFont(font);
if (type == MPSFF::StatusOutput || type == MPSFF::ErrorOutput if (type == MPFF::StatusOutput || type == MPFF::ErrorOutput
|| m_lastOutputType == MPSFF::StatusOutput || m_lastOutputType == MPFF::StatusOutput
|| m_lastOutputType == MPSFF::ErrorOutput) { || m_lastOutputType == MPFF::ErrorOutput) {
ui->progressTextEdit->append(text); ui->progressTextEdit->append(text);
} else { } else {
ui->progressTextEdit->insertPlainText(text); ui->progressTextEdit->insertPlainText(text);
@@ -92,7 +92,6 @@ void MaemoPublishingResultPageFremantleFree::handleProgress(const QString &text,
void MaemoPublishingResultPageFremantleFree::handleCancelRequest() void MaemoPublishingResultPageFremantleFree::handleCancelRequest()
{ {
qDebug("Calling cancel()");
cancelButton()->setEnabled(false); cancelButton()->setEnabled(false);
m_publisher->cancel(); m_publisher->cancel();
} }

View File

@@ -57,8 +57,8 @@ QString MaemoPublishingWizardFactoryFremantleFree::description() const
"it to a build server, where the project will be compiled and " "it to a build server, where the project will be compiled and "
"packaged and then moved to the \"Extras-devel free\" " "packaged and then moved to the \"Extras-devel free\" "
"repository, from where users can install it onto their N900 " "repository, from where users can install it onto their N900 "
"devices. For the upload part, an account at garage.maemo.org " "devices. For the upload functionality, an account at "
"is required."); "garage.maemo.org is required.");
} }
bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *project) const bool MaemoPublishingWizardFactoryFremantleFree::canCreateWizard(const Project *project) const

View File

@@ -61,7 +61,7 @@ MaemoPublishingWizardFremantleFree::MaemoPublishingWizardFremantleFree(const Pro
{ {
setOption(NoCancelButton, false); setOption(NoCancelButton, false);
const QString titleText const QString titleText
= tr("Publishing to Fremantle's \"Extras-devel/free\" Repository"); = tr("Publishing to Fremantle's \"Extras-devel free\" Repository");
m_buildSettingsPage m_buildSettingsPage
= new MaemoPublishingBuildSettingsPageFremantleFree(project, m_publisher); = new MaemoPublishingBuildSettingsPageFremantleFree(project, m_publisher);
m_buildSettingsPage->setTitle(titleText); m_buildSettingsPage->setTitle(titleText);