Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
core
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
LibreOffice
core
Commits
fb0a28df
Kaydet (Commit)
fb0a28df
authored
Agu 23, 2012
tarafından
Andrzej J.R. Hunt
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Removal of manually added servers.
Change-Id: Ia46eccb8c7ace05054e952f49e2a2c65a462b83f
üst
4908c8d7
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
73 additions
and
29 deletions
+73
-29
selector_contextmenu.xml
android/sdremote/res/menu/selector_contextmenu.xml
+5
-0
strings.xml
android/sdremote/res/values/strings.xml
+1
-0
SelectorActivity.java
...e/src/org/libreoffice/impressremote/SelectorActivity.java
+39
-15
CommunicationService.java
...ice/impressremote/communication/CommunicationService.java
+28
-14
No files found.
android/sdremote/res/menu/selector_contextmenu.xml
0 → 100644
Dosyayı görüntüle @
fb0a28df
<?xml version="1.0" encoding="utf-8"?>
<menu
xmlns:android=
"http://schemas.android.com/apk/res/android"
>
<item
android:id=
"@+id/selector_context_delete"
android:title=
"@string/selector_delete"
></item>
</menu>
\ No newline at end of file
android/sdremote/res/values/strings.xml
Dosyayı görüntüle @
fb0a28df
...
@@ -23,6 +23,7 @@
...
@@ -23,6 +23,7 @@
<string
name=
"bluetooth"
>
Bluetooth
</string>
<string
name=
"bluetooth"
>
Bluetooth
</string>
<string
name=
"wifi"
>
WI-FI
</string>
<string
name=
"wifi"
>
WI-FI
</string>
<string
name=
"selector_noservers"
>
Searching for computers…
</string>
<string
name=
"selector_noservers"
>
Searching for computers…
</string>
<string
name=
"selector_delete"
>
Remove server
</string>
<string
name=
"pairing_instructions_1"
>
In Impress, click on the "Slideshow" menu and select "Impress Remote".
</string>
<string
name=
"pairing_instructions_1"
>
In Impress, click on the "Slideshow" menu and select "Impress Remote".
</string>
<string
name=
"pairing_instructions_2_deviceName"
>
Choose \"{0}\" as your device.
</string>
<string
name=
"pairing_instructions_2_deviceName"
>
Choose \"{0}\" as your device.
</string>
<string
name=
"pairing_instructions_3"
>
Then input this PIN:
</string>
<string
name=
"pairing_instructions_3"
>
Then input this PIN:
</string>
...
...
android/sdremote/src/org/libreoffice/impressremote/SelectorActivity.java
Dosyayı görüntüle @
fb0a28df
...
@@ -95,11 +95,6 @@ public class SelectorActivity extends SherlockActivity {
...
@@ -95,11 +95,6 @@ public class SelectorActivity extends SherlockActivity {
final
View
layout
=
inflater
.
inflate
(
R
.
layout
.
dialog_addserver
,
final
View
layout
=
inflater
.
inflate
(
R
.
layout
.
dialog_addserver
,
null
);
null
);
// TextView text = (TextView) layout.findViewById(R.id.text);
// text.setText("Hello, this is a custom dialog!");
// ImageView image = (ImageView) layout.findViewById(R.id.image);
// image.setImageResource(R.drawable.android);
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
=
new
AlertDialog
.
Builder
(
this
);
builder
.
setView
(
layout
);
builder
.
setView
(
layout
);
builder
.
setTitle
(
R
.
string
.
addserver
);
builder
.
setTitle
(
R
.
string
.
addserver
);
...
@@ -128,16 +123,6 @@ public class SelectorActivity extends SherlockActivity {
...
@@ -128,16 +123,6 @@ public class SelectorActivity extends SherlockActivity {
alertDialog
=
builder
.
create
();
alertDialog
=
builder
.
create
();
alertDialog
.
show
();
alertDialog
.
show
();
// Context mContext = getApplicationContext();
// Dialog dialog = new Dialog(mContext);
//
// dialog.setContentView(R.layout.dialog_addserver);
// dialog.setTitle(R.string.addserver);
// TextView text = (TextView) dialog.findViewById(R.id.text);
// text.setText("Hello, this is a custom dialog!");
// ImageView image = (ImageView) dialog.findViewById(R.id.image);
// image.setImageResource(R.drawable.android);
return
true
;
return
true
;
}
}
return
super
.
onOptionsItemSelected
(
item
);
return
super
.
onOptionsItemSelected
(
item
);
...
@@ -213,6 +198,20 @@ public class SelectorActivity extends SherlockActivity {
...
@@ -213,6 +198,20 @@ public class SelectorActivity extends SherlockActivity {
private
HashMap
<
Server
,
View
>
mBluetoothServers
=
new
HashMap
<
Server
,
View
>();
private
HashMap
<
Server
,
View
>
mBluetoothServers
=
new
HashMap
<
Server
,
View
>();
private
HashMap
<
Server
,
View
>
mNetworkServers
=
new
HashMap
<
Server
,
View
>();
private
HashMap
<
Server
,
View
>
mNetworkServers
=
new
HashMap
<
Server
,
View
>();
private
void
deleteServer
(
View
aView
)
{
for
(
Entry
<
Server
,
View
>
aEntry
:
mNetworkServers
.
entrySet
())
{
System
.
out
.
println
(
aEntry
.
getKey
().
getName
());
System
.
out
.
println
(
aView
);
System
.
out
.
println
(
aEntry
.
getValue
());
if
(
aEntry
.
getValue
()
==
aView
.
findViewById
(
R
.
id
.
selector_sub_label
)
||
aEntry
.
getValue
().
findViewById
(
R
.
id
.
selector_sub_label
)
==
aView
.
findViewById
(
R
.
id
.
selector_sub_label
))
mCommunicationService
.
removeServer
(
aEntry
.
getKey
());
}
}
private
void
refreshLists
()
{
private
void
refreshLists
()
{
if
(
mCommunicationService
!=
null
)
{
if
(
mCommunicationService
!=
null
)
{
...
@@ -256,6 +255,9 @@ public class SelectorActivity extends SherlockActivity {
...
@@ -256,6 +255,9 @@ public class SelectorActivity extends SherlockActivity {
aText
.
setText
(
aServer
.
getName
());
aText
.
setText
(
aServer
.
getName
());
aLayout
.
addView
(
aView
);
aLayout
.
addView
(
aView
);
aMap
.
put
(
aServer
,
aText
);
aMap
.
put
(
aServer
,
aText
);
// registerForContextMenu(aView);
registerForContextMenu
(
aText
);
}
}
}
}
...
@@ -304,5 +306,26 @@ public class SelectorActivity extends SherlockActivity {
...
@@ -304,5 +306,26 @@ public class SelectorActivity extends SherlockActivity {
}
}
};
};
View
aLastSelected
=
null
;
public
void
onCreateContextMenu
(
android
.
view
.
ContextMenu
menu
,
View
v
,
android
.
view
.
ContextMenu
.
ContextMenuInfo
menuInfo
)
{
super
.
onCreateContextMenu
(
menu
,
v
,
menuInfo
);
aLastSelected
=
v
;
android
.
view
.
MenuInflater
inflater
=
getMenuInflater
();
inflater
.
inflate
(
R
.
menu
.
selector_contextmenu
,
menu
);
}
@Override
public
boolean
onContextItemSelected
(
android
.
view
.
MenuItem
item
)
{
switch
(
item
.
getItemId
())
{
case
R
.
id
.
selector_context_delete
:
deleteServer
(
aLastSelected
);
refreshLists
();
return
true
;
}
return
super
.
onContextItemSelected
(
item
);
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
android/sdremote/src/org/libreoffice/impressremote/communication/CommunicationService.java
Dosyayı görüntüle @
fb0a28df
...
@@ -215,6 +215,26 @@ public class CommunicationService extends Service implements Runnable {
...
@@ -215,6 +215,26 @@ public class CommunicationService extends Service implements Runnable {
return
mReceiver
.
isSlideShowRunning
();
return
mReceiver
.
isSlideShowRunning
();
}
}
/**
* Key to use with getSharedPreferences to obtain a Map of stored servers.
* The keys are the ip/hostnames, the values are the friendly names.
*/
private
static
final
String
SERVERSTORAGE_KEY
=
"sdremote_storedServers"
;
private
HashMap
<
String
,
Server
>
mManualServers
=
new
HashMap
<
String
,
Server
>();
void
loadServersFromPreferences
()
{
SharedPreferences
aPref
=
getSharedPreferences
(
SERVERSTORAGE_KEY
,
MODE_PRIVATE
);
Map
<
String
,
String
>
aStoredMap
=
(
Map
<
String
,
String
>)
aPref
.
getAll
();
for
(
Entry
<
String
,
String
>
aServerEntry
:
aStoredMap
.
entrySet
())
{
mManualServers
.
put
(
aServerEntry
.
getKey
(),
new
Server
(
Protocol
.
NETWORK
,
aServerEntry
.
getKey
(),
aServerEntry
.
getValue
(),
0
));
}
}
/**
/**
* Manually add a new (network) server to the list of servers.
* Manually add a new (network) server to the list of servers.
* @param aAddress
* @param aAddress
...
@@ -236,24 +256,17 @@ public class CommunicationService extends Service implements Runnable {
...
@@ -236,24 +256,17 @@ public class CommunicationService extends Service implements Runnable {
}
}
}
}
/**
public
void
removeServer
(
Server
aServer
)
{
* Key to use with getSharedPreferences to obtain a Map of stored servers.
* The keys are the ip/hostnames, the values are the friendly names.
mManualServers
.
remove
(
aServer
.
getAddress
());
*/
private
static
final
String
SERVERSTORAGE_KEY
=
"sdremote_storedServers"
;
private
HashMap
<
String
,
Server
>
mManualServers
=
new
HashMap
<
String
,
Server
>();
void
loadServersFromPreferences
()
{
SharedPreferences
aPref
=
getSharedPreferences
(
SERVERSTORAGE_KEY
,
SharedPreferences
aPref
=
getSharedPreferences
(
SERVERSTORAGE_KEY
,
MODE_PRIVATE
);
MODE_PRIVATE
);
Editor
aEditor
=
aPref
.
edit
();
aEditor
.
remove
(
aServer
.
getAddress
());
aEditor
.
apply
();
Map
<
String
,
String
>
aStoredMap
=
(
Map
<
String
,
String
>)
aPref
.
getAll
();
for
(
Entry
<
String
,
String
>
aServerEntry
:
aStoredMap
.
entrySet
())
{
mManualServers
.
put
(
aServerEntry
.
getKey
(),
new
Server
(
Protocol
.
NETWORK
,
aServerEntry
.
getKey
(),
aServerEntry
.
getValue
(),
0
));
}
}
}
}
}
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment