From bde1b4952610a8d6d369e1364a4d1743cb39c11b Mon Sep 17 00:00:00 2001 From: Manuel Schneider Date: Mon, 2 Dec 2013 14:27:55 +0100 Subject: Added config files --- src/main.cpp | 95 ++++++++++++------------------------------------------------ 1 file changed, 19 insertions(+), 76 deletions(-) (limited to 'src/main.cpp') diff --git a/src/main.cpp b/src/main.cpp index 584c121..9eb8a4b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1,87 +1,30 @@ - +// Copyright 2013, University of Freiburg, +// Author: Manuel Schneider #include -#include -#include #include #include #include "widget.h" -#include "config.h" -#include "x.h" - - -// Prototypes -QString getIP (); - -void usage() -{ -} - int main(int argc, char *argv[]) { -// if (argc != 1) -// std::cout << "Usage: " << argv[0] << " " << std::endl; -// else { -// // Check if file exists -// std::ifstream f(argv[1]); -// if (!f) { -// std::cerr << "The config file does not exist." << std::endl; -// exit(1); -// } -// else -// f.close(); -// } - -// //Load settings -// Config::inst()->loadSettings(argv[1]); -// qDebug() << X::Screen::inst(); - - -// qDebug() << Config::inst()->getDisplay(); -// qDebug() << Config::inst()->getInterface(); -// qDebug() << Config::inst()->getIpSpecificXConf(); -// qDebug() << Config::inst()->getModeLines(); -// qDebug() << Config::inst()->getSettingsPath(); - - -// // Get initial data (to be freed) -// Display *dpy = XOpenDisplay(NULL); -// XRRScreenResources *sr = XRRGetScreenResourcesCurrent(dpy, DefaultRootWindow(dpy)); - - - - -// int X=1;RandR:: -// int M=1; - -// XRROutputInfo *output_first_info = XRRGetOutputInfo(dpy, sr, sr->outputs[X]); - -// // XRRSet -// // HOLY -// XRRSetCrtcConfig(dpy, -// sr, -// output_first_info->crtc, -// CurrentTime, -// 0, 0, -// sr->modes[output_first_info->npreferred -1].id, -// RR_Rotate_0, -// &sr->outputs[X], -// 1); - - - - - - - - - - - QApplication a(argc, argv); - Widget w; - w.show(); - return a.exec(); + if (argc != 1) + std::cout << "Usage: " << argv[0] << " " << std::endl; + else { + // Check if file exists + std::ifstream f(argv[1]); + if (!f) { + std::cerr << "The config file does not exist." << std::endl; + exit(1); + } + else + f.close(); + } + + QApplication a(argc, argv); + Widget w; + w.show(); + return a.exec(); } -- cgit v1.2.3-55-g7522