00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #include <qapplication.h>
00019 #include <qlayout.h>
00020
00021
00022 #include "gui/window.h"
00023 #include "config.h"
00024
00025 #include <iostream.h>
00026
00027
00033 #define DEFAULT_WIDTH 875
00034 #define DEFAULT_HEIGHT 620
00035
00036 int main( int argc, char **argv)
00037 {
00038
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
00051
00052
00053 int width = DEFAULT_WIDTH;
00054 int height = DEFAULT_HEIGHT;
00055
00056
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
00064 if(width < window.geometry().width())
00065 { width = window.geometry().width(); }
00066 if(height < window.geometry().height())
00067 { height = window.geometry().height(); }
00068
00069
00070 int xOffset = (desktop->width() - width) / 2;
00071 int yOffset = (desktop->height() - height) / 2;
00072
00073
00074 window.setGeometry(xOffset, yOffset, width, height);
00075 window.repaint();
00076 a.exec();
00077 }