aboutsummaryrefslogtreecommitdiff
path: root/src/spawn-printer-settings.c
blob: 320f2dacb2aadd9f0c900da626c30e7a33969910 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35

#include "spawn-printer-settings.h"

void
spawn_printer_settings ()
{
    spawn_printer_settings_with_args (NULL);
}


void
spawn_printer_settings_with_args (const gchar *fmt,
                                  ...)
{
    GString *cmdline;
    GError *err = NULL;

    cmdline = g_string_new ("system-config-printer ");

    if (fmt) {
        va_list args;
        va_start (args, fmt);
        g_string_append_vprintf (cmdline, fmt, args);
        va_end (args);
    }

    g_spawn_command_line_async (cmdline->str, &err);
    if (err) {
        g_warning ("Could not spawn printer settings: %s", err->message);
        g_error_free (err);
    }

    g_string_free (cmdline, TRUE);
}