예제 #1
0
/******************************************************************************
* Main
*
* Main application routine. Really all this does is sets things up and waits
* for the dbus messages...
* 
*******************************************************************************/
int main(int argc, char *argv[])
{
	
	
	if (fileExists(LOCKFILE)) {
		printf("App already running, aborting\n");
		exit(0);
	} else {
		//Create the lockfile
		touchFile(LOCKFILE);
	}
	
	initializeApp();
	
	//Add the failsafe exit timeout to make sure the app doesn't run forever
	g_timeout_add(600000, (GSourceFunc) quitApp, NULL);
	
	//Setup a sync call just to be safe since Dbus doesn't always get through the first time...
	//g_timeout_add(10, (GSourceFunc) handleAlarmsSync, NULL);
	
	//Run the main loop
	g_main_loop_run(mainLoopObj);
    

    return 0;



}
예제 #2
0
MainWindow::MainWindow(const QString &fileName, QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow),
    options(new Options(this)),
    diskCache(new QNetworkDiskCache(this)),
    styleLabel(0),
    wordCountLabel(0),
    viewLabel(0),
    generator(new HtmlPreviewGenerator(options, this)),
    snippetCollection(new SnippetCollection(this)),
    splitFactor(0.5),
    scrollBarPos(0),
    rightViewCollapsed(false)
{
    ui->setupUi(this);
    setupUi();

    setFileName(fileName);

    QTimer::singleShot(0, this, SLOT(initializeApp()));
}