]> www.fi.muni.cz Git - evince.git/blobdiff - shell/main.c
Updated Czech translation.
[evince.git] / shell / main.c
index fba38a790359cbe46b4379ca087a9aea958119e0..932e327979d8c8bce1cf3f3779747f328bb578e6 100644 (file)
@@ -38,7 +38,6 @@
 #endif
 
 #include "ev-stock-icons.h"
 #endif
 
 #include "ev-stock-icons.h"
-#include "ev-debug.h"
 #include "ev-job-queue.h"
 #include "ev-file-helpers.h"
 
 #include "ev-job-queue.h"
 #include "ev-file-helpers.h"
 
@@ -55,7 +54,7 @@ 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 },
        { "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-temp-file", 'u', G_OPTION_FLAG_HIDDEN, G_OPTION_ARG_NONE, &unlink_temp_file, NULL, 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_OPTION_REMAINING, 0, 0, G_OPTION_ARG_FILENAME_ARRAY, &file_arguments, NULL, N_("[FILE...]") },
        { NULL }
 };
@@ -67,6 +66,24 @@ value_free (GValue *value)
        g_free (value);
 }
 
        g_free (value);
 }
 
+/**
+ * arguments_parse:
+ *
+ * Parses the arguments and creates a #GHashTable with this data.
+ *
+ *  key                 ->  value
+ *
+ *  dislay              ->  display at the default screen.
+ *  screen              ->  screen number.
+ *  page-label          ->  only if the page label argument has been passed,
+ *                          the page of the document to display.
+ *  mode                ->  only if the view mode is one of the availables,
+ *                          the view mode.
+ *  unlink-temp-file    ->  only if the view mode is preview mode and
+ *                          unlink-temp-file has been passed, unlink-temp-file.
+ *
+ * Returns: a pointer into #GHashTable with data from the arguments.
+ */
 static GHashTable *
 arguments_parse (void)
 {
 static GHashTable *
 arguments_parse (void)
 {
@@ -181,7 +198,6 @@ load_files (const char **files,
 }
 
 #ifdef ENABLE_DBUS
 }
 
 #ifdef ENABLE_DBUS
-
 static gboolean
 load_files_remote (const char **files,
                   GHashTable  *args)
 static gboolean
 load_files_remote (const char **files,
                   GHashTable  *args)
@@ -190,9 +206,6 @@ load_files_remote (const char **files,
        GError *error = NULL;
        DBusGConnection *connection;
        gboolean result = FALSE;
        GError *error = NULL;
        DBusGConnection *connection;
        gboolean result = FALSE;
-#if DBUS_VERSION < 35
-       DBusGPendingCall *call;
-#endif
        DBusGProxy *remote_object;
        GdkDisplay *display;
        guint32 timestamp;
        DBusGProxy *remote_object;
        GdkDisplay *display;
        guint32 timestamp;
@@ -213,31 +226,6 @@ load_files_remote (const char **files,
                                                    "/org/gnome/evince/Evince",
                                                    "org.gnome.evince.Application");
        if (!files) {
                                                    "/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, &timestamp,
-                                               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,
                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,
@@ -249,7 +237,7 @@ load_files_remote (const char **files,
                        dbus_g_connection_unref (connection);
                        return FALSE;
                }
                        dbus_g_connection_unref (connection);
                        return FALSE;
                }
-#endif
+
                g_object_unref (remote_object);
                dbus_g_connection_unref (connection);
                
                g_object_unref (remote_object);
                dbus_g_connection_unref (connection);
                
@@ -262,33 +250,7 @@ load_files_remote (const char **files,
 
                uri = gnome_vfs_make_uri_from_shell_arg (files[i]);
                page_label = ev_page_label ? ev_page_label : "";
 
                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, &timestamp,
-                                               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,
                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,
@@ -300,7 +262,7 @@ load_files_remote (const char **files,
                        g_free (uri);
                        continue;
                }
                        g_free (uri);
                        continue;
                }
-#endif
+
                g_free (uri);
                result = TRUE;
         }
                g_free (uri);
                result = TRUE;
         }
@@ -356,7 +318,6 @@ main (int argc, char *argv[])
        }
 #endif
        
        }
 #endif
        
-       gdk_threads_init ();
        gnome_authentication_manager_init ();
 
        if (enable_metadata) {
        gnome_authentication_manager_init ();
 
        if (enable_metadata) {
@@ -367,7 +328,6 @@ main (int argc, char *argv[])
        g_set_application_name (_("Evince Document Viewer"));
 
        ev_file_helpers_init ();
        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");
 
        ev_stock_icons_init ();
        gtk_window_set_default_icon_name ("evince");