summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMike Blumenkrantz <m.blumenkran@samsung.com>2013-06-18 08:05:02 +0100
committerMike Blumenkrantz <m.blumenkran@samsung.com>2013-06-18 08:05:02 +0100
commitd3046a0b3ff2d9c9c7af3c0edd4b3a2ea15cbb5c (patch)
tree901d1690a7fb66c541b0f7f7886b702e176c5003 /src
parentfdac76d0d02e253a73cf8f1ccc699f3dacf2f4e7 (diff)
add teamwork option to disable videos
Diffstat (limited to 'src')
-rw-r--r--src/modules/teamwork/e_mod_config.c7
-rw-r--r--src/modules/teamwork/e_mod_main.c2
-rw-r--r--src/modules/teamwork/e_mod_main.h1
-rw-r--r--src/modules/teamwork/e_mod_tw.c7
4 files changed, 16 insertions, 1 deletions
diff --git a/src/modules/teamwork/e_mod_config.c b/src/modules/teamwork/e_mod_config.c
index 8050b535d..d50c4d45a 100644
--- a/src/modules/teamwork/e_mod_config.c
+++ b/src/modules/teamwork/e_mod_config.c
@@ -3,6 +3,7 @@
3struct _E_Config_Dialog_Data 3struct _E_Config_Dialog_Data
4{ 4{
5 int disable_media_fetch; 5 int disable_media_fetch;
6 int disable_video;
6 double allowed_media_size; 7 double allowed_media_size;
7 double allowed_media_fetch_size; 8 double allowed_media_fetch_size;
8 double allowed_media_age; 9 double allowed_media_age;
@@ -21,6 +22,7 @@ _create_data(E_Config_Dialog *cfd EINA_UNUSED)
21#define SET(X) \ 22#define SET(X) \
22 cfdata->X = tw_config->X 23 cfdata->X = tw_config->X
23 SET(disable_media_fetch); 24 SET(disable_media_fetch);
25 SET(disable_video);
24 SET(allowed_media_size); 26 SET(allowed_media_size);
25 SET(allowed_media_fetch_size); 27 SET(allowed_media_fetch_size);
26 SET(allowed_media_age); 28 SET(allowed_media_age);
@@ -46,6 +48,7 @@ _basic_check_changed(E_Config_Dialog *cfd EINA_UNUSED, E_Config_Dialog_Data *cfd
46 if (cfdata->X != tw_config->X) return 1 48 if (cfdata->X != tw_config->X) return 1
47 49
48 CHECK(disable_media_fetch); 50 CHECK(disable_media_fetch);
51 CHECK(disable_video);
49 if (lround(cfdata->allowed_media_age) != tw_config->allowed_media_age) return 1; 52 if (lround(cfdata->allowed_media_age) != tw_config->allowed_media_age) return 1;
50 if (lround(cfdata->allowed_media_size) != tw_config->allowed_media_size) return 1; 53 if (lround(cfdata->allowed_media_size) != tw_config->allowed_media_size) return 1;
51 if (lround(cfdata->allowed_media_fetch_size) != tw_config->allowed_media_fetch_size) return 1; 54 if (lround(cfdata->allowed_media_fetch_size) != tw_config->allowed_media_fetch_size) return 1;
@@ -97,6 +100,9 @@ _basic_create_widgets(E_Config_Dialog *cfd EINA_UNUSED,
97 100
98 ol = e_widget_list_add(evas, 0, 0); 101 ol = e_widget_list_add(evas, 0, 0);
99 102
103 ob = e_widget_check_add(evas, _("Disable video previews"), &cfdata->disable_video);
104 e_widget_list_object_append(ol, ob, 1, 0, 0.5);
105
100 ob = e_widget_label_add(evas, _("Mouse-out hide delay")); 106 ob = e_widget_label_add(evas, _("Mouse-out hide delay"));
101 e_widget_list_object_append(ol, ob, 1, 1, 0.5); 107 e_widget_list_object_append(ol, ob, 1, 1, 0.5);
102 ob = e_widget_slider_add(evas, 1, 0, _("%1.1f seconds"), 0, 5, 0.5, 0, &cfdata->mouse_out_delay, NULL, 150); 108 ob = e_widget_slider_add(evas, 1, 0, _("%1.1f seconds"), 0, 5, 0.5, 0, &cfdata->mouse_out_delay, NULL, 150);
@@ -126,6 +132,7 @@ _basic_apply_data(E_Config_Dialog *cfd EINA_UNUSED,
126 132
127#define SET(X) tw_config->X = cfdata->X 133#define SET(X) tw_config->X = cfdata->X
128 SET(disable_media_fetch); 134 SET(disable_media_fetch);
135 SET(disable_video);
129 SET(allowed_media_size); 136 SET(allowed_media_size);
130 SET(allowed_media_fetch_size); 137 SET(allowed_media_fetch_size);
131 SET(allowed_media_age); 138 SET(allowed_media_age);
diff --git a/src/modules/teamwork/e_mod_main.c b/src/modules/teamwork/e_mod_main.c
index 915798c14..0b3404e09 100644
--- a/src/modules/teamwork/e_mod_main.c
+++ b/src/modules/teamwork/e_mod_main.c
@@ -81,6 +81,7 @@ e_tw_config_dd_new(void)
81#define D conf_edd 81#define D conf_edd
82 E_CONFIG_VAL(D, T, config_version, UINT); 82 E_CONFIG_VAL(D, T, config_version, UINT);
83 E_CONFIG_VAL(D, T, disable_media_fetch, UCHAR); 83 E_CONFIG_VAL(D, T, disable_media_fetch, UCHAR);
84 E_CONFIG_VAL(D, T, disable_video, UCHAR);
84 E_CONFIG_VAL(D, T, allowed_media_size, LL); 85 E_CONFIG_VAL(D, T, allowed_media_size, LL);
85 E_CONFIG_VAL(D, T, allowed_media_fetch_size, LL); 86 E_CONFIG_VAL(D, T, allowed_media_fetch_size, LL);
86 E_CONFIG_VAL(D, T, allowed_media_age, INT); 87 E_CONFIG_VAL(D, T, allowed_media_age, INT);
@@ -153,6 +154,7 @@ e_modapi_init(E_Module *m)
153 co->info = eina_stringshare_add("applications/teamwork"); 154 co->info = eina_stringshare_add("applications/teamwork");
154 E_CONFIGURE_OPTION_ICON(co, buf); 155 E_CONFIGURE_OPTION_ICON(co, buf);
155 E_CONFIGURE_OPTION_ADD(co, BOOL, disable_media_fetch, tw_config, _("Disable Teamwork remote media fetching"), _("teamwork")); 156 E_CONFIGURE_OPTION_ADD(co, BOOL, disable_media_fetch, tw_config, _("Disable Teamwork remote media fetching"), _("teamwork"));
157 E_CONFIGURE_OPTION_ADD(co, BOOL, disable_video, tw_config, _("Disable Teamwork video popups"), _("teamwork"));
156 E_CONFIGURE_OPTION_ADD(co, DOUBLE, allowed_media_size, tw_config, _("Maximum total size of Teamwork media to keep in RAM"), _("teamwork"), _("cache")); 158 E_CONFIGURE_OPTION_ADD(co, DOUBLE, allowed_media_size, tw_config, _("Maximum total size of Teamwork media to keep in RAM"), _("teamwork"), _("cache"));
157 E_CONFIGURE_OPTION_MINMAX_STEP_FMT(co, 0, 1024, 16, _("%4.0f MiB")); 159 E_CONFIGURE_OPTION_MINMAX_STEP_FMT(co, 0, 1024, 16, _("%4.0f MiB"));
158 E_CONFIGURE_OPTION_ADD(co, DOUBLE, allowed_media_size, tw_config, _("Maximum size of remote media items to fetch with Teamwork"), _("teamwork"), _("cache")); 160 E_CONFIGURE_OPTION_ADD(co, DOUBLE, allowed_media_size, tw_config, _("Maximum size of remote media items to fetch with Teamwork"), _("teamwork"), _("cache"));
diff --git a/src/modules/teamwork/e_mod_main.h b/src/modules/teamwork/e_mod_main.h
index 9c13388b6..5e6faba69 100644
--- a/src/modules/teamwork/e_mod_main.h
+++ b/src/modules/teamwork/e_mod_main.h
@@ -18,6 +18,7 @@ typedef struct Teamwork_Config
18 unsigned int config_version; 18 unsigned int config_version;
19 19
20 Eina_Bool disable_media_fetch; 20 Eina_Bool disable_media_fetch;
21 Eina_Bool disable_video;
21 long long int allowed_media_size; 22 long long int allowed_media_size;
22 long long int allowed_media_fetch_size; 23 long long int allowed_media_fetch_size;
23 int allowed_media_age; 24 int allowed_media_age;
diff --git a/src/modules/teamwork/e_mod_tw.c b/src/modules/teamwork/e_mod_tw.c
index 68fd2e8a8..533bb81b8 100644
--- a/src/modules/teamwork/e_mod_tw.c
+++ b/src/modules/teamwork/e_mod_tw.c
@@ -954,6 +954,7 @@ tw_show(Media *i)
954 char buf[PATH_MAX]; 954 char buf[PATH_MAX];
955 const char *tmp; 955 const char *tmp;
956 956
957 if (tw_config->disable_video) return;
957 tmp = getenv("XDG_RUNTIME_DIR"); 958 tmp = getenv("XDG_RUNTIME_DIR");
958 if (!tmp) tmp = "/tmp"; 959 if (!tmp) tmp = "/tmp";
959 snprintf(buf, sizeof(buf), "%s/teamwork-%s-XXXXXX", tmp, ecore_file_file_get(i->addr)); 960 snprintf(buf, sizeof(buf), "%s/teamwork-%s-XXXXXX", tmp, ecore_file_file_get(i->addr));
@@ -1027,7 +1028,11 @@ tw_show_local_file(const char *uri)
1027#ifdef HAVE_EMOTION 1028#ifdef HAVE_EMOTION
1028 video = emotion_object_extension_may_play_get(uri); 1029 video = emotion_object_extension_may_play_get(uri);
1029#endif 1030#endif
1030 if (!video) 1031 if (video)
1032 {
1033 if (tw_config->disable_video) return;
1034 }
1035 else
1031 { 1036 {
1032 if (!evas_object_image_extension_can_load_get(uri)) return; 1037 if (!evas_object_image_extension_can_load_get(uri)) return;
1033 } 1038 }