* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
- * $Id$
*/
#include "config.h"
#endif
#include "ev-stock-icons.h"
-#include "ev-debug.h"
#include "ev-job-queue.h"
#include "ev-file-helpers.h"
static gboolean preview_mode = FALSE;
static gboolean fullscren_mode = FALSE;
static gboolean presentation_mode = FALSE;
+static gboolean unlink_temp_file = FALSE;
static const char **file_arguments = NULL;
static const GOptionEntry goption_options[] =
{ "fullscreen", 'f', 0, G_OPTION_ARG_NONE, &fullscren_mode, N_("Run evince in fullscreen mode"), NULL },
{ "presentation", 's', 0, G_OPTION_ARG_NONE, &presentation_mode, N_("Run evince in presentation mode"), NULL },
{ "preview", 'w', 0, G_OPTION_ARG_NONE, &preview_mode, N_("Run evince as a previewer"), NULL },
+ { "unlink-tempfile", 'u', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &unlink_temp_file, NULL, NULL },
{ G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &file_arguments, NULL, N_("[FILE...]") },
{ NULL }
};
g_hash_table_insert (args, g_strdup ("mode"), value);
+ if (mode == EV_WINDOW_MODE_PREVIEW && unlink_temp_file) {
+ value = g_new0 (GValue, 1);
+ g_value_init (value, G_TYPE_BOOLEAN);
+ g_value_set_boolean (value, unlink_temp_file);
+
+ g_hash_table_insert (args,
+ g_strdup ("unlink-temp-file"),
+ value);
+ }
+
return args;
}
}
#ifdef ENABLE_DBUS
-
static gboolean
load_files_remote (const char **files,
GHashTable *args)
GError *error = NULL;
DBusGConnection *connection;
gboolean result = FALSE;
-#if DBUS_VERSION < 35
- DBusGPendingCall *call;
-#endif
DBusGProxy *remote_object;
GdkDisplay *display;
guint32 timestamp;
"/org/gnome/evince/Evince",
"org.gnome.evince.Application");
if (!files) {
-#if DBUS_VERSION <= 33
- call = dbus_g_proxy_begin_call (remote_object, "OpenWindow",
- DBUS_TYPE_UINT32, ×tamp,
- DBUS_TYPE_INVALID);
-
- if (!dbus_g_proxy_end_call (remote_object, call, &error, DBUS_TYPE_INVALID)) {
- g_warning (error->message);
- g_clear_error (&error);
- g_object_unref (remote_object);
- dbus_g_connection_unref (connection);
- return FALSE;
- }
-#elif DBUS_VERSION == 34
- call = dbus_g_proxy_begin_call (remote_object, "OpenWindow",
- G_TYPE_UINT, timestamp,
- G_TYPE_INVALID);
-
- if (!dbus_g_proxy_end_call (remote_object, call, &error, G_TYPE_INVALID)) {
- g_warning (error->message);
- g_clear_error (&error);
- g_object_unref (remote_object);
- dbus_g_connection_unref (connection);
- return FALSE;
- }
-#else
if (!dbus_g_proxy_call (remote_object, "OpenWindow", &error,
dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), args,
G_TYPE_UINT, timestamp,
dbus_g_connection_unref (connection);
return FALSE;
}
-#endif
+
g_object_unref (remote_object);
dbus_g_connection_unref (connection);
uri = gnome_vfs_make_uri_from_shell_arg (files[i]);
page_label = ev_page_label ? ev_page_label : "";
-#if DBUS_VERSION <= 33
- call = dbus_g_proxy_begin_call (remote_object, "OpenURI",
- DBUS_TYPE_STRING, &uri,
- DBUS_TYPE_STRING, &page_label,
- DBUS_TYPE_UINT32, ×tamp,
- DBUS_TYPE_INVALID);
-
- if (!dbus_g_proxy_end_call (remote_object, call, &error, DBUS_TYPE_INVALID)) {
- g_warning (error->message);
- g_clear_error (&error);
- g_free (uri);
- continue;
- }
-#elif DBUS_VERSION == 34
- call = dbus_g_proxy_begin_call (remote_object, "OpenURI",
- G_TYPE_STRING, uri,
- G_TYPE_STRING, page_label,
- G_TYPE_UINT, timestamp,
- G_TYPE_INVALID);
-
- if (!dbus_g_proxy_end_call (remote_object, call, &error, G_TYPE_INVALID)) {
- g_warning (error->message);
- g_clear_error (&error);
- g_free (uri);
- continue;
- }
-#else
+
if (!dbus_g_proxy_call (remote_object, "OpenURI", &error,
G_TYPE_STRING, uri,
dbus_g_type_get_map ("GHashTable", G_TYPE_STRING, G_TYPE_VALUE), args,
g_free (uri);
continue;
}
-#endif
+
g_free (uri);
result = TRUE;
}
}
#endif
- gdk_threads_init ();
gnome_authentication_manager_init ();
if (enable_metadata) {
g_set_application_name (_("Evince Document Viewer"));
ev_file_helpers_init ();
- ev_debug_init ();
ev_stock_icons_init ();
gtk_window_set_default_icon_name ("evince");