54 QApplication a(argc, argv);
62 #if defined(Q_OS_MACX) 63 CFURLRef pluginRef = CFBundleCopyBundleURL(CFBundleGetMainBundle());
64 CFStringRef macPath = CFURLCopyFileSystemPath(pluginRef, kCFURLPOSIXPathStyle);
65 MATERIAL_DIR = QString( CFStringGetCStringPtr(macPath, CFStringGetSystemEncoding())) +
"/Contents/Resources";
68 #elif defined(Q_OS_WIN) 77 if( QString(argv[1]).contains(QString(BIN_DIR)) != 0 )
99 if(!handbookDir.exists())
105 if(!textDir.exists())
118 std::cout <<
"Error! Unable to make configurations directory!\n";
126 bool tempDirMade =
true;
130 #if defined(Q_OS_MACX) 131 homeDir = QDir::homeDirPath();
132 homeDir.cd(
"Library");
133 homeDir.cd(
"Application Support");
134 if(!homeDir.exists(
"Album Shaper"))
135 { tempDirMade = homeDir.mkdir(
"Album Shaper"); }
136 TEMP_DIR = QDir::convertSeparators( QDir::homeDirPath() + QString(
"/Library/Application Support/Album Shaper") );
139 #elif defined(Q_OS_WIN) 141 if( !getWindowsFolderLocation(APPLICATION_DATA, folderLoc) )
143 std::cout <<
"Error! Unable to identify Application Data folder!\n";
147 QDir applicationDataDir( folderLoc );
148 if(!applicationDataDir.exists(
"Album Shaper"))
149 { tempDirMade = applicationDataDir.mkdir(
"Album Shaper"); }
150 TEMP_DIR = QDir::convertSeparators ( folderLoc + QString(
"/Album Shaper") );
154 homeDir = QDir::homeDirPath();
155 if(!homeDir.exists(
".albumShaper")) { tempDirMade = homeDir.mkdir(
".albumShaper"); }
156 TEMP_DIR = QDir::homeDirPath() + QString(
"/.albumShaper");
162 std::cout <<
"Error! Unable to make temp files directory!\n";
167 QTranslator translator( 0 );
168 translator.load( QString(
"AlbumShaper_") +
170 QTextCodec::locale(),
173 a.installTranslator( &translator );
177 a.setMainWidget( &window );
181 if( config->
getBool(
"layout",
"restoreWindowPlacementSize") )
183 window.resize( config->
getInt(
"layout",
"windowWidth" ),
184 config->
getInt(
"layout",
"windowHeight" ) );
186 window.move( config->
getInt(
"layout",
"windowPosX" ),
187 config->
getInt(
"layout",
"windowPosY" ) );
191 QDesktopWidget *desktop = QApplication::desktop();
192 int size = config->
getInt(
"layout",
"defaultWindowSize" );
193 int placement = config->
getInt(
"layout",
"defaultWindowPlacement" );
195 QRect availRect = desktop->availableGeometry();
196 int width = (size*availRect.width()) / 100;
197 int height = (size*availRect.height()) / 100;
199 window.resize( width, height );
200 width = window.frameGeometry().width();
201 height = window.frameGeometry().height();
207 x = availRect.left();
213 x = availRect.right() -
width;
219 x = availRect.left();
220 y = availRect.bottom() -
height;
225 x = availRect.right() -
width;
226 y = availRect.bottom() -
height;
231 x = availRect.left() + (availRect.width() -
width) / 2;
232 y = availRect.top() + (availRect.height() -
height) / 2;
247 if( config->
getBool (
"misc",
"cvsWarn" ) )
250 QString(
"Warning! You are running a potentially unstable (CVS) build of Album Shaper! It is strongly suggested you only use this copy for testing and evaluation purposes. Data loss may occur!"),
251 "alertIcons/warning.png", &window );
258 if(config->
getBool(
"misc",
"firstRun" ) )
263 config->
setBool(
"misc",
"firstRun",
false );
A configurable alert dialog that displays an alert/error message.
Top level widget, encapsulates the title widget, the layout widget, and the toolbar widget...
bool getBool(QString group, QString key)
Fetch bool setting.
void setBool(QString group, QString key, bool val)
Set bool setting.
Configuration * getConfig()
get setting object
int getInt(QString group, QString key)
Fetch int setting.
QString XMLCONVERSION_PATH
static bool constructSettingsDirectory()
Constructs any necessary directories for loading and saving user settings, returns false if unsuccess...
Configuration object manages all user-specific application settings.