Mercurial > hg > easyhg
annotate main.cpp @ 145:644bd31e8301
* Include the uncommitted item in general graph layout (in case it is not at the head, when other items will need to avoid it)
author | Chris Cannam |
---|---|
date | Wed, 01 Dec 2010 17:41:14 +0000 |
parents | 1928f9b408e6 |
children | edab92f3ea0b |
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 */ |
jtkorhonen@0 | 17 |
jtkorhonen@0 | 18 #include "mainwindow.h" |
Chris@78 | 19 #include "common.h" |
Chris@78 | 20 #include "debug.h" |
jtkorhonen@0 | 21 |
Chris@145 | 22 #include <QApplication> |
Chris@145 | 23 #include <QDir> |
Chris@145 | 24 |
jtkorhonen@0 | 25 int main(int argc, char *argv[]) |
jtkorhonen@0 | 26 { |
Chris@61 | 27 QApplication::setOrganizationName("easymercurial"); |
Chris@61 | 28 QApplication::setOrganizationDomain("easymercurial.org"); |
Chris@61 | 29 QApplication::setApplicationName(QApplication::tr("EasyMercurial")); |
jtkorhonen@0 | 30 |
Chris@78 | 31 // Lose our controlling terminal (so we can provide a new pty to |
Chris@78 | 32 // capture password requests) |
Chris@78 | 33 loseControllingTerminal(); |
Chris@78 | 34 |
Chris@105 | 35 installSignalHandlers(); |
Chris@105 | 36 |
jtkorhonen@0 | 37 QApplication app(argc, argv); |
Chris@145 | 38 QStringList args = app.arguments(); |
jtkorhonen@0 | 39 MainWindow mainWin; |
jtkorhonen@0 | 40 mainWin.show(); |
Chris@145 | 41 |
Chris@145 | 42 if (args.size() == 2) { |
Chris@145 | 43 QString path = args[1]; |
Chris@145 | 44 DEBUG << "Opening " << args[1] << endl; |
Chris@145 | 45 if (QDir(path).exists()) { |
Chris@145 | 46 path = QDir(path).canonicalPath(); |
Chris@145 | 47 mainWin.open(path); |
Chris@145 | 48 } |
Chris@145 | 49 } |
Chris@145 | 50 |
jtkorhonen@0 | 51 return app.exec(); |
jtkorhonen@0 | 52 } |