66 g_assert(cmd != NULL);
68 if (g_spawn_command_line_async(cmd, &error) == FALSE) {
90 "Please open preferences and set the command you want " 91 "to run for volume control."));
110 "please specify one in preferences."));
123 if (response_id == GTK_RESPONSE_OK || response_id == GTK_RESPONSE_APPLY)
126 if (response_id != GTK_RESPONSE_APPLY) {
137 if (response_id == GTK_RESPONSE_OK || response_id == GTK_RESPONSE_APPLY) {
195 vsnprintf(err_buf,
sizeof err_buf, fmt, ap);
198 ERROR(
"%s", err_buf);
204 GTK_DIALOG_DESTROY_WITH_PARENT,
209 g_object_set(dialog,
"text", err_buf, NULL);
210 gtk_window_set_title(GTK_WINDOW(dialog),
_(
"PNMixer Error"));
211 gtk_dialog_run(GTK_DIALOG(dialog));
212 gtk_widget_destroy(dialog);
228 ERROR(
"Connection with audio failed, " 229 "you probably need to restart pnmixer.");
232 return GTK_RESPONSE_NO;
234 dialog = gtk_message_dialog_new
236 GTK_DIALOG_DESTROY_WITH_PARENT,
239 _(
"Warning: Connection to sound system failed."));
241 gtk_message_dialog_format_secondary_text
242 (GTK_MESSAGE_DIALOG(dialog),
243 _(
"Do you want to re-initialize the audio connection ?\n\n" 244 "If you do not, you will either need to restart PNMixer " 245 "or select the 'Reload Audio' option in the right-click " 246 "menu in order for PNMixer to function."));
248 gtk_window_set_title(GTK_WINDOW(dialog),
_(
"PNMixer Error"));
249 resp = gtk_dialog_run(GTK_DIALOG(dialog));
250 gtk_widget_destroy(dialog);
312 {
"version",
'v', 0, G_OPTION_ARG_NONE, &
version,
"Show version and exit", NULL },
313 {
"debug",
'd', 0, G_OPTION_ARG_NONE, &
want_debug,
"Run in debug mode", NULL },
314 { NULL, 0, 0, 0, NULL, NULL, NULL }
328 GOptionContext *context;
334 context = g_option_context_new(
_(
"- A mixer for the system tray."));
335 g_option_context_add_main_entries(context,
option_entries, GETTEXT_PACKAGE);
336 g_option_context_add_group(context, gtk_get_option_group(TRUE));
337 g_option_context_parse(context, &argc, &argv, NULL);
338 g_option_context_free(context);
342 printf(
_(
"%s version: %s\n"), PACKAGE, PACKAGE_VERSION);
347 gtk_init(&argc, &argv);
375 DEBUG(
"---- Running main loop ----");
377 DEBUG(
"---- Exiting main loop ----");
Internationalization support.
int main(int argc, char *argv[])
void hotkeys_free(Hotkeys *hotkeys)
void notif_reload(G_GNUC_UNUSED Notif *notif)
void audio_signals_disconnect(Audio *audio, AudioCallback callback, gpointer data)
void audio_signals_connect(Audio *audio, AudioCallback callback, gpointer data)
void prefs_dialog_present(PrefsDialog *dialog)
void hotkeys_reload(Hotkeys *hotkeys)
static PrefsDialog * prefs_dialog
void prefs_dialog_retrieve(PrefsDialog *dialog)
header for ui-about-dialog.c.
static GOptionEntry option_entries[]
void tray_icon_destroy(TrayIcon *icon)
static void prefs_dialog_response_cb(PrefsDialog *this_dialog, gint response_id)
void about_dialog_run(AboutDialog *dialog)
static PopupWindow * popup_window
static void on_audio_changed(Audio *audio, AudioEvent *event, G_GNUC_UNUSED gpointer data)
PrefsDialog * prefs_dialog_create(GtkWindow *parent, Audio *audio, Hotkeys *hotkeys, PrefsDialogResponseCallback cb)
void run_mixer_command(void)
void run_custom_command(void)
AboutDialog * about_dialog_create(GtkWindow *parent)
static AboutDialog * about_dialog
static TrayIcon * tray_icon
Notif * notif_new(G_GNUC_UNUSED Audio *audio)
void do_show_popup_menu(GtkMenuPositionFunc func, gpointer data, guint button, guint activate_time)
gchar * prefs_get_string(const gchar *key, const gchar *def)
void prefs_ensure_save_dir(void)
void run_prefs_dialog(void)
static GtkWindow * main_window
Hotkeys * hotkeys_new(Audio *audio)
Header for ui-prefs-dialog.c.
void run_error_dialog(const char *fmt,...)
void about_dialog_destroy(AboutDialog *dialog)
static void run_command(const gchar *cmd)
void tray_icon_reload(TrayIcon *icon)
void prefs_dialog_populate(PrefsDialog *dialog)
static PopupMenu * popup_menu
TrayIcon * tray_icon_create(Audio *audio)
void audio_free(Audio *audio)
void audio_reload(Audio *audio)
gint run_audio_error_dialog(void)
void notif_free(G_GNUC_UNUSED Notif *notif)
void run_about_dialog(void)
Header for ui-tray-icon.c.
void prefs_dialog_destroy(PrefsDialog *dialog)
void do_toggle_popup_window(void)