musredit 1.0.0
Loading...
Searching...
No Matches
main.cpp
Go to the documentation of this file.
1/****************************************************************************
2
3 main.cpp
4
5 Author: Andreas Suter
6 e-mail: andreas.suter@psi.ch
7
8*****************************************************************************/
9
10/***************************************************************************
11 * Copyright (C) 2010-2026 by Andreas Suter *
12 * andreas.suter@psi.ch *
13 * *
14 * This program is free software; you can redistribute it and/or modify *
15 * it under the terms of the GNU General Public License as published by *
16 * the Free Software Foundation; either version 2 of the License, or *
17 * (at your option) any later version. *
18 * *
19 * This program is distributed in the hope that it will be useful, *
20 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
21 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
22 * GNU General Public License for more details. *
23 * *
24 * You should have received a copy of the GNU General Public License *
25 * along with this program; if not, write to the *
26 * Free Software Foundation, Inc., *
27 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
28 ***************************************************************************/
29
41
42#include <iostream>
43#include <memory>
44
45#include <QApplication>
46
47#ifdef HAVE_GIT_REV_H
48#include "git-revision.h"
49#endif
50#include "PTextEdit.h"
51#include "PFitOutputHandler.h"
52
85int main( int argc, char ** argv )
86{
87 Q_INIT_RESOURCE(musredit);
88
89 if (argc == 2) {
90 if (!strcmp(argv[1], "--help") || !strcmp(argv[1], "-h")) {
91 std::cout << std::endl << "usage: musredit [<msr-files>] | -h, --help | -v, --version";
92 std::cout << std::endl << std::endl;
93 return 0;
94 } else if (!strcmp(argv[1], "--version") || !strcmp(argv[1], "-v")) {
95#ifdef HAVE_GIT_REV_H
96 std::cout << std::endl << "musredit git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1;
97#else
98 std::cout << std::endl << "musredit git-branch: unknown, git-rev: unknown.";
99#endif
100 std::cout << std::endl << std::endl;
101 return 0;
102 }
103 }
104
105 QApplication a( argc, argv );
106
107 std::unique_ptr<PTextEdit> mw = std::make_unique<PTextEdit>();
108 mw->setWindowTitle( "MusrFit Editor" );
109 mw->resize( mw->getEditW(), mw->getEditH() );
110 mw->show();
111
112 a.connect( &a, SIGNAL( lastWindowClosed() ), &a, SLOT( quit() ) );
113 a.connect( &a, SIGNAL( aboutToQuit() ), mw.get(), SLOT( aboutToQuit() ) );
114 return a.exec();
115}
Dialog for displaying musrfit fitting process output.
Main window class for the musredit application.
int main(int argc, char **argv)
Main entry point for the musredit application.
Definition main.cpp:85