This commit is contained in:
ffsup2
2011-02-07 23:52:16 +01:00
19 changed files with 304 additions and 77 deletions

View File

@@ -31,6 +31,7 @@
#include <string.h>
#include <stdlib.h>
#include <options.h>
#include <version.h>
#ifndef WIN32
#include <config.h>
@@ -225,6 +226,8 @@ int processLineParams( int argc, char **argv )
case 'h':
case '?':
default:
std::cerr << "RawTherapee, " << VERSION << std::endl;
std::cerr << "Copyright (c)2004-2011 Gabor Horvath <hgabor@rawtherapee.com>"<< std::endl << std::endl;
std::cerr << "Usage:"<< std::endl;
std::cerr << Glib::path_get_basename(argv[0]) << " [<selected dir>] : start RT GUI browser inside dir."<< std::endl;
std::cerr << Glib::path_get_basename(argv[0]) << " <file> : start GUI editor with file."<< std::endl;

View File

@@ -25,9 +25,10 @@
#include <safekeyfile.h>
#include <addsetids.h>
#include <safegtk.h>
#include <version.h>
Options options;
Glib::ustring versionString = "v3.0 alpha 1";
Glib::ustring versionString = VERSION;
Glib::ustring paramFileExtension = ".pp3";
Options::Options () {
@@ -75,7 +76,7 @@ void Options::setDefaults () {
fbShowHidden = false;
fbArrangement = 0;
multiUser = false;
version = 290;
version = TAGDISTANCE;
thumbSize = 80;
thumbSizeTab = 80;
showHistory = true;
@@ -191,7 +192,7 @@ if (keyFile.has_group ("General")) {
if (keyFile.has_key ("General", "UseSystemTheme")) useSystemTheme = keyFile.get_boolean ("General", "UseSystemTheme");
if (keyFile.has_key ("General", "FirstRun")) firstRun = keyFile.get_boolean ("General", "FirstRun");
if( keyFile.has_key ("General", "DarkFramesPath")) rtSettings.darkFramesPath = keyFile.get_string("General", "DarkFramesPath");
if( keyFile.has_key ("General", "FlatFieldsPath")) rtSettings.flatFieldsPath = keyFile.get_string("General", "FlatFieldsPath");
if( keyFile.has_key ("General", "FlatFieldsPath")) rtSettings.flatFieldsPath = keyFile.get_string("General", "FlatFieldsPath");
if( keyFile.has_key ("General", "Verbose")) rtSettings.verbose = keyFile.get_boolean ( "General", "Verbose");
}
@@ -336,7 +337,7 @@ int Options::saveToFile (Glib::ustring fname) {
keyFile.set_string ("General", "Language", language);
keyFile.set_string ("General", "Theme", theme);
keyFile.set_boolean ("General", "UseSystemTheme", useSystemTheme);
keyFile.set_integer ("General", "Version", 290);
keyFile.set_integer ("General", "Version", TAGDISTANCE);
keyFile.set_boolean ("General", "FirstRun", firstRun);
keyFile.set_string ("General", "DarkFramesPath", rtSettings.darkFramesPath);
keyFile.set_string ("General", "FlatFieldsPath", rtSettings.flatFieldsPath);

View File

@@ -1047,7 +1047,7 @@ void Preferences::selectStartupDir () {
void Preferences::aboutPressed () {
Splash* splash = new Splash (-1);
Splash* splash = new Splash ();
splash->set_transient_for (*this);
splash->set_modal (true);
splash->show ();

View File

@@ -44,26 +44,131 @@ void SplashImage::on_realize () {
bool SplashImage::on_expose_event (GdkEventExpose* event) {
Glib::RefPtr<Gdk::Window> window = get_window();
Glib::RefPtr<Gdk::Window> window = get_window();
pixbuf->render_to_drawable (window, gc_, 0, 0, 0, 0, pixbuf->get_width(), pixbuf->get_height(), Gdk::RGB_DITHER_NONE, 0, 0);
Cairo::FontOptions cfo;
cfo.set_antialias (Cairo::ANTIALIAS_SUBPIXEL);
Glib::RefPtr<Pango::Context> context = get_pango_context () ;
Glib::RefPtr<Pango::Context> context = get_pango_context ();
context->set_cairo_font_options (cfo);
Pango::FontDescription fontd = context->get_font_description ();
fontd.set_weight (Pango::WEIGHT_SEMIBOLD);
fontd.set_size (12*Pango::SCALE);
fontd.set_weight (Pango::WEIGHT_LIGHT);
fontd.set_absolute_size (12*Pango::SCALE);
context->set_font_description (fontd);
Gdk::Color *textColor = new Gdk::Color();
textColor->set_rgb(0, 0, 0);
gc_->set_foreground(*textColor);
version = create_pango_layout (versionString);
int w, h;
version = create_pango_layout (versionString);
version->get_pixel_size (w, h);
window->draw_layout(gc_, pixbuf->get_width() - w - 28, 44-h, version);
window->draw_layout(gc_, pixbuf->get_width() - w - 4, pixbuf->get_height() - h - 4, version);
return true;
}
Splash::Splash () {
set_title (M("GENERAL_ABOUT"));
set_border_width (4);
Gtk::Notebook* nb = Gtk::manage (new Gtk::Notebook ());
get_vbox()->pack_start (*nb);
// Tab 1: the image
splashImage = new SplashImage ();
nb->append_page (*splashImage, M("ABOUT_TAB_SPLASH"));
splashImage->show ();
// Tab 2: the informations about the current version
std::string buildFileName = Glib::build_filename (argv0, "AboutThisBuild.txt");
if ( safe_file_test(buildFileName, (Glib::FILE_TEST_EXISTS)) ) {
FILE *f = safe_g_fopen (buildFileName, "rt");
if (f != NULL) {
char* buffer = new char[1024];
std::ostringstream ostr;
while (fgets (buffer, 1024, f))
ostr << buffer;
delete [] buffer;
fclose (f);
Glib::RefPtr<Gtk::TextBuffer> textBuffer = Gtk::TextBuffer::create();
textBuffer->set_text((Glib::ustring)(ostr.str()));
Gtk::ScrolledWindow *buildSW = Gtk::manage (new Gtk::ScrolledWindow());
Gtk::TextView *buildTV = Gtk::manage (new Gtk::TextView (textBuffer));
buildTV->set_editable(false);
buildSW->add(*buildTV);
nb->append_page (*buildSW, M("ABOUT_TAB_BUILD"));
}
}
// Tab 3: the credits
#if defined _WIN32 || defined __APPLE__
std::string creditsFileName = Glib::build_filename (argv0, "AUTHORS.txt");
#else
std::string creditsFileName = Glib::build_filename (argv0, "share/doc/AUTHORS.txt");
#endif
if ( safe_file_test(creditsFileName, (Glib::FILE_TEST_EXISTS)) ) {
FILE *f = safe_g_fopen (creditsFileName, "rt");
if (f != NULL) {
char* buffer = new char[1024];
std::ostringstream ostr;
while (fgets (buffer, 1024, f))
ostr << buffer;
delete [] buffer;
fclose (f);
Glib::RefPtr<Gtk::TextBuffer> textBuffer = Gtk::TextBuffer::create();
textBuffer->set_text((Glib::ustring)(ostr.str()));
Gtk::ScrolledWindow *creditsSW = Gtk::manage (new Gtk::ScrolledWindow());
Gtk::TextView *creditsTV = Gtk::manage (new Gtk::TextView (textBuffer));
creditsTV->set_editable(false);
creditsSW->add(*creditsTV);
nb->append_page (*creditsSW, M("ABOUT_TAB_CREDITS"));
}
}
// Tab 4: the license
#if defined _WIN32 || defined __APPLE__
std::string licenseFileName = Glib::build_filename (argv0, "LICENSE.txt");
#else
std::string licenseFileName = Glib::build_filename (argv0, "share/doc/LICENSE.txt");
#endif
if ( safe_file_test(licenseFileName, (Glib::FILE_TEST_EXISTS)) ) {
FILE *f = safe_g_fopen (licenseFileName, "rt");
if (f != NULL) {
char* buffer = new char[1024];
std::ostringstream ostr;
while (fgets (buffer, 1024, f))
ostr << buffer;
delete [] buffer;
fclose (f);
Glib::RefPtr<Gtk::TextBuffer> textBuffer = Gtk::TextBuffer::create();
textBuffer->set_text((Glib::ustring)(ostr.str()));
Gtk::ScrolledWindow *licenseSW = Gtk::manage (new Gtk::ScrolledWindow());
Gtk::TextView *creditsTV = Gtk::manage (new Gtk::TextView (textBuffer));
creditsTV->set_editable(false);
licenseSW->add(*creditsTV);
nb->append_page (*licenseSW, M("ABOUT_TAB_LICENSE"));
}
}
set_position (Gtk::WIN_POS_CENTER);
//add_events(Gdk::BUTTON_RELEASE_MASK);
set_resizable (true);
nb->set_current_page (0);
show_all_children ();
set_modal (true);
set_keep_above (true);
}
Splash::Splash (int maxtime) {
set_title (M("GENERAL_ABOUT"));
@@ -71,7 +176,6 @@ Splash::Splash (int maxtime) {
splashImage = new SplashImage ();
// add (*splashImage);
get_vbox()->pack_start (*splashImage);
set_has_separator (false);
splashImage->show ();
if (maxtime>0)

View File

@@ -42,6 +42,7 @@ class Splash : public Gtk::Dialog {
public:
Splash (int maxtime);
Splash ();
bool on_timer ();
virtual bool on_button_release_event (GdkEventButton* event);