new version derivation system, improvements to splash screen display

git-svn-id: svn://localhost/ardour2/trunk@1022 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2006-10-26 14:13:10 +00:00
parent ca1adc2873
commit 8f53fc6459
6 changed files with 78 additions and 41 deletions

View file

@ -9,6 +9,7 @@ import errno
import time
import platform
import string
import commands
from sets import Set
import SCons.Node.FS
@ -236,35 +237,73 @@ def i18n (buildenv, sources, installenv):
# note: requires that DOMAIN, MAJOR, MINOR, MICRO are set in the construction environment
# note: assumes one source files, the header that declares the version variables
#
#def version_builder (target, source, env):
# text = "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n"
# text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n"
# text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n"
#
# try:
# o = file (target[0].get_path(), 'w')
# o.write (text)
# o.close ()
# except IOError:
# print "Could not open", target[0].get_path(), " for writing\n"
# sys.exit (-1)
#
# text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n"
# text += "#define __" + env['DOMAIN'] + "_version_h__\n"
# text += "extern int " + env['DOMAIN'] + "_major_version;\n"
# text += "extern int " + env['DOMAIN'] + "_minor_version;\n"
# text += "extern int " + env['DOMAIN'] + "_micro_version;\n"
# text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n"
#
# try:
# o = file (target[1].get_path(), 'w')
# o.write (text)
# o.close ();
# except IOError:
# print "Could not open", target[1].get_path(), " for writing\n"
# sys.exit (-1)
#
# return None
def version_builder (target, source, env):
text = "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n"
text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n"
text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n"
try:
o = file (target[0].get_path(), 'w')
o.write (text)
o.close ()
except IOError:
print "Could not open", target[0].get_path(), " for writing\n"
sys.exit (-1)
text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n"
text += "#define __" + env['DOMAIN'] + "_version_h__\n"
text += "extern int " + env['DOMAIN'] + "_major_version;\n"
text += "extern int " + env['DOMAIN'] + "_minor_version;\n"
text += "extern int " + env['DOMAIN'] + "_micro_version;\n"
text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n"
try:
o = file (target[1].get_path(), 'w')
o.write (text)
o.close ();
except IOError:
print "Could not open", target[1].get_path(), " for writing\n"
sys.exit (-1)
return None
cmd = "svn info "
cmd += source[0].get_path()
cmd += " | awk '/^Revision:/ { print $2}'"
rev = commands.getoutput (cmd)
text = "const char* " + env['DOMAIN'] + "_revision = \"" + rev + "\";\n"
text += "int " + env['DOMAIN'] + "_major_version = " + str (env['MAJOR']) + ";\n"
text += "int " + env['DOMAIN'] + "_minor_version = " + str (env['MINOR']) + ";\n"
text += "int " + env['DOMAIN'] + "_micro_version = " + str (env['MICRO']) + ";\n"
try:
o = file (target[0].get_path(), 'w')
o.write (text)
o.close ()
except IOError:
print "Could not open", target[0].get_path(), " for writing\n"
sys.exit (-1)
text = "#ifndef __" + env['DOMAIN'] + "_version_h__\n"
text += "#define __" + env['DOMAIN'] + "_version_h__\n"
text += "extern const char* " + env['DOMAIN'] + "_revision;\n"
text += "extern int " + env['DOMAIN'] + "_major_version;\n"
text += "extern int " + env['DOMAIN'] + "_minor_version;\n"
text += "extern int " + env['DOMAIN'] + "_micro_version;\n"
text += "#endif /* __" + env['DOMAIN'] + "_version_h__ */\n"
try:
o = file (target[1].get_path(), 'w')
o.write (text)
o.close ();
except IOError:
print "Could not open", target[1].get_path(), " for writing\n"
sys.exit (-1)
return None
version_bld = Builder (action = version_builder)
env.Append (BUILDERS = {'VersionBuild' : version_bld})

View file

@ -306,7 +306,7 @@ env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/pix
env.Alias('install', env.Install(os.path.join(install_prefix, 'share/ardour2/icons'), icon_files))
env.AlwaysBuild ('version.cc')
env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], ['..']))
env.Alias ('version', gtkardour.VersionBuild(['version.cc','version.h'], 'SConscript'))
#dist
env.Alias ('tarball', env.Distribute (env['DISTTREE'],

View file

@ -190,7 +190,7 @@ About::About ()
set_name (X_("ardour"));
set_website (X_("http://ardour.org/"));
set_website_label (X_("visit http://www.ardour.org/"));
set_version ((string_compose(_("%1\n(built from revision %s"),
set_version ((string_compose(_("%1\n(built from revision %2)"),
VERSIONSTRING,
gtk_ardour_revision)));

View file

@ -1873,10 +1873,6 @@ ARDOUR_UI::show ()
shown_flag = true;
}
if (about) {
about->present ();
}
}
void
@ -1886,6 +1882,7 @@ ARDOUR_UI::show_splash ()
about = new About();
}
about->present();
flush_pending ();
}
void

View file

@ -259,7 +259,6 @@ show_ui_callback (void *arg)
ARDOUR_UI * ui = (ARDOUR_UI *) arg;
ui->hide_splash();
ui->show ();
return FALSE;
}
@ -286,7 +285,7 @@ Please consider the possibilities, and perhaps (re)start JACK."));
win.set_position (Gtk::WIN_POS_CENTER);
if (!no_splash) {
ui->hide_splash ();
ui->hide_splash ();
}
/* we just don't care about the result, but we want to block */
@ -329,10 +328,12 @@ To create it from the command line, start ardour as \"ardour --new %1"), path) <
ui->load_session (path, name);
} else {
/* TODO: This bit of code doesn't work properly yet
Glib::signal_idle().connect (bind (mem_fun (*ui, &ARDOUR_UI::cmdline_new_session), path));
ui->set_will_create_new_session_automatically (true); */
/* TODO: This bit of code doesn't work properly yet
Glib::signal_idle().connect (bind (mem_fun (*ui, &ARDOUR_UI::cmdline_new_session), path));
ui->set_will_create_new_session_automatically (true);
*/
/* Show the NSD */
ui->hide_splash ();
if (!Config->get_no_new_session_dialog()) {
@ -383,7 +384,7 @@ int main (int argc, char *argv[])
cout << _("Ardour/GTK ")
<< VERSIONSTRING
<< _("\n (built using ")
<< ARDOUR::get_ardour_revision ()
<< gtk_ardour_revision
#ifdef __GNUC__
<< _(" and GCC version ") << __VERSION__
#endif

View file

@ -17,7 +17,7 @@ class RCUManager
virtual ~RCUManager() { delete m_rcu_value; }
boost::shared_ptr<T> reader () const { return *((boost::shared_ptr<T> *) g_atomic_pointer_get (&m_rcu_value)); }
boost::shared_ptr<T> reader () const { return *((boost::shared_ptr<T> *) g_atomic_pointer_get (the_pointer())); }
virtual boost::shared_ptr<T> write_copy () = 0;
virtual bool update (boost::shared_ptr<T> new_value) = 0;