Merge branch 'dev' into rt-cli

This commit is contained in:
Hombre
2017-02-14 00:15:23 +01:00
100 changed files with 4953 additions and 1521 deletions

View File

@@ -121,10 +121,6 @@ RTWindow::RTWindow ()
#endif
versionStr = "RawTherapee " + versionString;
if (!versionSuffixString.empty()) {
versionStr += " " + versionSuffixString;
}
set_title_decorated("");
set_resizable(true);
set_resize_mode(Gtk::ResizeMode::RESIZE_QUEUE);
@@ -309,30 +305,6 @@ RTWindow::~RTWindow()
}
}
void RTWindow::findVerNumbers(int* numbers, Glib::ustring versionStr)
{
numbers[0] = numbers[1] = numbers[2] = numbers[3] = 0;
int n = 0;
for (unsigned int i = 0; i < versionStr.length(); i++) {
char chr = (char)versionStr.at(i);
if (chr >= '0' && chr <= '9') {
numbers[n] *= 10;
numbers[n] += (int)(chr - '0');
} else {
n++;
if (n > 4) {
printf("Error: malformed version string; \"%s\" must follow this format: xx.xx.xx.xx. Admitting it's a developer version...\n", versionStr.c_str());
// Reseting the already found numbers
numbers[0] = numbers[1] = numbers[2] = numbers[3] = 100;
return;
}
}
}
}
void RTWindow::on_realize ()
{
Gtk::Window::on_realize ();
@@ -349,38 +321,20 @@ void RTWindow::on_realize ()
// Check if first run of this version, then display the Release Notes text
if (options.version != versionString) {
int prevVerNbr[4];
int currVerNbr[4];
findVerNumbers(prevVerNbr, options.version);
findVerNumbers(currVerNbr, versionString);
// Now we can update the version parameter with the right value
// Update the version parameter with the right value
options.version = versionString;
bool showReleaseNotes = false;
splash = new Splash (*this);
splash->set_transient_for (*this);
splash->signal_delete_event().connect( sigc::mem_fun(*this, &RTWindow::splashClosed) );
// Check if the current version is newer
if (currVerNbr[0] > prevVerNbr[0]) {
showReleaseNotes = true;
} else if (currVerNbr[1] > prevVerNbr[1]) {
showReleaseNotes = true;
} else if (currVerNbr[2] > prevVerNbr[2]) {
showReleaseNotes = true;
}
if (showReleaseNotes) {
// this is a first run!
splash = new Splash (*this);
splash->set_transient_for (*this);
splash->signal_delete_event().connect( sigc::mem_fun(*this, &RTWindow::splashClosed) );
if (splash->hasReleaseNotes()) {
splash->showReleaseNotes();
splash->show ();
} else {
delete splash;
splash = nullptr;
}
if (splash->hasReleaseNotes()) {
splash->showReleaseNotes();
splash->show ();
} else {
delete splash;
splash = nullptr;
}
}
}