mirror of
https://github.com/moparisthebest/keepass2android
synced 2025-01-09 12:38:02 -05:00
added option to copy an entry
This commit is contained in:
parent
ec4fe32b29
commit
017675e16e
@ -55,6 +55,7 @@
|
|||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Compile Include="database\CheckDatabaseForChanges.cs" />
|
<Compile Include="database\CheckDatabaseForChanges.cs" />
|
||||||
|
<Compile Include="database\edit\CopyEntry.cs" />
|
||||||
<Compile Include="database\edit\DeleteMultipleItems.cs" />
|
<Compile Include="database\edit\DeleteMultipleItems.cs" />
|
||||||
<Compile Include="database\edit\EditGroup.cs" />
|
<Compile Include="database\edit\EditGroup.cs" />
|
||||||
<Compile Include="database\edit\MoveElements.cs" />
|
<Compile Include="database\edit\MoveElements.cs" />
|
||||||
|
@ -62,6 +62,7 @@ namespace keepass2android
|
|||||||
DeletingItems,
|
DeletingItems,
|
||||||
AskDeletePermanentlyItems,
|
AskDeletePermanentlyItems,
|
||||||
AskDeletePermanentlyItemsNoRecycle,
|
AskDeletePermanentlyItemsNoRecycle,
|
||||||
InOfflineMode
|
InOfflineMode,
|
||||||
|
DuplicateTitle
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -813,12 +813,12 @@ namespace keepass2android
|
|||||||
{
|
{
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
Handler handler = new Handler();
|
||||||
switch (item.ItemId)
|
switch (item.ItemId)
|
||||||
{
|
{
|
||||||
|
|
||||||
case Resource.Id.menu_delete:
|
case Resource.Id.menu_delete:
|
||||||
Handler handler = new Handler();
|
|
||||||
DeleteMultipleItems task = new DeleteMultipleItems((GroupBaseActivity)Activity, App.Kp2a.GetDb(), checkedItems,
|
DeleteMultipleItems task = new DeleteMultipleItems((GroupBaseActivity)Activity, App.Kp2a.GetDb(), checkedItems,
|
||||||
new GroupBaseActivity.RefreshTask(handler, ((GroupBaseActivity)Activity)), App.Kp2a);
|
new GroupBaseActivity.RefreshTask(handler, ((GroupBaseActivity)Activity)), App.Kp2a);
|
||||||
task.Start();
|
task.Start();
|
||||||
@ -827,6 +827,15 @@ namespace keepass2android
|
|||||||
var navMove = new NavigateToFolderAndLaunchMoveElementTask(checkedItems.First().ParentGroup, checkedItems.Select(i => i.Uuid).ToList(), ((GroupBaseActivity)Activity).IsSearchResult);
|
var navMove = new NavigateToFolderAndLaunchMoveElementTask(checkedItems.First().ParentGroup, checkedItems.Select(i => i.Uuid).ToList(), ((GroupBaseActivity)Activity).IsSearchResult);
|
||||||
((GroupBaseActivity)Activity).StartTask(navMove);
|
((GroupBaseActivity)Activity).StartTask(navMove);
|
||||||
break;
|
break;
|
||||||
|
case Resource.Id.menu_copy:
|
||||||
|
|
||||||
|
var copyTask = new CopyEntry((GroupBaseActivity)Activity, App.Kp2a, (PwEntry) checkedItems.First(),
|
||||||
|
new GroupBaseActivity.RefreshTask(handler, ((GroupBaseActivity)Activity)));
|
||||||
|
|
||||||
|
ProgressTask pt = new ProgressTask(App.Kp2a, Activity, copyTask);
|
||||||
|
pt.Run();
|
||||||
|
break;
|
||||||
|
|
||||||
case Resource.Id.menu_navigate:
|
case Resource.Id.menu_navigate:
|
||||||
NavigateToFolder navNavigate = new NavigateToFolder(checkedItems.First().ParentGroup, true);
|
NavigateToFolder navNavigate = new NavigateToFolder(checkedItems.First().ParentGroup, true);
|
||||||
((GroupBaseActivity)Activity).StartTask(navNavigate);
|
((GroupBaseActivity)Activity).StartTask(navNavigate);
|
||||||
@ -897,6 +906,12 @@ namespace keepass2android
|
|||||||
{
|
{
|
||||||
menuItem.SetVisible(((GroupBaseActivity)Activity).IsSearchResult && IsOnlyOneItemChecked());
|
menuItem.SetVisible(((GroupBaseActivity)Activity).IsSearchResult && IsOnlyOneItemChecked());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
menuItem = mode.Menu.FindItem(Resource.Id.menu_copy);
|
||||||
|
if (menuItem != null)
|
||||||
|
{
|
||||||
|
menuItem.SetVisible(IsOnlyOneEntryChecked());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private bool IsOnlyOneGroupChecked()
|
private bool IsOnlyOneGroupChecked()
|
||||||
@ -949,6 +964,11 @@ namespace keepass2android
|
|||||||
}
|
}
|
||||||
return hadCheckedItem;
|
return hadCheckedItem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private bool IsOnlyOneEntryChecked()
|
||||||
|
{
|
||||||
|
return IsOnlyOneItemChecked() && !IsOnlyOneGroupChecked();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -10,6 +10,12 @@
|
|||||||
android:title="@string/menu_delete"
|
android:title="@string/menu_delete"
|
||||||
android:showAsAction="always"
|
android:showAsAction="always"
|
||||||
/>
|
/>
|
||||||
|
<item android:id="@+id/menu_copy"
|
||||||
|
android:icon="@drawable/ic_menu_copy_holo_light"
|
||||||
|
android:title="@string/menu_copy"
|
||||||
|
android:showAsAction="always"
|
||||||
|
/>
|
||||||
|
|
||||||
<item android:id="@+id/menu_move"
|
<item android:id="@+id/menu_move"
|
||||||
android:icon="@drawable/ic_menu_cut"
|
android:icon="@drawable/ic_menu_cut"
|
||||||
android:title="@string/menu_move"
|
android:title="@string/menu_move"
|
||||||
|
@ -156,6 +156,7 @@
|
|||||||
<string name="menu_app_settings">Settings</string>
|
<string name="menu_app_settings">Settings</string>
|
||||||
<string name="menu_db_settings">Database settings</string>
|
<string name="menu_db_settings">Database settings</string>
|
||||||
<string name="menu_delete">Delete</string>
|
<string name="menu_delete">Delete</string>
|
||||||
|
<string name="menu_copy">Create duplicate</string>
|
||||||
<string name="menu_move">Move to another group</string>
|
<string name="menu_move">Move to another group</string>
|
||||||
<string name="menu_move_light">Move</string>
|
<string name="menu_move_light">Move</string>
|
||||||
<string name="menu_navigate">Navigate to parent group</string>
|
<string name="menu_navigate">Navigate to parent group</string>
|
||||||
@ -554,6 +555,8 @@
|
|||||||
|
|
||||||
<string name="ChangeLog_title">Change log</string>
|
<string name="ChangeLog_title">Change log</string>
|
||||||
|
|
||||||
|
<string name="DuplicateTitle">Copy</string>
|
||||||
|
|
||||||
<string name="PreviewWarning">Please note! This is a preview release and might come with some flaws! If you experience *anything* unexpected, please let me know (on Codeplex or by email).</string>
|
<string name="PreviewWarning">Please note! This is a preview release and might come with some flaws! If you experience *anything* unexpected, please let me know (on Codeplex or by email).</string>
|
||||||
|
|
||||||
<string name="Continue">Continue</string>
|
<string name="Continue">Continue</string>
|
||||||
|
Loading…
Reference in New Issue
Block a user