setting for jack conf tool
This commit is contained in:
parent
d66d57ae8a
commit
e85a6e96fe
|
@ -94,4 +94,7 @@
|
||||||
#define LADISH_DBUS_ERROR_UNFINISHED_TASK DBUS_NAME_BASE ".Error.UnfinishedTask"
|
#define LADISH_DBUS_ERROR_UNFINISHED_TASK DBUS_NAME_BASE ".Error.UnfinishedTask"
|
||||||
#define LADISH_DBUS_ERROR_KEY_NOT_FOUND DBUS_NAME_BASE ".Error.KeyNotFound"
|
#define LADISH_DBUS_ERROR_KEY_NOT_FOUND DBUS_NAME_BASE ".Error.KeyNotFound"
|
||||||
|
|
||||||
|
#define LADISH_CONF_KEY_JACK_CONF_TOOL "/org/ladish/jack_conf_tool"
|
||||||
|
#define LADISH_CONF_KEY_JACK_CONF_TOOL_DEFAULT "ladiconf"
|
||||||
|
|
||||||
#endif /* #ifndef DBUS_CONSTANTS_H__C21DE0EE_C19C_42F0_8D63_D613E4806C0E__INCLUDED */
|
#endif /* #ifndef DBUS_CONSTANTS_H__C21DE0EE_C19C_42F0_8D63_D613E4806C0E__INCLUDED */
|
||||||
|
|
|
@ -1741,7 +1741,7 @@ along with LADI Session Handler; if not, write to the Free Software Foundation,
|
||||||
<object class="GtkTable" id="settings_string_table">
|
<object class="GtkTable" id="settings_string_table">
|
||||||
<property name="column_spacing">5</property>
|
<property name="column_spacing">5</property>
|
||||||
<property name="n_columns">2</property>
|
<property name="n_columns">2</property>
|
||||||
<property name="n_rows">3</property>
|
<property name="n_rows">4</property>
|
||||||
<property name="row_spacing">5</property>
|
<property name="row_spacing">5</property>
|
||||||
<property name="visible">True</property>
|
<property name="visible">True</property>
|
||||||
<child>
|
<child>
|
||||||
|
@ -1813,6 +1813,30 @@ along with LADI Session Handler; if not, write to the Free Software Foundation,
|
||||||
<property name="top_attach">2</property>
|
<property name="top_attach">2</property>
|
||||||
</packing>
|
</packing>
|
||||||
</child>
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkLabel" id="settings_jack_conf_tool_label">
|
||||||
|
<property name="label" translatable="yes">JACK conf tool:</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
<property name="xalign">0</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="bottom_attach">4</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
|
<child>
|
||||||
|
<object class="GtkEntry" id="settings_jack_conf_tool_entry">
|
||||||
|
<property name="can_focus">True</property>
|
||||||
|
<property name="invisible_char">●</property>
|
||||||
|
<property name="visible">True</property>
|
||||||
|
</object>
|
||||||
|
<packing>
|
||||||
|
<property name="bottom_attach">4</property>
|
||||||
|
<property name="left_attach">1</property>
|
||||||
|
<property name="right_attach">2</property>
|
||||||
|
<property name="top_attach">3</property>
|
||||||
|
</packing>
|
||||||
|
</child>
|
||||||
</object>
|
</object>
|
||||||
<packing>
|
<packing>
|
||||||
<property name="left_attach">1</property>
|
<property name="left_attach">1</property>
|
||||||
|
|
13
gui/jack.c
13
gui/jack.c
|
@ -34,6 +34,7 @@
|
||||||
#include "action.h"
|
#include "action.h"
|
||||||
#include "../proxies/jack_proxy.h"
|
#include "../proxies/jack_proxy.h"
|
||||||
#include "../proxies/a2j_proxy.h"
|
#include "../proxies/a2j_proxy.h"
|
||||||
|
#include "../proxies/conf_proxy.h"
|
||||||
#include "gtk_builder.h"
|
#include "gtk_builder.h"
|
||||||
#include "ask_dialog.h"
|
#include "ask_dialog.h"
|
||||||
|
|
||||||
|
@ -282,11 +283,19 @@ void menu_request_a2jmidid_exit(void)
|
||||||
void menu_request_jack_configure(void)
|
void menu_request_jack_configure(void)
|
||||||
{
|
{
|
||||||
GError * error_ptr;
|
GError * error_ptr;
|
||||||
gchar * argv[] = {"ladiconf", NULL};
|
gchar * argv[] = {NULL, NULL};
|
||||||
GtkWidget * dialog;
|
GtkWidget * dialog;
|
||||||
|
const char * jack_conf_tool;
|
||||||
|
|
||||||
log_info("JACK configure request");
|
log_info("JACK configure request");
|
||||||
|
|
||||||
|
if (!conf_get(LADISH_CONF_KEY_JACK_CONF_TOOL, &jack_conf_tool))
|
||||||
|
{
|
||||||
|
jack_conf_tool = LADISH_CONF_KEY_JACK_CONF_TOOL_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
|
argv[0] = (gchar *)jack_conf_tool;
|
||||||
|
|
||||||
error_ptr = NULL;
|
error_ptr = NULL;
|
||||||
if (!g_spawn_async(
|
if (!g_spawn_async(
|
||||||
NULL, /* working directory */
|
NULL, /* working directory */
|
||||||
|
@ -299,7 +308,7 @@ void menu_request_jack_configure(void)
|
||||||
&error_ptr))
|
&error_ptr))
|
||||||
{
|
{
|
||||||
dialog = get_gtk_builder_widget("error_dialog");
|
dialog = get_gtk_builder_widget("error_dialog");
|
||||||
gtk_message_dialog_set_markup(GTK_MESSAGE_DIALOG(dialog), _("<b><big>Error executing ladiconf.\nAre LADI Tools installed?</big></b>"));
|
gtk_message_dialog_set_markup(GTK_MESSAGE_DIALOG(dialog), _("<b><big>Error executing JACK configuration tool.\n</big></b>"));
|
||||||
gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(dialog), "%s", error_ptr->message);
|
gtk_message_dialog_format_secondary_markup(GTK_MESSAGE_DIALOG(dialog), "%s", error_ptr->message);
|
||||||
gtk_widget_show(dialog);
|
gtk_widget_show(dialog);
|
||||||
gtk_dialog_run(GTK_DIALOG(dialog));
|
gtk_dialog_run(GTK_DIALOG(dialog));
|
||||||
|
|
|
@ -166,6 +166,11 @@ int main(int argc, char** argv)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!conf_register(LADISH_CONF_KEY_JACK_CONF_TOOL, NULL, NULL))
|
||||||
|
{
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (!init_jack())
|
if (!init_jack())
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -38,17 +38,20 @@ void menu_request_settings(void)
|
||||||
GtkEntry * shell_entry;
|
GtkEntry * shell_entry;
|
||||||
GtkEntry * terminal_entry;
|
GtkEntry * terminal_entry;
|
||||||
GtkSpinButton * js_delay_spin;
|
GtkSpinButton * js_delay_spin;
|
||||||
|
GtkEntry * jack_conf_tool_entry;
|
||||||
bool autostart;
|
bool autostart;
|
||||||
bool notify;
|
bool notify;
|
||||||
const char * shell;
|
const char * shell;
|
||||||
const char * terminal;
|
const char * terminal;
|
||||||
unsigned int js_delay;
|
unsigned int js_delay;
|
||||||
|
const char * jack_conf_tool;
|
||||||
|
|
||||||
autostart_studio_button = GTK_TOGGLE_BUTTON(get_gtk_builder_widget("settings_studio_autostart_checkbutton"));
|
autostart_studio_button = GTK_TOGGLE_BUTTON(get_gtk_builder_widget("settings_studio_autostart_checkbutton"));
|
||||||
send_notifications_button = GTK_TOGGLE_BUTTON(get_gtk_builder_widget("settings_send_notifications_checkbutton"));
|
send_notifications_button = GTK_TOGGLE_BUTTON(get_gtk_builder_widget("settings_send_notifications_checkbutton"));
|
||||||
shell_entry = GTK_ENTRY(get_gtk_builder_widget("settings_shell_entry"));
|
shell_entry = GTK_ENTRY(get_gtk_builder_widget("settings_shell_entry"));
|
||||||
terminal_entry = GTK_ENTRY(get_gtk_builder_widget("settings_terminal_entry"));
|
terminal_entry = GTK_ENTRY(get_gtk_builder_widget("settings_terminal_entry"));
|
||||||
js_delay_spin = GTK_SPIN_BUTTON(get_gtk_builder_widget("settings_js_delay_spin"));
|
js_delay_spin = GTK_SPIN_BUTTON(get_gtk_builder_widget("settings_js_delay_spin"));
|
||||||
|
jack_conf_tool_entry = GTK_ENTRY(get_gtk_builder_widget("settings_jack_conf_tool_entry"));
|
||||||
|
|
||||||
dialog = GTK_DIALOG(get_gtk_builder_widget("settings_dialog"));
|
dialog = GTK_DIALOG(get_gtk_builder_widget("settings_dialog"));
|
||||||
|
|
||||||
|
@ -77,11 +80,17 @@ void menu_request_settings(void)
|
||||||
js_delay = LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY_DEFAULT;
|
js_delay = LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY_DEFAULT;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!conf_get(LADISH_CONF_KEY_JACK_CONF_TOOL, &jack_conf_tool))
|
||||||
|
{
|
||||||
|
jack_conf_tool = LADISH_CONF_KEY_JACK_CONF_TOOL_DEFAULT;
|
||||||
|
}
|
||||||
|
|
||||||
gtk_toggle_button_set_active(autostart_studio_button, autostart);
|
gtk_toggle_button_set_active(autostart_studio_button, autostart);
|
||||||
gtk_toggle_button_set_active(send_notifications_button, notify);
|
gtk_toggle_button_set_active(send_notifications_button, notify);
|
||||||
|
|
||||||
gtk_entry_set_text(shell_entry, shell);
|
gtk_entry_set_text(shell_entry, shell);
|
||||||
gtk_entry_set_text(terminal_entry, terminal);
|
gtk_entry_set_text(terminal_entry, terminal);
|
||||||
|
gtk_entry_set_text(jack_conf_tool_entry, jack_conf_tool);
|
||||||
|
|
||||||
gtk_spin_button_set_range(js_delay_spin, 0, 1000);
|
gtk_spin_button_set_range(js_delay_spin, 0, 1000);
|
||||||
gtk_spin_button_set_increments(js_delay_spin, 1, 2);
|
gtk_spin_button_set_increments(js_delay_spin, 1, 2);
|
||||||
|
@ -100,12 +109,14 @@ void menu_request_settings(void)
|
||||||
shell = gtk_entry_get_text(shell_entry);
|
shell = gtk_entry_get_text(shell_entry);
|
||||||
terminal = gtk_entry_get_text(terminal_entry);
|
terminal = gtk_entry_get_text(terminal_entry);
|
||||||
js_delay = gtk_spin_button_get_value(js_delay_spin);
|
js_delay = gtk_spin_button_get_value(js_delay_spin);
|
||||||
|
jack_conf_tool = gtk_entry_get_text(jack_conf_tool_entry);
|
||||||
|
|
||||||
if (!conf_set_bool(LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART, autostart) ||
|
if (!conf_set_bool(LADISH_CONF_KEY_DAEMON_STUDIO_AUTOSTART, autostart) ||
|
||||||
!conf_set_bool(LADISH_CONF_KEY_DAEMON_NOTIFY, notify) ||
|
!conf_set_bool(LADISH_CONF_KEY_DAEMON_NOTIFY, notify) ||
|
||||||
!conf_set(LADISH_CONF_KEY_DAEMON_SHELL, shell) ||
|
!conf_set(LADISH_CONF_KEY_DAEMON_SHELL, shell) ||
|
||||||
!conf_set(LADISH_CONF_KEY_DAEMON_TERMINAL, terminal) ||
|
!conf_set(LADISH_CONF_KEY_DAEMON_TERMINAL, terminal) ||
|
||||||
!conf_set_uint(LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY, js_delay))
|
!conf_set_uint(LADISH_CONF_KEY_DAEMON_JS_SAVE_DELAY, js_delay) ||
|
||||||
|
!conf_set(LADISH_CONF_KEY_JACK_CONF_TOOL, jack_conf_tool))
|
||||||
{
|
{
|
||||||
error_message_box(_("Storing settings"));
|
error_message_box(_("Storing settings"));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue