#include <qapplication.h>
#include <qlayout.h>
#include "gui/window.h"
#include "config.h"
#include <iostream.h>
Go to the source code of this file.
Defines | |
| #define | DEFAULT_WIDTH 875 |
| #define | DEFAULT_HEIGHT 620 |
Functions | |
| int | main (int argc, char **argv) |
|
|
Definition at line 34 of file main.cpp. Referenced by main(). |
|
|
Definition at line 33 of file main.cpp. Referenced by main(). |
|
||||||||||||
|
Definition at line 36 of file main.cpp. References DEFAULT_HEIGHT, DEFAULT_WIDTH, and IMAGE_PATH.
00037 {
00038 //set image path
00039 if(argc > 1)
00040 IMAGE_PATH = QString(argv[1]).replace("/usr/local/bin", "/usr/local/share/albumshaper") + "/images/";
00041 else
00042 IMAGE_PATH = "images/";
00043
00044 QApplication a(argc, argv);
00045
00046 Window window;
00047 a.setMainWidget( &window );
00048 window.show();
00049
00050 //determine default window size
00051
00052 //set defaults
00053 int width = DEFAULT_WIDTH;
00054 int height = DEFAULT_HEIGHT;
00055
00056 //if window size greater than desktop available then decrease
00057 QDesktopWidget *desktop = QApplication::desktop();
00058 if(width > desktop->width())
00059 { width = desktop->width(); }
00060 if(height > desktop->height())
00061 { height = desktop->height(); }
00062
00063 //if window already must be larger than defaults then enlarge
00064 if(width < window.geometry().width())
00065 { width = window.geometry().width(); }
00066 if(height < window.geometry().height())
00067 { height = window.geometry().height(); }
00068
00069 //compute offsets such that window centered on screen
00070 int xOffset = (desktop->width() - width) / 2;
00071 int yOffset = (desktop->height() - height) / 2;
00072
00073 //set size and offset and show window
00074 window.setGeometry(xOffset, yOffset, width, height);
00075 window.repaint();
00076 a.exec();
00077 }
|
1.3.1