Added setting to change image server sharing url

This commit is contained in:
Sylvain Berfini 2012-11-09 10:39:55 +01:00
parent 00c1ee4586
commit 0de84b872b
8 changed files with 21 additions and 5 deletions

View file

@ -340,6 +340,7 @@
<string name="linphone_friend_new_request_desc">voudrait être partager son status avec vous et voir le votre.</string>
<string name="setup_ec_calibration">Calibration de l\'annulateur d\'écho en cours</string>
<string name="pref_image_sharing_server_title">Serveur de partage</string>
<string name="delete_contact">Supprimer contact</string>
<string name="sip_address">Adresse SIP</string>

View file

@ -7,7 +7,6 @@
<string name="default_domain">sip.linphone.org</string>
<string name="wizard_url">https://www.linphone.org/wizard.php</string>
<string name="upload_url">https://www.linphone.org:444/upload.php</string>
<!-- Interface settings -->
<bool name="use_simple_history">true</bool>

View file

@ -49,6 +49,7 @@
<bool name="pref_animation_enable_default">false</bool>
<bool name="pref_autostart_default">false</bool>
<string name="pref_incoming_call_timeout_default">30</string>
<string name="pref_image_sharing_server_default">https://www.linphone.org:444/upload.php</string>
<string name="pref_audio_use_specific_mode_default">0</string>
<bool name="pref_auto_accept_friends_default">false</bool>

View file

@ -96,6 +96,7 @@
<string name="pref_push_notification_key">pref_push_notification_key</string>
<string name="pref_auto_accept_friends_key">pref_auto_accept_friends_key</string>
<string name="pref_image_sharing_server_key">pref_image_sharing_server_key</string>
<string name="pref_video_port_key">pref_video_port_key</string>
<string name="pref_audio_port_key">pref_audio_port_key</string>

View file

@ -387,6 +387,7 @@
<string name="linphone_friend_new_request_title">Friend request</string>
<string name="linphone_friend_new_request_desc">wants to share it\'s presence status with you and be aware of yours.</string>
<string name="setup_ec_calibration">Echo canceller calibration in progress</string>
<string name="pref_image_sharing_server_title">Sharing server</string>
<string name="delete_contact">Delete contact</string>
<string name="sip_address">SIP address</string>

View file

@ -291,6 +291,11 @@
android:title="@string/pref_incoming_call_timeout_title"
android:defaultValue="@string/pref_incoming_call_timeout_default"
android:layout="@layout/hidden"/>
<EditTextPreference
android:key="@string/pref_image_sharing_server_key"
android:title="@string/pref_image_sharing_server_title"
android:defaultValue="@string/pref_image_sharing_server_default" />
<PreferenceScreen
android:title="@string/pref_audio_hacks_title"

View file

@ -173,7 +173,7 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
chatRoom = lc.createChatRoom(sipUri);
}
uploadServerUri = getActivity().getResources().getString(R.string.upload_url);
uploadServerUri = getActivity().getResources().getString(R.string.pref_image_sharing_server_key);
addVirtualKeyboardVisiblityListener();
message.addTextChangedListener(new TextWatcher() {
@ -641,9 +641,11 @@ public class ChatFragment extends Fragment implements OnClickListener, LinphoneC
String[] proj = { MediaStore.Images.Media.DATA };
CursorLoader loader = new CursorLoader(getActivity(), contentUri, proj, null, null, null);
Cursor cursor = loader.loadInBackground();
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
cursor.moveToFirst();
return cursor.getString(column_index);
if (cursor != null && cursor.moveToFirst()) {
int column_index = cursor.getColumnIndexOrThrow(MediaStore.Images.Media.DATA);
return cursor.getString(column_index);
}
return null;
}
private void showPopupMenuAskingImageSize(String filePath, Bitmap image) {

View file

@ -53,6 +53,7 @@ import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
import android.preference.CheckBoxPreference;
import android.preference.EditTextPreference;
import android.preference.ListPreference;
import android.preference.Preference;
import android.preference.Preference.OnPreferenceClickListener;
@ -106,6 +107,11 @@ public class PreferencesFragment extends PreferencesListFragment implements EcCa
friends.setLayoutResource(R.layout.hidden);
}
EditTextPreference imageSharingServer = (EditTextPreference) findPreference(getString(R.string.pref_image_sharing_server_key));
if (getResources().getBoolean(R.bool.disable_chat)) {
imageSharingServer.setLayoutResource(R.layout.hidden);
}
initializeTransportPreferences();
ecCalibratePref = findPreference(pref_echo_canceller_calibration_key);