This commit is contained in:
ffsup2
2011-05-29 19:12:15 +02:00
parent cf5d83f14b
commit 746c6f8afe
5 changed files with 42 additions and 36 deletions

View File

@@ -21,7 +21,7 @@
#include <glib/gstdio.h> #include <glib/gstdio.h>
#include <safekeyfile.h> #include <safekeyfile.h>
#include <safegtk.h> #include <safegtk.h>
#include "version.h" #include <version.h>
CacheImageData::CacheImageData () CacheImageData::CacheImageData ()
: md5(""), supported(false), format(FT_Invalid), rankOld(-1), inTrashOld(false), recentlySaved(false), : md5(""), supported(false), format(FT_Invalid), rankOld(-1), inTrashOld(false), recentlySaved(false),

View File

@@ -64,25 +64,25 @@ int main(int argc, char **argv)
Glib::ustring argv0_; Glib::ustring argv0_;
#ifdef WIN32 #ifdef WIN32
WCHAR exnameU[512] = {0}; WCHAR exnameU[512] = {0};
char exname[512] = {0}; char exname[512] = {0};
GetModuleFileNameW (NULL, exnameU, 512); GetModuleFileNameW (NULL, exnameU, 512);
WideCharToMultiByte(CP_UTF8,0,exnameU,-1,exname,512,0,0 ); WideCharToMultiByte(CP_UTF8,0,exnameU,-1,exname,512,0,0 );
argv0_ = exname; argv0_ = exname;
// get the path where the rawtherapee executable is stored // get the path where the rawtherapee executable is stored
argv0 = Glib::path_get_dirname(argv0_); argv0 = Glib::path_get_dirname(argv0_);
#else #else
// get the path to data (defined in config.h which is generated by cmake) // get the path to data (defined in config.h which is generated by cmake)
argv0 = DATA_SEARCH_PATH; argv0 = DATA_SEARCH_PATH;
// check if path exists, otherwise revert back to behavior similar to windows // check if path exists, otherwise revert back to behavior similar to windows
try { try {
Glib::Dir dir(DATA_SEARCH_PATH); Glib::Dir dir(DATA_SEARCH_PATH);
} catch (Glib::FileError) { } catch (Glib::FileError) {
argv0_ = argv[0]; argv0_ = argv[0];
argv0 = Glib::path_get_dirname(argv0_); argv0 = Glib::path_get_dirname(argv0_);
} }
#endif #endif
@@ -113,7 +113,7 @@ int main(int argc, char **argv)
if (!options.useSystemTheme) if (!options.useSystemTheme)
{ {
std::vector<Glib::ustring> rcfiles; std::vector<Glib::ustring> rcfiles;
rcfiles.push_back (argv0+"/themes/"+options.theme); rcfiles.push_back (argv0+"/themes/"+options.theme);
// Set the font face and size // Set the font face and size
Gtk::RC::parse_string (Glib::ustring::compose( Gtk::RC::parse_string (Glib::ustring::compose(

View File

@@ -195,14 +195,12 @@ int Options::readFromFile (Glib::ustring fname) {
if (keyFile.has_group ("General")) { if (keyFile.has_group ("General")) {
if (keyFile.has_key ("General", "TabbedEditor")) tabbedUI= keyFile.get_boolean ("General", "TabbedEditor"); if (keyFile.has_key ("General", "TabbedEditor")) tabbedUI= keyFile.get_boolean ("General", "TabbedEditor");
if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "home") if (keyFile.has_key ("General", "StartupDirectory")){
startupDir = STARTUPDIR_HOME; if( keyFile.get_string ("General", "StartupDirectory") == "home") startupDir = STARTUPDIR_HOME;
else if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "current") else if ( keyFile.get_string ("General", "StartupDirectory") == "current") startupDir = STARTUPDIR_CURRENT;
startupDir = STARTUPDIR_CURRENT; else if ( keyFile.get_string ("General", "StartupDirectory") == "last") startupDir = STARTUPDIR_LAST;
else if (keyFile.has_key ("General", "StartupDirectory") && keyFile.get_string ("General", "StartupDirectory") == "last") else if ( keyFile.get_string ("General", "StartupDirectory") == "custom") startupDir = STARTUPDIR_CUSTOM;
startupDir = STARTUPDIR_LAST; }
else
startupDir = STARTUPDIR_CUSTOM;
if (keyFile.has_key ("General", "StartupPath")) startupPath = keyFile.get_string ("General", "StartupPath"); if (keyFile.has_key ("General", "StartupPath")) startupPath = keyFile.get_string ("General", "StartupPath");
if (keyFile.has_key ("General", "DateFormat")) dateFormat = keyFile.get_string ("General", "DateFormat"); if (keyFile.has_key ("General", "DateFormat")) dateFormat = keyFile.get_string ("General", "DateFormat");
@@ -513,24 +511,28 @@ void Options::load () {
* *
* Folder redirection is then fully supported on WinVista/7, but not on Win2000/XP * Folder redirection is then fully supported on WinVista/7, but not on Win2000/XP
*/ */
const gchar* dataPath;
Glib::ustring dPath;
WCHAR path[MAX_PATH]; // ->ODUIS: How to make that commented out code work ?
/*WCHAR path[MAX_PATH] = {0};
if (SHGetSpecialFolderPathW(NULL, path, CSIDL_LOCAL_APPDATA, false)) { if (SHGetSpecialFolderPathW(NULL, path, CSIDL_LOCAL_APPDATA, false)) {
gchar* pathUTF8=g_utf16_to_utf8((const gunichar2*)path,-1,NULL,NULL,NULL); dPath = path;
rtdir = Glib::ustring(pathUTF8) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME); printf("SHGetSpecialFolderPathW: \"%s\"\n", dPath.c_str());
g_free(pathUTF8);
} }
else { else {
// Should never fail, but old alternative way as backup printf("SHGetSpecialFolderPathW: Fail!\n");
const gchar* dataPath = g_getenv("LOCALAPPDATA"); }*/
if (dataPath != NULL)
rtdir = Glib::ustring(dataPath) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME); dataPath = g_getenv("LOCALAPPDATA");
else { if (dataPath != NULL)
dataPath = g_getenv("USERPROFILE"); rtdir = Glib::ustring(dataPath) + Glib::ustring("\\") + Glib::ustring(CACHEFOLDERNAME);
if (dataPath != NULL) else {
rtdir = Glib::ustring(dataPath) + Glib::ustring("\\Local Settings\\Application Data\\") + Glib::ustring(CACHEFOLDERNAME); dataPath = g_getenv("USERPROFILE");
} if (dataPath != NULL)
} rtdir = Glib::ustring(dataPath) + Glib::ustring("\\Local Settings\\Application Data\\") + Glib::ustring(CACHEFOLDERNAME);
}
#else #else
rtdir = Glib::ustring(g_get_user_config_dir ()) + Glib::ustring("/") + Glib::ustring(CACHEFOLDERNAME); rtdir = Glib::ustring(g_get_user_config_dir ()) + Glib::ustring("/") + Glib::ustring(CACHEFOLDERNAME);
#endif #endif

View File

@@ -73,7 +73,7 @@ RTWindow::RTWindow ()
mainNB->set_scrollable (true); mainNB->set_scrollable (true);
mainNB->signal_switch_page().connect_notify( sigc::mem_fun(*this, &RTWindow::on_mainNB_switch_page) ); mainNB->signal_switch_page().connect_notify( sigc::mem_fun(*this, &RTWindow::on_mainNB_switch_page) );
fpanel = Gtk::manage ( new FilePanel () ); fpanel = new FilePanel () ;
fpanel->setParent (this); fpanel->setParent (this);
// decorate tab // decorate tab

View File

@@ -49,6 +49,7 @@ if [ -d "${APP}" ]; then
fi fi
echo "Removing any old disk images..." echo "Removing any old disk images..."
rm ${RELEASE}/rawtherapee*.dmg rm ${RELEASE}/rawtherapee*.dmg
rm ${RELEASE}/rawtherapee*.dmg.zip
echo "Making application directory structure..." echo "Making application directory structure..."
mkdir -p "${RESOURCES}" mkdir -p "${RESOURCES}"
@@ -99,4 +100,7 @@ rm -rf ${APP}
cd ${RELEASE} cd ${RELEASE}
zip ${DMG}.zip ${DMG} AboutThisBuild.txt zip ${DMG}.zip ${DMG} AboutThisBuild.txt
cd ${RELEASE}
zip ${DMG}.zip ${DMG} AboutThisBuild.txt
echo "All done!" echo "All done!"