X-Git-Url: https://vcs.maemo.org/git/?a=blobdiff_plain;f=main.cpp;fp=main.cpp;h=c81212eef84ff480045c6180486523a73fe3b69e;hb=4abcc9ab77d80562371024c243eb6b4f9f28dfcc;hp=0000000000000000000000000000000000000000;hpb=ae72a12fd1ec9a4a15232a16e1efc235c482f0c2;p=qwerkisync diff --git a/main.cpp b/main.cpp new file mode 100644 index 0000000..c81212e --- /dev/null +++ b/main.cpp @@ -0,0 +1,60 @@ +/* + * Copyright (C) 2011, Jamie Thompson + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program; If not, see + * . + */ + +#include "Settings.h" +#include "Windows/ModeWindow.h" +#include "Windows/RestoreCrashBackupWindow.h" + +#include "ui_dialog.h" + +#include +#include +#include + +int main(int argc, char *argv[]) +{ + QApplication app(argc, argv); + + Settings settings; + + if (app.arguments().count() > 1 || app.arguments().first() != app.applicationFilePath()) + { + settings.setAppMode(Settings::APPMODE_CONSOLE); + +// QHash argHash; +// for(int i = 0; i < argc; ++i) +// { +// std::string val(argv[i]); +// QString val2 = QString(val.substr(val.find_first_not_of(" -")).c_str()).trimmed(); +// argHash.insert(val2, val2); +// } + } + else + settings.setAppMode(Settings::APPMODE_GUI); + + Windows::RestoreCrashBackupWindow* window = new Windows::RestoreCrashBackupWindow(settings); + window->show(); + + + //Ui_Dialog * ud = new Ui_Dialog(); + //QDialog * d = new QDialog(); + //ud->setupUi(d); + //d->show(); + + return app.exec(); +}