2
#include "gof-directory-async.h"
3
#include "gof-window-slot.h"
4
#include "marlin-window-columns.h"
5
//#include <glib/gi18n.h>
7
#include "marlin-global-preferences.h"
8
#include "marlin-view-window.h"
10
#define _g_object_unref0(var) ((var == NULL) ? NULL : (var = (g_object_unref (var), NULL)))
13
static void about (void);
14
static void marlin_view_window_up (MarlinViewWindow *window);
15
static void marlin_view_window_path_changed (MarlinViewWindow *window, const gchar *path, gpointer data);
17
static void _vala_array_destroy (gpointer array, gint array_length, GDestroyNotify destroy_func) {
18
if ((array != NULL) && (destroy_func != NULL)) {
20
for (i = 0; i < array_length; i = i + 1) {
21
if (((gpointer*) array)[i] != NULL) {
22
destroy_func (((gpointer*) array)[i]);
28
static void _vala_array_free (gpointer array, gint array_length, GDestroyNotify destroy_func) {
29
_vala_array_destroy (array, array_length, destroy_func);
35
main (int argc, char *argv[])
37
MarlinViewWindow *window;
44
gtk_init (&argc, &argv);
45
/* Initialize gettext support */
46
bindtextdomain (GETTEXT_PACKAGE, GNOMELOCALEDIR);
47
bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
48
textdomain (GETTEXT_PACKAGE);
50
/* gsettings parameters */
51
//GSettings *settings;
52
settings = g_settings_new ("org.gnome.marlin.preferences");
53
/*gboolean showall = g_settings_get_boolean (settings, "showall");
54
printf ("test gsettings showall: %d\n", showall);*/
56
/*window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
57
gtk_window_set_title (GTK_WINDOW (window), "marlin");
58
gtk_window_set_default_size (GTK_WINDOW (window), 600, 300);
59
gtk_container_set_border_width (GTK_CONTAINER (window), 0);
60
g_signal_connect (window, "destroy", gtk_main_quit, NULL);*/
62
//GOFDirectoryAsync *mydir;
63
//MarlinWindowColumns *mwcols;
68
path = g_strdup(g_get_home_dir());
71
window = marlin_view_window_new (path);
73
g_signal_connect (window, "show-about", (GCallback) about, NULL);
74
g_signal_connect (window, "up", (GCallback) marlin_view_window_up, NULL);
75
/*g_signal_connect (window, "back", (GCallback) __lambda22__marlin_view_window_back, NULL);
76
g_signal_connect (window, "forward", (GCallback) __lambda23__marlin_view_window_forward, NULL);
77
g_signal_connect (window, "refresh", (GCallback) __lambda24__marlin_view_window_refresh, NULL);*/
78
g_signal_connect (window, "quit", (GCallback) gtk_main_quit, NULL);
79
g_signal_connect (window, "path-changed", (GCallback) marlin_view_window_path_changed, NULL);
83
slot = gof_window_slot_new(g_file_new_for_commandline_arg (path), GTK_WIDGET (window));
84
//mwcols = marlin_window_columns_new(g_file_new_for_commandline_arg (path), window);
86
//marlin_view_window_set_content (window, slot->view_box);
93
/* TODO Move this horror to a separate vala file */
94
static void about (void) {
95
GtkAboutDialog* _tmp0_ = NULL;
96
GtkAboutDialog* about;
99
gchar** _tmp3_ = NULL;
103
gchar** _tmp6_ = NULL;
106
_tmp0_ = (GtkAboutDialog*) gtk_about_dialog_new ();
107
about = g_object_ref_sink (_tmp0_);
108
gtk_about_dialog_set_program_name (about, "Marlin");
109
gtk_window_set_icon_name ((GtkWindow*) about, "system-file-manager");
110
gtk_about_dialog_set_logo_icon_name (about, "system-file-manager");
111
gtk_about_dialog_set_website (about, "http://www.elementary-project.com");
112
gtk_about_dialog_set_website_label (about, "elementary-project.com");
113
gtk_about_dialog_set_copyright (about, "Copyright 2010 elementary Developers");
114
_tmp1_ = g_strdup ("ammonkey <am.monkeyd@gmail.com>");
115
_tmp2_ = g_strdup ("Mathijs Henquet <mathijs.henquet@gmail.com>");
116
_tmp3_ = g_new0 (gchar*, 2 + 1);
121
gtk_about_dialog_set_authors (about, _tmp4_);
122
_tmp4_ = (_vala_array_free (_tmp4_, _tmp4__length1, (GDestroyNotify) g_free), NULL);
123
_tmp5_ = g_strdup ("Daniel Foré <dan@elementary-project.com>");
124
_tmp6_ = g_new0 (gchar*, 1 + 1);
128
gtk_about_dialog_set_artists (about, _tmp7_);
129
_tmp7_ = (_vala_array_free (_tmp7_, _tmp7__length1, (GDestroyNotify) g_free), NULL);
130
gtk_dialog_run ((GtkDialog*) about);
131
g_signal_emit_by_name ((GtkWidget*) about, "destroy");
132
_g_object_unref0 (about);
136
marlin_view_window_up (MarlinViewWindow *window)
141
if ((slot = GOF_WINDOW_SLOT (marlin_view_window_get_active_slot(window))) == NULL)
143
if (slot->location == NULL)
145
parent = g_file_get_parent (slot->location);
149
if (slot->mwcols != NULL)
150
marlin_window_columns_change_location (slot, parent);
152
gof_window_slot_change_location (slot, parent);
153
g_object_unref (parent);
157
marlin_view_window_path_changed (MarlinViewWindow *window, const gchar *path, gpointer data)
161
g_return_if_fail (path != NULL);
162
//fprintf (stdout, "signal: path_changed(%s)\n", path);
163
slot = gof_window_slot_new(g_file_new_for_commandline_arg (path), GTK_WIDGET (window));