~ubuntu-branches/ubuntu/utopic/plotdrop/utopic

« back to all changes in this revision

Viewing changes to main.c

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2005-12-10 09:44:40 UTC
  • Revision ID: james.westby@ubuntu.com-20051210094440-3cva7z1cgmhmvxxw
Tags: upstream-0.5
ImportĀ upstreamĀ versionĀ 0.5

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
 
 
2
/* PlotDrop is free software, released under the GNU General Public License
 
3
 * See the COPYING file for licensing details.
 
4
 *
 
5
 * Copyright 2005 John Spray
 
6
 */
 
7
 
 
8
#include <libgnomevfs/gnome-vfs.h>
 
9
#include <glib.h>
 
10
 
 
11
#include "droplist.h"
 
12
#include "gnuplot.h"
 
13
 
 
14
 
 
15
int main(int argc, char **argv)
 
16
{
 
17
        gtk_set_locale ();
 
18
        gtk_init (&argc,&argv);
 
19
 
 
20
        gnome_vfs_init ();
 
21
 
 
22
        gchar *ver = gnuplot_get_version ();
 
23
        if (ver)
 
24
                fprintf (stdout, "Found gnuplot version '%s'\n", ver);
 
25
        else
 
26
                droplist_no_gnuplot ();
 
27
 
 
28
        droplist_init_gui ();
 
29
 
 
30
        if (argc > 1) {
 
31
                gchar *pwd = getcwd (NULL, 0); // g_get_current_dir?
 
32
 
 
33
                for (int i = 1; i < argc; ++i) {
 
34
                        if (argv[i][0] == '/'/*g_path_is_absolute (argv[i])*/) {
 
35
                                g_message ("filename absolute '%s'", argv[i]);
 
36
                                droplist_add_file (argv[i]);
 
37
                        } else {
 
38
                                gchar *tmp = g_build_filename (pwd, argv[i], NULL);
 
39
                                g_message ("built filename '%s'", tmp);
 
40
                                droplist_add_file (tmp);
 
41
                                g_free (tmp);
 
42
                        }
 
43
                }
 
44
 
 
45
                g_free (pwd);
 
46
        }
 
47
 
 
48
        gtk_main ();
 
49
}