annotate mainwindow.h @ 289:37f67999b661

We can provide a better interface for most common cases by essentially showing a formatted log for the summary rather than a diff only
author Chris Cannam
date Mon, 21 Feb 2011 12:15:04 +0000
parents ca6edd303c9d
children 7b4f42cfc596
rev   line source
Chris@57 1 /* -*- c-basic-offset: 4 indent-tabs-mode: nil -*- vi:set ts=8 sts=4 sw=4: */
Chris@57 2
Chris@57 3 /*
Chris@57 4 EasyMercurial
Chris@57 5
Chris@98 6 Based on hgExplorer by Jari Korhonen
Chris@57 7 Copyright (c) 2010 Jari Korhonen
Chris@244 8 Copyright (c) 2011 Chris Cannam
Chris@244 9 Copyright (c) 2011 Queen Mary, University of London
Chris@57 10
Chris@57 11 This program is free software; you can redistribute it and/or
Chris@57 12 modify it under the terms of the GNU General Public License as
Chris@57 13 published by the Free Software Foundation; either version 2 of the
Chris@57 14 License, or (at your option) any later version. See the file
Chris@57 15 COPYING included with this distribution for more information.
Chris@57 16 */
jtkorhonen@0 17
jtkorhonen@0 18 #ifndef MAINWINDOW_H
jtkorhonen@0 19 #define MAINWINDOW_H
jtkorhonen@0 20
Chris@96 21 #include "hgtabwidget.h"
jtkorhonen@0 22 #include "hgrunner.h"
jtkorhonen@0 23 #include "common.h"
Chris@106 24 #include "changeset.h"
Chris@109 25 #include "hgaction.h"
jtkorhonen@0 26
Chris@50 27 #include <QMainWindow>
Chris@50 28 #include <QListWidget>
Chris@90 29 #include <QFileSystemWatcher>
Chris@50 30
jtkorhonen@0 31 QT_BEGIN_NAMESPACE
jtkorhonen@0 32 class QAction;
jtkorhonen@0 33 class QMenu;
Chris@238 34 class QTimer;
jtkorhonen@0 35 QT_END_NAMESPACE
jtkorhonen@0 36
jtkorhonen@0 37 class MainWindow : public QMainWindow
jtkorhonen@0 38 {
jtkorhonen@0 39 Q_OBJECT
jtkorhonen@0 40
jtkorhonen@0 41 public:
Chris@172 42 MainWindow(QString myDirPath);
jtkorhonen@0 43
jtkorhonen@0 44 protected:
jtkorhonen@0 45 void closeEvent(QCloseEvent *event);
jtkorhonen@0 46
jtkorhonen@0 47 public slots:
Chris@145 48 void open(QString local);
Chris@120 49 void hgRefresh();
Chris@238 50 void commandStarting(HgAction);
Chris@142 51 void commandCompleted(HgAction action, QString stdOut);
Chris@142 52 void commandFailed(HgAction action, QString stdErr);
Chris@95 53 void enableDisableActions();
jtkorhonen@0 54
jtkorhonen@0 55 private slots:
jtkorhonen@0 56 void about();
Chris@64 57 void settings();
Chris@69 58 void open();
Chris@182 59 void changeRemoteRepo();
Chris@64 60 void startupDialog();
Chris@94 61 void clearSelections();
Chris@199 62 void showAllChanged(bool);
Chris@64 63
Chris@175 64 void hgTest();
Chris@200 65 void hgTestExtension();
Chris@120 66 void hgQueryPaths();
Chris@120 67 void hgStat();
jtkorhonen@0 68 void hgRemove();
jtkorhonen@0 69 void hgAdd();
jtkorhonen@0 70 void hgCommit();
Chris@168 71 void hgShowSummary();
Chris@289 72 void hgShowSummaryFor(Changeset *);
jtkorhonen@0 73 void hgFolderDiff();
Chris@148 74 void hgDiffToCurrent(QString);
Chris@148 75 void hgDiffToParent(QString, QString);
jtkorhonen@0 76 void hgUpdate();
jtkorhonen@0 77 void hgRevert();
jtkorhonen@0 78 void hgMerge();
Chris@163 79 void hgMarkResolved(QStringList);
jtkorhonen@33 80 void hgRetryMerge();
jtkorhonen@0 81 void hgCloneFromRemote();
jtkorhonen@0 82 void hgInit();
jtkorhonen@0 83 void hgIncoming();
jtkorhonen@0 84 void hgPush();
jtkorhonen@0 85 void hgPull();
Chris@148 86 void hgUpdateToRev(QString);
Chris@148 87 void hgMergeFrom(QString);
jtkorhonen@0 88 void hgAnnotate();
jtkorhonen@0 89 void hgResolveList();
Chris@164 90 void hgTag(QString);
jtkorhonen@11 91 void hgServe();
jtkorhonen@34 92 void hgIgnore();
jtkorhonen@0 93
Chris@90 94 void fsDirectoryChanged(QString);
Chris@90 95 void fsFileChanged(QString);
Chris@238 96 void checkFilesystem();
Chris@238 97 void actuallyRestoreFileSystemWatcher();
Chris@90 98
jtkorhonen@0 99 private:
Chris@109 100 void hgQueryBranch();
Chris@109 101 void hgQueryHeads();
Chris@109 102 void hgQueryParents();
jtkorhonen@0 103 void hgLog();
Chris@150 104 void hgLogIncremental(QStringList prune);
jtkorhonen@0 105 void createActions();
jtkorhonen@0 106 void connectActions();
Chris@141 107 void connectTabsSignals();
jtkorhonen@0 108 void createMenus();
jtkorhonen@0 109 void createToolBars();
Chris@230 110 void updateToolBarStyle();
jtkorhonen@0 111 void createStatusBar();
jtkorhonen@0 112 void readSettings();
jtkorhonen@0 113 void splitChangeSets(QStringList *list, QString hgLogOutput);
Chris@174 114 void reportNewRemoteHeads(QString);
jtkorhonen@2 115 void presentLongStdoutToUser(QString stdo);
Chris@284 116 void writeSettings();
Chris@95 117
Chris@182 118 QStringList listAllUpIpV4Addresses();
jtkorhonen@34 119 QString filterTag(QString tag);
jtkorhonen@0 120
Chris@64 121 QString getUserInfo() const;
Chris@64 122
Chris@79 123 bool openLocal(QString);
Chris@79 124 bool openRemote(QString, QString);
Chris@79 125 bool openInit(QString);
Chris@79 126
Chris@79 127 bool complainAboutFilePath(QString);
Chris@79 128 bool complainAboutUnknownFolder(QString);
Chris@84 129 bool complainAboutInitInRepo(QString);
Chris@84 130 bool complainAboutInitFile(QString);
Chris@84 131 bool complainAboutCloneToExisting(QString);
Chris@84 132 bool complainAboutCloneToFile(QString);
Chris@237 133 QString complainAboutCloneToExistingFolder(QString local, QString remote); // returns new location, or empty string for cancel
Chris@84 134
Chris@248 135 bool askAboutUnknownFolder(QString);
Chris@79 136 bool askToInitExisting(QString);
Chris@79 137 bool askToInitNew(QString);
Chris@79 138 bool askToOpenParentRepo(QString, QString);
Chris@84 139 bool askToOpenInsteadOfInit(QString);
Chris@79 140
Chris@120 141 void showIncoming(QString);
Chris@120 142 void showPullResult(QString);
Chris@120 143 void showPushResult(QString);
Chris@125 144 int extractChangeCount(QString);
Chris@125 145 QString format3(QString, QString, QString);
Chris@120 146
Chris@120 147 void clearState();
Chris@120 148
Chris@90 149 void updateFileSystemWatcher();
Chris@238 150 void suspendFileSystemWatcher();
Chris@238 151 void restoreFileSystemWatcher();
Chris@90 152
Chris@284 153 HgTabWidget *m_hgTabs;
Chris@64 154
Chris@284 155 QString m_remoteRepoPath;
Chris@284 156 QString m_workFolderPath;
Chris@284 157 QString m_currentBranch;
Chris@284 158 Changesets m_currentHeads;
Chris@284 159 Changesets m_currentParents;
Chris@284 160 int m_commitsSincePush;
Chris@284 161 bool m_stateUnknown;
Chris@284 162 bool m_hgIsOK;
Chris@284 163 bool m_needNewLog;
Chris@284 164
Chris@284 165 bool m_firstStart;
Chris@284 166
Chris@284 167 bool m_showAllFiles;
Chris@199 168
jtkorhonen@0 169 //Actions enabled flags
Chris@284 170 bool m_remoteRepoActionsEnabled;
Chris@284 171 bool m_localRepoActionsEnabled;
jtkorhonen@0 172
Chris@172 173 QString m_myDirPath;
Chris@172 174
Chris@284 175 // File menu actions
Chris@284 176 QAction *m_openAct;
Chris@284 177 QAction *m_changeRemoteRepoAct;
Chris@284 178 QAction *m_settingsAct;
Chris@284 179 QAction *m_exitAct;
jtkorhonen@0 180
Chris@284 181 // Repo actions
Chris@284 182 QAction *m_hgIncomingAct;
Chris@284 183 QAction *m_hgPushAct;
Chris@284 184 QAction *m_hgPullAct;
Chris@284 185 QAction *m_hgRefreshAct;
Chris@284 186 QAction *m_hgFolderDiffAct;
Chris@284 187 QAction *m_hgChgSetDiffAct;
Chris@284 188 QAction *m_hgRevertAct;
Chris@284 189 QAction *m_hgAddAct;
Chris@284 190 QAction *m_hgRemoveAct;
Chris@284 191 QAction *m_hgUpdateAct;
Chris@284 192 QAction *m_hgCommitAct;
Chris@284 193 QAction *m_hgMergeAct;
Chris@284 194 QAction *m_hgUpdateToRevAct;
Chris@284 195 QAction *m_hgAnnotateAct;
Chris@284 196 QAction *m_hgIgnoreAct;
Chris@284 197 QAction *m_hgServeAct;
jtkorhonen@0 198
Chris@284 199 // Menus
Chris@284 200 QMenu *m_fileMenu;
Chris@284 201 QMenu *m_advancedMenu;
Chris@284 202 QMenu *m_helpMenu;
jtkorhonen@0 203
Chris@284 204 // Help menu actions
Chris@284 205 QAction *m_aboutAct;
jtkorhonen@0 206
Chris@284 207 QToolBar *m_fileToolBar;
Chris@284 208 QToolBar *m_repoToolBar;
Chris@284 209 QToolBar *m_workFolderToolBar;
jtkorhonen@0 210
Chris@284 211 HgRunner *m_runner;
jtkorhonen@0 212
Chris@284 213 bool m_shouldHgStat;
Chris@163 214
Chris@239 215 QString getDiffBinaryName();
Chris@239 216 QString getMergeBinaryName();
Chris@239 217 QString getEditorBinaryName();
Chris@112 218
Chris@284 219 QFileSystemWatcher *m_fsWatcher;
Chris@238 220 QTimer *m_fsWatcherGeneralTimer;
Chris@238 221 QTimer *m_fsWatcherRestoreTimer;
Chris@241 222 bool m_fsWatcherSuspended;
Chris@90 223
Chris@284 224 QString m_lastStatOutput;
Chris@284 225 QStringList m_lastRevertedFiles;
Chris@163 226
Chris@284 227 bool m_justMerged;
Chris@284 228 QString m_mergeTargetRevision;
Chris@284 229 QString m_mergeCommitComment;
jtkorhonen@0 230 };
jtkorhonen@0 231
jtkorhonen@0 232 #endif