Simplified status bar handlong
When fossil is running, a progress bar is now displayed and input event processing is disabled FossilOrigin-Name: 6dc326684138f1e61b1ea95ef96c6f421bf3a09d
This commit is contained in:
parent
bc7791de61
commit
cb9fa1a754
@ -15,6 +15,7 @@
|
|||||||
#include <QMimeData>
|
#include <QMimeData>
|
||||||
#include <QFileIconProvider>
|
#include <QFileIconProvider>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
#include <QProgressBar>
|
||||||
#include "CommitDialog.h"
|
#include "CommitDialog.h"
|
||||||
#include "FileActionDialog.h"
|
#include "FileActionDialog.h"
|
||||||
#include "CloneDialog.h"
|
#include "CloneDialog.h"
|
||||||
@ -89,6 +90,26 @@ static QStringMap MakeKeyValues(QStringList lines)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
|
class ScopedStatus
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
ScopedStatus(const QString &text, Ui::MainWindow *mw, QProgressBar *bar) : ui(mw), progressBar(bar)
|
||||||
|
{
|
||||||
|
ui->statusBar->showMessage(text);
|
||||||
|
progressBar->setHidden(false);
|
||||||
|
}
|
||||||
|
|
||||||
|
~ScopedStatus()
|
||||||
|
{
|
||||||
|
ui->statusBar->clearMessage();
|
||||||
|
progressBar->setHidden(true);
|
||||||
|
}
|
||||||
|
private:
|
||||||
|
Ui::MainWindow *ui;
|
||||||
|
QProgressBar *progressBar;
|
||||||
|
};
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////
|
||||||
MainWindow::MainWindow(QWidget *parent, QString *workspacePath, bool portableMode) :
|
MainWindow::MainWindow(QWidget *parent, QString *workspacePath, bool portableMode) :
|
||||||
QMainWindow(parent),
|
QMainWindow(parent),
|
||||||
@ -161,9 +182,15 @@ MainWindow::MainWindow(QWidget *parent, QString *workspacePath, bool portableMod
|
|||||||
ui->menuFile->insertAction(recent_sep, recentWorkspaceActs[i]);
|
ui->menuFile->insertAction(recent_sep, recentWorkspaceActs[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
statusLabel = new QLabel();
|
// Construct ProgressBar
|
||||||
statusLabel->setMinimumSize( statusLabel->sizeHint() );
|
progressBar = new QProgressBar();
|
||||||
ui->statusBar->addWidget( statusLabel, 1 );
|
progressBar->setMinimum(0);
|
||||||
|
progressBar->setMaximum(0);
|
||||||
|
progressBar->setMaximumSize(170, 16);
|
||||||
|
progressBar->setAlignment(Qt::AlignCenter);
|
||||||
|
progressBar->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred);
|
||||||
|
ui->statusBar->insertPermanentWidget(0, progressBar);
|
||||||
|
progressBar->setVisible(false);
|
||||||
|
|
||||||
#ifdef Q_WS_MACX
|
#ifdef Q_WS_MACX
|
||||||
// Native applications on OSX don't use menu icons
|
// Native applications on OSX don't use menu icons
|
||||||
@ -1003,8 +1030,7 @@ void MainWindow::log(const QString &text, bool isHTML)
|
|||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
void MainWindow::setStatus(const QString &text)
|
void MainWindow::setStatus(const QString &text)
|
||||||
{
|
{
|
||||||
Q_ASSERT(statusLabel);
|
ui->statusBar->showMessage(text);
|
||||||
statusLabel->setText(text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//------------------------------------------------------------------------------
|
//------------------------------------------------------------------------------
|
||||||
@ -1068,7 +1094,14 @@ bool MainWindow::runFossilRaw(const QStringList &args, QStringList *output, int
|
|||||||
{
|
{
|
||||||
return QProcess::startDetached(fossil, args, wkdir);
|
return QProcess::startDetached(fossil, args, wkdir);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make StatusBar message
|
||||||
|
QString status_msg = tr("Running Fossil");
|
||||||
|
if(args.length() > 0)
|
||||||
|
status_msg = QString("Fossil %0").arg(args[0].toCaseFolded());
|
||||||
|
ScopedStatus status(status_msg, ui, progressBar);
|
||||||
|
|
||||||
|
// Create fossil process
|
||||||
QProcess process(this);
|
QProcess process(this);
|
||||||
process.setProcessChannelMode(QProcess::MergedChannels);
|
process.setProcessChannelMode(QProcess::MergedChannels);
|
||||||
process.setWorkingDirectory(wkdir);
|
process.setWorkingDirectory(wkdir);
|
||||||
@ -1116,7 +1149,7 @@ bool MainWindow::runFossilRaw(const QStringList &args, QStringList *output, int
|
|||||||
|
|
||||||
buffer += input;
|
buffer += input;
|
||||||
|
|
||||||
QCoreApplication::processEvents();
|
QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents);
|
||||||
|
|
||||||
if(buffer.isEmpty())
|
if(buffer.isEmpty())
|
||||||
continue;
|
continue;
|
||||||
|
@ -244,7 +244,7 @@ private:
|
|||||||
QProcess fossilUI;
|
QProcess fossilUI;
|
||||||
QString fossilUIPort;
|
QString fossilUIPort;
|
||||||
class QAction *recentWorkspaceActs[MAX_RECENT];
|
class QAction *recentWorkspaceActs[MAX_RECENT];
|
||||||
class QLabel *statusLabel;
|
class QProgressBar *progressBar;
|
||||||
bool fossilAbort; // FIXME: No GUI for it yet
|
bool fossilAbort; // FIXME: No GUI for it yet
|
||||||
|
|
||||||
Settings settings;
|
Settings settings;
|
||||||
@ -257,7 +257,7 @@ private:
|
|||||||
|
|
||||||
class QSettings *qsettings;
|
class QSettings *qsettings;
|
||||||
|
|
||||||
// Repo State
|
// Repository State
|
||||||
typedef QList<RepoFile*> filelist_t;
|
typedef QList<RepoFile*> filelist_t;
|
||||||
typedef QMap<QString, RepoFile*> filemap_t;
|
typedef QMap<QString, RepoFile*> filemap_t;
|
||||||
typedef QMap<QString, QString> stashmap_t;
|
typedef QMap<QString, QString> stashmap_t;
|
||||||
|
14
manifest
14
manifest
@ -1,5 +1,5 @@
|
|||||||
C Added\sback\suser32\sand\sshell32\slibs\son\swindows,\sas\sthey\sare\sneeded\sexplicitely\sfor\svc/nmake\sbuilds.\n\n
|
C Simplified\sstatus\sbar\shandlong\nWhen\sfossil\sis\srunning,\sa\sprogress\sbar\sis\snow\sdisplayed\sand\sinput\sevent\sprocessing\sis\sdisabled\n
|
||||||
D 2012-05-09T12:13:12.012
|
D 2012-05-09T14:20:26.209
|
||||||
F CloneDialog.cpp 85bc6473d1e3a47d0f981e96357a376be63ab0bc
|
F CloneDialog.cpp 85bc6473d1e3a47d0f981e96357a376be63ab0bc
|
||||||
F CloneDialog.h 1c63da4346ca20b67d52016b7b64875b9c5b477f
|
F CloneDialog.h 1c63da4346ca20b67d52016b7b64875b9c5b477f
|
||||||
F CloneDialog.ui 0fc820804df91f16506ee466a44519fdd44e468f
|
F CloneDialog.ui 0fc820804df91f16506ee466a44519fdd44e468f
|
||||||
@ -11,8 +11,8 @@ F FileActionDialog.h 15db1650b3a13d70bc338371e4c033c66e3b79ce
|
|||||||
F FileActionDialog.ui c63644428579741aeb5fa052e237ba799ced9ad7
|
F FileActionDialog.ui c63644428579741aeb5fa052e237ba799ced9ad7
|
||||||
F FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
|
F FileTableView.cpp 5ddf8c391c9a3ac449ec61fb1db837b577afeec2
|
||||||
F FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
F FileTableView.h 03e56d87c2d46411b9762b87f4d301619aaf18df
|
||||||
F MainWindow.cpp 9202bea6f5017adc6f5e26b0e122695641658810
|
F MainWindow.cpp c106d92d343817c381634251207b0fd6b85d9dd7
|
||||||
F MainWindow.h 90de1726e0961f73f637c4071d1cb0fe1049007f
|
F MainWindow.h f97ef3776d10211f42651cd2b7c7291d90bac3c1
|
||||||
F MainWindow.ui 5f4e40bfb3e93b00f2e06a6071187998eb617224
|
F MainWindow.ui 5f4e40bfb3e93b00f2e06a6071187998eb617224
|
||||||
F SettingsDialog.cpp 296c77c5704bd8cb77a00d561db072aaaf60c1d6
|
F SettingsDialog.cpp 296c77c5704bd8cb77a00d561db072aaaf60c1d6
|
||||||
F SettingsDialog.h 9592ec491cd44a5bff70ea42853d7e1f053f4040
|
F SettingsDialog.h 9592ec491cd44a5bff70ea42853d7e1f053f4040
|
||||||
@ -179,7 +179,7 @@ F installer/fuel.iss 13b6a938bcdf273cbd3649d2549887baa1577214
|
|||||||
F installer/license.txt 4cc77b90af91e615a64ae04893fdffa7939db84c
|
F installer/license.txt 4cc77b90af91e615a64ae04893fdffa7939db84c
|
||||||
F main.cpp f2913af0af1a5fcbebe93fb53b8a9cf6e7bbf65a
|
F main.cpp f2913af0af1a5fcbebe93fb53b8a9cf6e7bbf65a
|
||||||
F resources.qrc e98383ed205f4e37100c60057e0129c3b86dea53
|
F resources.qrc e98383ed205f4e37100c60057e0129c3b86dea53
|
||||||
P 62c1fa8d4fe11e8584af13b70bea5084ad2bd0fb
|
P 3eb9f233b9f05d6e131a69b3fc25f5f8d5c11491
|
||||||
R c317f4827f98ea41ec812089faead3a8
|
R b9b3e1414a5ceae0afbe31f5cfee9426
|
||||||
U kostas
|
U kostas
|
||||||
Z f7c32317fe2396dc773b386afbf923f3
|
Z b2ff6e9c95bb4648cc5970dfe895a0d4
|
||||||
|
@ -1 +1 @@
|
|||||||
3eb9f233b9f05d6e131a69b3fc25f5f8d5c11491
|
6dc326684138f1e61b1ea95ef96c6f421bf3a09d
|
Loading…
x
Reference in New Issue
Block a user