[SCM] calf/master: Merge branch 'master' into style
js at users.alioth.debian.org
js at users.alioth.debian.org
Tue May 7 15:39:57 UTC 2013
+ JACK host: fix compilation with LASH (thanks Joeboy&drobilla) and printf format warning (thanks drobilla)
+ JACK host: implement file open functionality
+ JACK host: implemented Save/Save as...; Open not implemented yet - who could possibly want THAT?
+ JACK host: add open/save dialogs (still no implementation of the actual open/save of the rack), fix shortcut in Save as action
+ JACK host: add dummy options for file open/save, stock IDs and accelerator handling
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
X-Git-Refname: refs/heads/master
X-Git-Reftype: branch
X-Git-Oldrev: d6a3c1a63a147948535a50da009275278ad5e6a3
X-Git-Newrev: 34569260c452f0fa4c543155ebba174a42a343dc
The following commit has been merged in the master branch:
commit e6ecbf7c145592a78d747b301730c176d62f550e
Merge: 2f633ff27909dabc3c541a126f947b3a036c686f bfe3a83f1596a9ae13df8cde17eabf2213e15f1a
Author: Markus Schmidt <schmidt at boomshop.net>
Date: Tue Mar 2 23:39:11 2010 +0100
Merge branch 'master' into style
diff --combined src/main_win.cpp
index 5fb97e5,e420c3c..1940016
--- a/src/main_win.cpp
+++ b/src/main_win.cpp
@@@ -33,25 -33,46 +33,46 @@@ using namespace std
static const char *ui_xml =
"<ui>\n"
" <menubar>\n"
- " <menu action=\"HostMenuAction\">\n"
- " <menu action=\"AddPluginMenuAction\">\n"
- " </menu>\n"
+ " <menu action=\"FileMenuAction\">\n"
+ " <menuitem action=\"FileOpen\"/>\n"
+ " <menuitem action=\"FileSave\"/>\n"
+ " <menuitem action=\"FileSaveAs\"/>\n"
" <separator/>\n"
- " <menuitem action=\"exit\"/>\n"
+ " <menuitem action=\"FileQuit\"/>\n"
" </menu>\n"
+ " <menu action=\"AddPluginMenuAction\" />\n"
" </menubar>\n"
"</ui>\n"
;
+ static void open_action(GtkWidget *widget, main_window *main)
+ {
+ main->open_file();
+ }
+
+ static void save_action(GtkWidget *widget, main_window *main)
+ {
+ main->save_file();
+ }
+
+ static void save_as_action(GtkWidget *widget, main_window *main)
+ {
+ main->save_file_as();
+ }
+
static void exit_action(GtkWidget *widget, main_window *main)
{
gtk_widget_destroy(GTK_WIDGET(main->toplevel));
}
static const GtkActionEntry actions[] = {
+ { "FileMenuAction", NULL, "_File", NULL, "File-related operations", NULL },
+ { "FileOpen", GTK_STOCK_OPEN, "_Open", "<Ctrl>O", "Open a rack file", (GCallback)open_action },
+ { "FileSave", GTK_STOCK_SAVE, "_Save", "<Ctrl>S", "Save a rack file", (GCallback)save_action },
+ { "FileSaveAs", GTK_STOCK_SAVE_AS, "Save _as...", NULL, "Save a rack file as", (GCallback)save_as_action },
{ "HostMenuAction", NULL, "_Host", NULL, "Host-related operations", NULL },
{ "AddPluginMenuAction", NULL, "_Add plugin", NULL, "Add a plugin to the rack", NULL },
- { "exit", "exit", "_Exit", NULL, "Exit application", (GCallback)exit_action },
+ { "FileQuit", GTK_STOCK_QUIT, "_Quit", "<Ctrl>Q", "Exit application", (GCallback)exit_action },
};
main_window::main_window()
@@@ -140,7 -161,12 +161,7 @@@ void main_window::set_window(plugin_ctl
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(strip->button), gui_win != NULL);
GtkToggleButton *tb = GTK_TOGGLE_BUTTON(strip->button);
- if (strip->gui_win) {
- gtk_button_set_label(GTK_BUTTON(tb), "Hide");
- } else {
- gtk_button_set_label(GTK_BUTTON(tb), "Show");
- }
-
+ gtk_button_set_label(GTK_BUTTON(tb), "Edit");
}
void main_window::refresh_all_presets(bool builtin_too)
@@@ -164,8 -190,10 +185,8 @@@ gui_button_pressed(GtkWidget *button, m
if (strip->gui_win) {
strip->gui_win->close();
strip->gui_win = NULL;
- gtk_button_set_label(GTK_BUTTON(tb), "Show");
} else {
strip->main_win->open_gui(strip->plugin);
- gtk_button_set_label(GTK_BUTTON(tb), "Hide");
}
return TRUE;
}
@@@ -237,7 -265,7 +258,7 @@@ main_window::plugin_strip *main_window:
gtk_widget_show(title);
// open button
- GtkWidget *label = gtk_toggle_button_new_with_label("Show");
+ GtkWidget *label = gtk_toggle_button_new_with_label("Edit");
strip->button = label;
gtk_widget_set_size_request(GTK_WIDGET(label), 110, -1);
gtk_signal_connect(GTK_OBJECT(label), "toggled", G_CALLBACK(gui_button_pressed),
@@@ -445,7 -473,6 +466,6 @@@ void main_window::create(
string plugin_xml = make_plugin_list(plugin_actions);
gtk_ui_manager_insert_action_group(ui_mgr, plugin_actions, 0);
gtk_ui_manager_add_ui_from_string(ui_mgr, plugin_xml.c_str(), -1, &error);
-
strips_table = gtk_table_new(0, 6, FALSE);
gtk_table_set_col_spacings(GTK_TABLE(strips_table), 0);
@@@ -476,6 -503,7 +496,7 @@@
gtk_widget_set_name(GTK_WIDGET(strips_table), "Calf-Container");
+ gtk_window_add_accel_group(toplevel, gtk_ui_manager_get_accel_group(ui_mgr));
gtk_widget_show_all(GTK_WIDGET(toplevel));
source_id = g_timeout_add_full(G_PRIORITY_LOW, 1000/30, on_idle, this, NULL); // 30 fps should be enough for everybody
}
@@@ -535,3 -563,68 +556,68 @@@ gboolean main_window::on_idle(void *dat
}
return TRUE;
}
+
+ void main_window::open_file()
+ {
+ GtkWidget *dialog;
+ dialog = gtk_file_chooser_dialog_new ("Open File",
+ toplevel,
+ GTK_FILE_CHOOSER_ACTION_OPEN,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+ NULL);
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+ {
+ char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+ char *error = owner->open_file(filename);
+ if (error)
+ display_error(error, filename);
+ else
+ current_filename = filename;
+ g_free (filename);
+ free (error);
+ }
+ gtk_widget_destroy (dialog);
+ }
+
+ void main_window::save_file()
+ {
+ if (!current_filename.empty()) {
+ const char *error = owner->save_file(current_filename.c_str());
+ if (error)
+ display_error(error, current_filename.c_str());
+ }
+ else
+ save_file_as();
+ }
+
+ void main_window::save_file_as()
+ {
+ GtkWidget *dialog;
+ dialog = gtk_file_chooser_dialog_new ("Save File",
+ toplevel,
+ GTK_FILE_CHOOSER_ACTION_SAVE,
+ GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+ GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ NULL);
+ if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT)
+ {
+ char *filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
+ char *error = owner->save_file(filename);
+ if (error)
+ display_error(error, filename);
+ else
+ current_filename = filename;
+ g_free (filename);
+ free(error);
+ }
+ gtk_widget_destroy (dialog);
+ }
+
+ void main_window::display_error(const char *error, const char *filename)
+ {
+ GtkWidget *dialog;
+ dialog = gtk_message_dialog_new_with_markup (toplevel, GTK_DIALOG_DESTROY_WITH_PARENT, GTK_MESSAGE_ERROR, GTK_BUTTONS_CLOSE, error, filename, NULL);
+ gtk_dialog_run (GTK_DIALOG (dialog));
+ gtk_widget_destroy (dialog);
+ }
--
calf audio plugins packaging
More information about the pkg-multimedia-commits
mailing list