commit a39e9b24db1e2ab7f520ee3914c60c62b9e62570
parent 0b1a5cbc0c46e62ae4095def52952c845085f18b
Author: Alexander Kojevnikov <alexander@kojevnikov.com>
Date: Tue, 3 May 2011 21:50:22 +0800
Require Vala 0.12
Diffstat:
6 files changed, 13 insertions(+), 30 deletions(-)
diff --git a/configure.ac b/configure.ac
@@ -12,7 +12,7 @@ AM_MAINTAINER_MODE
AC_PROG_CC
AC_PROG_CC_STDC
-AM_PROG_VALAC([0.7.0])
+AM_PROG_VALAC([0.12.0])
AC_PROG_INSTALL
IT_PROG_INTLTOOL([0.35])
diff --git a/dist/debian/control b/dist/debian/control
@@ -5,7 +5,7 @@ Maintainer: Alexander Kojevnikov <alexander@kojevnikov.com>
Build-Depends: debhelper (>= 7.0.50~),
cdbs,
autotools-dev,
- valac (>= 0.8.0),
+ valac-0.12,
intltool (>= 0.35),
libavcodec-dev (>= 4:0.6),
libavformat-dev (>= 4:0.6),
diff --git a/src/spek-message-bar.vala b/src/spek-message-bar.vala
@@ -45,7 +45,7 @@ namespace Spek {
var button_box = new HBox (false, 0);
button_box.spacing = 3;
var close_button = new Button ();
- close_button.image = new Gtk.Image.from_stock (STOCK_CLOSE, IconSize.MENU);
+ close_button.image = new Gtk.Image.from_stock (Stock.CLOSE, IconSize.MENU);
close_button.relief = ReliefStyle.NONE;
close_button.clicked.connect (() => hide ());
diff --git a/src/spek-pipeline.vala b/src/spek-pipeline.vala
@@ -45,13 +45,8 @@ namespace Spek {
private float[] input;
private float[] output;
-#if VALA_0_12
private unowned Thread<void*> reader_thread = null;
private unowned Thread<void*> worker_thread;
-#else
- private unowned Thread reader_thread = null;
- private unowned Thread worker_thread;
-#endif
private Mutex reader_mutex;
private Cond reader_cond;
private Mutex worker_mutex;
@@ -123,11 +118,7 @@ namespace Spek {
worker_cond = new Cond ();
try {
-#if VALA_0_12
reader_thread = Thread.create<void*> (reader_func, true);
-#else
- reader_thread = Thread.create (reader_func, true);
-#endif
} catch (ThreadError e) {
stop ();
}
@@ -153,11 +144,7 @@ namespace Spek {
int size;
try {
-#if VALA_0_12
worker_thread = Thread.create<void*> (worker_func, true);
-#else
- worker_thread = Thread.create (worker_func, true);
-#endif
} catch (ThreadError e) {
return null;
}
diff --git a/src/spek-preferences-dialog.vala b/src/spek-preferences-dialog.vala
@@ -89,7 +89,7 @@ namespace Spek {
vbox.pack_start (alignment, false, false, 0);
vbox.show_all ();
- add_button (STOCK_CLOSE, ResponseType.CLOSE);
+ add_button (Stock.CLOSE, ResponseType.CLOSE);
set_default_response (ResponseType.CLOSE);
response.connect (on_response);
}
diff --git a/src/spek-window.vala b/src/spek-window.vala
@@ -33,13 +33,13 @@ namespace Spek {
private const ActionEntry[] ACTION_ENTRIES = {
{ "File", null, N_("_File") },
- { "FileOpen", STOCK_OPEN, null, null, null, on_file_open },
- { "FileSave", STOCK_SAVE, null, null, null, on_file_save },
- { "FileQuit", STOCK_QUIT, null, null, null, on_file_quit },
+ { "FileOpen", Stock.OPEN, null, null, null, on_file_open },
+ { "FileSave", Stock.SAVE, null, null, null, on_file_save },
+ { "FileQuit", Stock.QUIT, null, null, null, on_file_quit },
{ "Edit", null, N_("_Edit") },
- { "EditPreferences", STOCK_PREFERENCES, null, "<Ctrl>E", null, on_edit_preferences },
+ { "EditPreferences", Stock.PREFERENCES, null, "<Ctrl>E", null, on_edit_preferences },
{ "Help", null, N_("_Help") },
- { "HelpAbout", STOCK_ABOUT, null, "F1", null, on_help_about }
+ { "HelpAbout", Stock.ABOUT, null, "F1", null, on_help_about }
};
private const string UI = """
@@ -137,11 +137,7 @@ namespace Spek {
}
try {
-#if VALA_0_12
Thread.create<void*> (check_version, false);
-#else
- Thread.create (check_version, false);
-#endif
} catch (ThreadError e) {
}
}
@@ -171,8 +167,8 @@ namespace Spek {
private void on_file_open () {
var chooser = new FileChooserDialog (
_("Open File"), this, FileChooserAction.OPEN,
- STOCK_CANCEL, ResponseType.CANCEL,
- STOCK_OPEN, ResponseType.ACCEPT, null);
+ Stock.CANCEL, ResponseType.CANCEL,
+ Stock.OPEN, ResponseType.ACCEPT, null);
chooser.set_default_response (ResponseType.ACCEPT);
chooser.select_multiple = false;
chooser.set_current_folder (cur_dir);
@@ -188,8 +184,8 @@ namespace Spek {
private void on_file_save () {
var chooser = new FileChooserDialog (
_("Save Spectrogram"), this, FileChooserAction.SAVE,
- STOCK_CANCEL, ResponseType.CANCEL,
- STOCK_SAVE, ResponseType.ACCEPT, null);
+ Stock.CANCEL, ResponseType.CANCEL,
+ Stock.SAVE, ResponseType.ACCEPT, null);
chooser.set_default_response (ResponseType.ACCEPT);
chooser.set_current_folder (cur_dir);