misc: Organize ViewModels (#757)
This commit is contained in:
parent
e4b3ce9424
commit
74005bdbe9
7 changed files with 19 additions and 12 deletions
|
@ -12,4 +12,5 @@ This changelog only contains the changes that are unreleased. For changes for in
|
|||
|
||||
### Fixes
|
||||
|
||||
### Misc
|
||||
### Misc
|
||||
- Organize ViewModels
|
|
@ -54,14 +54,16 @@ import com.atlauncher.evnt.manager.RelocalizationManager;
|
|||
import com.atlauncher.gui.dialogs.LoginWithMicrosoftDialog;
|
||||
import com.atlauncher.gui.dialogs.ProgressDialog;
|
||||
import com.atlauncher.gui.tabs.Tab;
|
||||
import com.atlauncher.gui.tabs.accounts.IAccountsViewModel.LoginPostResult;
|
||||
import com.atlauncher.gui.tabs.accounts.IAccountsViewModel.LoginPreCheckResult;
|
||||
import com.atlauncher.viewmodel.base.IAccountsViewModel;
|
||||
import com.atlauncher.viewmodel.base.IAccountsViewModel.LoginPostResult;
|
||||
import com.atlauncher.viewmodel.base.IAccountsViewModel.LoginPreCheckResult;
|
||||
import com.atlauncher.managers.AccountManager;
|
||||
import com.atlauncher.managers.DialogManager;
|
||||
import com.atlauncher.managers.LogManager;
|
||||
import com.atlauncher.utils.ComboItem;
|
||||
import com.atlauncher.utils.OS;
|
||||
import com.atlauncher.utils.SkinUtils;
|
||||
import com.atlauncher.viewmodel.impl.AccountsViewModel;
|
||||
|
||||
public class AccountsTab extends JPanel implements Tab, RelocalizationListener {
|
||||
private static final long serialVersionUID = 2493791137600123223L;
|
||||
|
|
|
@ -37,6 +37,8 @@ import org.mini2Dx.gettext.GetText;
|
|||
|
||||
import com.atlauncher.gui.tabs.Tab;
|
||||
import com.atlauncher.utils.OS;
|
||||
import com.atlauncher.viewmodel.base.INewsViewModel;
|
||||
import com.atlauncher.viewmodel.impl.NewsViewModel;
|
||||
|
||||
/**
|
||||
* This class extends {@link JPanel} and provides a Panel for displaying the
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.atlauncher.gui.tabs.accounts;
|
||||
package com.atlauncher.viewmodel.base;
|
||||
|
||||
import com.atlauncher.data.AbstractAccount;
|
||||
import com.atlauncher.data.MicrosoftAccount;
|
||||
|
@ -182,7 +182,7 @@ public interface IAccountsViewModel {
|
|||
/**
|
||||
* The account already exists
|
||||
*/
|
||||
static class Exists extends LoginPreCheckResult {
|
||||
public static class Exists extends LoginPreCheckResult {
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -193,21 +193,21 @@ public interface IAccountsViewModel {
|
|||
/**
|
||||
* The account was added
|
||||
*/
|
||||
static class Added extends LoginPostResult {
|
||||
public static class Added extends LoginPostResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* The account was edited
|
||||
*/
|
||||
static class Edited extends LoginPostResult {
|
||||
public static class Edited extends LoginPostResult {
|
||||
}
|
||||
|
||||
/**
|
||||
* An error occured adding the account
|
||||
*/
|
||||
static class Error extends LoginPostResult {
|
||||
public static class Error extends LoginPostResult {
|
||||
@Nullable
|
||||
String errorContent;
|
||||
public final String errorContent;
|
||||
|
||||
public Error(@Nullable String errorContent) {
|
||||
this.errorContent = errorContent;
|
|
@ -15,7 +15,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.atlauncher.gui.tabs.news;
|
||||
package com.atlauncher.viewmodel.base;
|
||||
|
||||
import java.util.function.Consumer;
|
||||
|
|
@ -15,7 +15,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.atlauncher.gui.tabs.accounts;
|
||||
package com.atlauncher.viewmodel.impl;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
|
@ -35,6 +35,7 @@ import com.atlauncher.managers.LogManager;
|
|||
import com.atlauncher.network.Analytics;
|
||||
import com.atlauncher.network.analytics.AnalyticsEvent;
|
||||
import com.atlauncher.utils.Authentication;
|
||||
import com.atlauncher.viewmodel.base.IAccountsViewModel;
|
||||
|
||||
/**
|
||||
* 12 / 06 / 2022
|
|
@ -15,7 +15,7 @@
|
|||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package com.atlauncher.gui.tabs.news;
|
||||
package com.atlauncher.viewmodel.impl;
|
||||
|
||||
import java.util.concurrent.TimeUnit;
|
||||
import java.util.function.Consumer;
|
||||
|
@ -32,6 +32,7 @@ import com.atlauncher.managers.ConfigManager;
|
|||
import com.atlauncher.managers.LogManager;
|
||||
import com.atlauncher.managers.NewsManager;
|
||||
import com.atlauncher.network.GraphqlClient;
|
||||
import com.atlauncher.viewmodel.base.INewsViewModel;
|
||||
|
||||
public class NewsViewModel implements INewsViewModel {
|
||||
private Consumer<String> _onReload;
|
Loading…
Reference in a new issue