just unselect 'listen ...' entry when edited by user
[presencevnc] / src / main.cpp
1 /*
2     Presence VNC
3     Copyright (C) 2010 Christian Pulvermacher
4
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.
9
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.
14
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.
18 */
19 #include <QApplication>
20 #include <QString>
21
22 #include "mainwindow.h"
23
24 int main(int argc, char *argv[])
25 {
26         QCoreApplication::setOrganizationName("Presence VNC");
27         QCoreApplication::setApplicationName("Presence VNC");
28
29         QApplication app(argc, argv);
30
31         QString url = QString();
32         int quality = 2;
33         QStringList arguments = QCoreApplication::arguments();
34         if (arguments.count() > 1) {
35                 //Example: vnc://:password@server:1\n"
36                 //"Optionally, you can define the quality as second argument (1-3, where 1 is the best). Default is 2.");
37
38                 url = arguments.at(1);
39                 if(arguments.count() > 2)
40                         quality = arguments.at(2).toInt();
41         }
42
43         MainWindow main(url, quality);
44         main.show();
45         return app.exec();
46 }