diff options
| author | Matthew Parlane <parlane@gmail.com> | 2013-08-26 00:50:57 +0000 |
|---|---|---|
| committer | Matthew Parlane <parlane@gmail.com> | 2013-08-26 00:50:57 +0000 |
| commit | 15f8603d1ffabcdb407e166803323227461bf9ff (patch) | |
| tree | 861472658926f9ed6c2f9a5037aacd4ea932adaa /Source/Android | |
| parent | 72e0423f8ba46f0e24999bd65392faa40f74f1a4 (diff) | |
| parent | 0e8f9d8abcef26a4b17e7a38b001efbae0f83e8d (diff) | |
Merge branch 'master' into wii-network
Conflicts:
Source/Core/Common/Src/CommonPaths.h
Source/Core/Common/Src/FileUtil.cpp
Diffstat (limited to 'Source/Android')
8 files changed, 70 insertions, 25 deletions
diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java index 1f35a58f76..fe5a83bf92 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/AboutFragment.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu; import android.app.Activity; @@ -15,11 +21,7 @@ import org.dolphinemu.dolphinemu.folderbrowser.FolderBrowserAdapter; import org.dolphinemu.dolphinemu.folderbrowser.FolderBrowserItem; import org.dolphinemu.dolphinemu.settings.VideoSettingsFragment; -/** - * Copyright 2013 Dolphin Emulator Project - * Licensed under GPLv2 - * Refer to the license.txt file included. - */ + public final class AboutFragment extends Fragment { private static Activity m_activity; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java index a616df609a..ca3c637bfb 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/DolphinEmulator.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu; import android.app.Activity; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java b/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java index 2e38d98fef..d35b8a4adb 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/NativeGLSurfaceView.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu; import android.content.Context; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java index 55f88b3931..56fe57cb2e 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowser.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.folderbrowser; import android.app.Activity; @@ -131,15 +137,38 @@ public final class FolderBrowser extends Fragment // Cache the activity instance. m_activity = activity; } - - + + private void FolderSelected() { String Directories = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPathes", "0"); int intDirectories = Integer.parseInt(Directories); Directories = Integer.toString(intDirectories + 1); - NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", Directories); - NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(intDirectories), currentDir.getPath()); + + // Check to see if a path set in the Dolphin config + // matches the one the user is trying to add. If it's + // already set, then don't add it to the list again. + boolean pathNotPresent = true; + for (int i = 0; i < intDirectories; i++) + { + String gcmPath = NativeLibrary.GetConfig("Dolphin.ini", "General", "GCMPath" + i, ""); + + if (gcmPath.equals(currentDir.getPath())) + { + pathNotPresent = false; + } + else + { + pathNotPresent = true; + } + } + + // User doesn't have this path in the config, so add it. + if (pathNotPresent) + { + NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", Integer.toString(intDirectories+1)); + NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + Integer.toString(intDirectories), currentDir.getPath()); + } ((GameListActivity)m_activity).SwitchPage(0); } diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java index 6de1fbcb79..750f17141a 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserAdapter.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.folderbrowser; import java.util.List; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserItem.java b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserItem.java index 00e41852fa..eb0d27dcca 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserItem.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/folderbrowser/FolderBrowserItem.java @@ -1,3 +1,9 @@ +/** + * Copyright 2013 Dolphin Emulator Project + * Licensed under GPLv2 + * Refer to the license.txt file included. + */ + package org.dolphinemu.dolphinemu.folderbrowser; import java.io.File; diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListActivity.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListActivity.java index 3678cf7637..b12bff7ebc 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListActivity.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListActivity.java @@ -173,6 +173,7 @@ public final class GameListActivity extends Activity mCurFragment = new GameListFragment(); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction().replace(R.id.content_frame, mCurFragment).commit(); + invalidateOptionsMenu(); } break; @@ -182,6 +183,7 @@ public final class GameListActivity extends Activity mCurFragment = new FolderBrowser(); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction().replace(R.id.content_frame, mCurFragment).commit(); + invalidateOptionsMenu(); } break; @@ -198,6 +200,7 @@ public final class GameListActivity extends Activity mCurFragment = new InputConfigFragment(); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction().replace(R.id.content_frame, mCurFragment).commit(); + invalidateOptionsMenu(); } break; @@ -207,6 +210,7 @@ public final class GameListActivity extends Activity mCurFragment = new AboutFragment(); FragmentManager fragmentManager = getFragmentManager(); fragmentManager.beginTransaction().replace(R.id.content_frame, mCurFragment).commit(); + invalidateOptionsMenu(); } break; @@ -293,6 +297,8 @@ public final class GameListActivity extends Activity NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPath" + i, ""); } + NativeLibrary.SetConfig("Dolphin.ini", "General", "GCMPathes", "0"); + ArrayAdapter<GameListItem> adapter = ((GameListFragment)GameListActivity.this.mCurFragment).getAdapter(); adapter.clear(); adapter.notifyDataSetChanged(); diff --git a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java index b72509419f..6d4a4bfe22 100644 --- a/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java +++ b/Source/Android/src/org/dolphinemu/dolphinemu/gamelist/GameListFragment.java @@ -98,22 +98,6 @@ public final class GameListFragment extends Fragment } Collections.sort(fls); - // Remove any duplicate items from the list. - // We don't need to index these in the game list more than once. - // - // This works by comparing the paths of items in the file list for equality, - // so there should be no worries about accidentally removing a valid game. - for (int i = 0; i < fls.size(); i++) - { - for (int j = i+1; j < fls.size(); j++) - { - if (fls.get(j).getPath().equals(fls.get(i).getPath())) - { - fls.remove(j); - } - } - } - mGameAdapter = new GameListAdapter(mMe, R.layout.gamelist_layout, fls); mMainList.setAdapter(mGameAdapter); |
