annotate common.h @ 109:1721c580c10e

* Add a queueing mechanism for Hg actions, instead of refusing to start an action if something else is already happening. This is essential now that actions can be prompted by asynchronous events (e.g. filesystem watcher). * Make Revert behave sensibly
author Chris Cannam
date Fri, 26 Nov 2010 12:48:29 +0000
parents 1928f9b408e6
children b6dd1ee0e486
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@57 6 Based on HgExplorer by Jari Korhonen
Chris@57 7 Copyright (c) 2010 Jari Korhonen
Chris@57 8 Copyright (c) 2010 Chris Cannam
Chris@57 9 Copyright (c) 2010 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 */
Chris@57 17
jtkorhonen@0 18 #ifndef COMMON_H
jtkorhonen@0 19 #define COMMON_H
jtkorhonen@0 20
Chris@50 21 #include <QString>
jtkorhonen@0 22
jtkorhonen@0 23 #define MY_ICON_SIZE 32
Chris@109 24 //!!!:
jtkorhonen@0 25 #define REPOMENU_TITLE "Repository actions"
jtkorhonen@0 26 #define WORKFOLDERMENU_TITLE "Workfolder actions"
jtkorhonen@0 27
Chris@62 28 extern QString findExecutable(QString name);
jtkorhonen@0 29
jtkorhonen@0 30 extern QString getSystem();
jtkorhonen@0 31 extern QString getHgDirName();
jtkorhonen@0 32
Chris@62 33 extern QString getUserRealName();
Chris@62 34
Chris@78 35 extern void loseControllingTerminal();
Chris@78 36
Chris@105 37 void installSignalHandlers();
Chris@105 38
Chris@79 39 /**
Chris@79 40 * Status used in testing whether a folder argument (received from the
Chris@79 41 * user) is valid for particular uses.
Chris@79 42 */
Chris@79 43 enum FolderStatus {
Chris@79 44 FolderUnknown, /// Neither the folder nor its parent exists
Chris@79 45 FolderParentExists, /// The folder is absent, but its parent exists
Chris@79 46 FolderExists, /// The folder exists and has no .hg repo in it
Chris@79 47 FolderHasRepo, /// The folder exists and has an .hg repo in it
Chris@79 48 FolderIsFile /// The "folder" is actually a file
Chris@79 49 };
Chris@79 50
Chris@79 51 FolderStatus getFolderStatus(QString path);
Chris@79 52
Chris@79 53 /**
Chris@79 54 * If the given path is somewhere within an existing repository,
Chris@79 55 * return the path of the root directory of the repository (i.e. the
Chris@79 56 * one with .hg in it).
Chris@79 57 *
Chris@79 58 * If the given path is _not_ in a repository, or the given path _is_
Chris@79 59 * the root directory of a repository, return QString(). Use
Chris@79 60 * getFolderStatus to distinguish between these cases.
Chris@79 61 */
Chris@79 62 QString getContainingRepoFolder(QString path);
Chris@79 63
Chris@79 64 QString xmlEncode(QString);
Chris@79 65
Chris@79 66
jtkorhonen@0 67 #endif //COMMON_H
jtkorhonen@0 68
jtkorhonen@0 69