3 Copyright (C) 2010 Christian Pulvermacher
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
15 You should have received a copy of the GNU General Public License along
16 with this program; if not, write to the Free Software Foundation, Inc.,
17 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
19 #include "mainwindow.h"
21 #include <QApplication>
27 const QString APPNAME("Presence VNC");
29 int main(int argc, char *argv[])
31 QCoreApplication::setOrganizationName(APPNAME);
32 QCoreApplication::setApplicationName(APPNAME);
34 QApplication app(argc, argv);
38 bool view_only = false;
40 QStringList arguments = QCoreApplication::arguments();
41 for(int i = 1; i < arguments.count(); i++) {
42 if(arguments.at(i) == "--help") {
43 std::cout << "Usage: " << qPrintable(arguments.at(0)) << " [options] [URL [quality]]\n"
46 << " --help\t\t Print this text and exit.\n"
47 << " --viewonly\t Don't send mouse/keyboard input to remote desktop. This is only useful if you also supply a URL.\n"
50 << " vnc://:password@server:display\n\n"
51 << " Password and display can be omitted, e.g. vnc://server is a valid URL.\n"
52 << " Optionally, you can define the quality as a second argument (1-3, where 1 is the best). Default is 2.\n";
55 } else if(arguments.at(i) == "--viewonly") {
57 } else { //not a valid command line option, should be the url
58 url = arguments.at(i);
60 if(arguments.count() > i+1) { //having a --quality option would make more sense.
61 quality = arguments.at(i+1).toInt();
67 MainWindow main(url, quality, view_only);