fix double quote in fr.po
[ardour.git] / gtk2_ardour / add_video_dialog.cc
index 44f61ec533034a449e85a8850d991e1687b623ca..126c1618126d9b10a18a30d2992227f4d891db79 100644 (file)
@@ -35,7 +35,7 @@
 
 #include "add_video_dialog.h"
 #include "utils_videotl.h"
-#include "i18n.h"
+#include "pbd/i18n.h"
 
 using namespace Gtk;
 using namespace std;
@@ -108,7 +108,7 @@ AddVideoDialog::AddVideoDialog (Session* s)
 
        /* file chooser */
        chooser.set_border_width (4);
-#ifdef GTKOSX
+#ifdef __APPLE__
        /* some broken redraw behaviour - this is a bandaid */
        chooser.signal_selection_changed().connect (mem_fun (chooser, &Widget::queue_draw));
 #endif
@@ -288,6 +288,7 @@ static bool check_video_file_extension(std::string file)
                ".webm"    , ".WEBM"    ,
                ".wmv"     , ".WMV"     ,
                ".ts"      , ".TS"      ,
+               ".mxf"     , ".MXF"     ,
        };
 
        for (size_t n = 0; n < sizeof(suffixes)/sizeof(suffixes[0]); ++n) {
@@ -321,8 +322,9 @@ AddVideoDialog::file_name (bool &local_file)
                std::string video_server_url = video_get_server_url(Config);
 
                /* check if video server is running locally */
-               if (video_get_docroot(Config).size() > 0
-                               && !video_server_url.compare(0, 16, "http://localhost"))
+               if (video_get_docroot(Config).size() > 0 &&
+                       (0 == video_server_url.compare (0, 16, "http://127.0.0.1") || 0 == video_server_url.compare (0, 16, "http://localhost"))
+                  )
                {
                        /* check if the file can be accessed */
                        int plen;
@@ -331,7 +333,7 @@ AddVideoDialog::file_name (bool &local_file)
                        char *ue = curl_easy_unescape(curl, uri.c_str(), uri.length(), &plen);
 #ifdef PLATFORM_WINDOWS
                        char *tmp;
-                       while (tmp = strchr(ue, '/')) *tmp = '\\';
+                       while ((tmp = strchr(ue, '/'))) *tmp = '\\';
 #endif
                        std::string path = video_get_docroot(Config) + ue;
                        if (!::access(path.c_str(), R_OK)) {
@@ -396,8 +398,7 @@ AddVideoDialog::file_selection_changed ()
        if (chooser.get_filename().size() > 0) {
                std::string path = chooser.get_filename();
                bool ok =
-                               check_video_file_extension(path)
-                               &&  Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_REGULAR | Glib::FILE_TEST_IS_SYMLINK)
+                               Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_REGULAR | Glib::FILE_TEST_IS_SYMLINK)
                                && !Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_DIR);
                set_action_ok(ok);
                if (ok) {
@@ -416,8 +417,7 @@ AddVideoDialog::file_activated ()
                std::string path = chooser.get_filename();
                // TODO check docroot -> set import options
                bool ok =
-                               check_video_file_extension(path)
-                               &&  Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_REGULAR | Glib::FILE_TEST_IS_SYMLINK)
+                               Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_REGULAR | Glib::FILE_TEST_IS_SYMLINK)
                                && !Glib::file_test(path.c_str(), Glib::FILE_TEST_IS_DIR);
                if (ok) {
                        Gtk::Dialog::response(RESPONSE_ACCEPT);