Esempio n. 1
0
        private void buttonAccept_Click(object sender, EventArgs e)
        {
            using (var tasker = new Tasks.Tasker(this))
            {
                tasker.AttachView(new Tasks.TaskerTaskbar());
                tasker.AttachView(new Tasks.TaskerForm());
                var task = new Tasks.GameTask();
                for (int i = 0; i < listViewGames.Items.Count; ++i)
                {
                    var gameItem = listViewGames.Items[i];
                    if (gameItem.SubItems[4].Text != Resources.DefaultNoChange)
                    {
                        var game = gameItem.Tag as NesApplication;
                        foreach (var coverMatch in game.CoverArtMatches)
                        {
                            if (Path.GetFileName(coverMatch) == gameItem.SubItems[4].Text)
                            {
                                task.GamesChanged[game] = coverMatch;
                                break;
                            }
                        }
                    }
                }
                tasker.AddTask(task.SetCoverArtForMultipleGames);
                var conclusion = tasker.Start();
            }

            DialogResult = DialogResult.OK;
            Close();
        }
Esempio n. 2
0
        public Tasker.Conclusion UploadGames(Tasker tasker, Object syncObject = null)
        {
            // get specialized view
            transferForm = tasker.GetSpecificViews <TaskerTransferForm>().First();

            // set up progress bar
            tasker.SetTitle(Resources.UploadGames);
            tasker.SetState(Tasker.State.Starting);
            tasker.SetStatusImage(Resources.sign_up);

            // safeguards
            if (!hakchi.Shell.IsOnline || Games == null || Games.Count == 0)
            {
                return(Tasker.Conclusion.Error);
            }

            // set up upload path
            if (ConfigIni.Instance.UploadToTmp)
            {
                uploadPath = remoteTempDirectory;
            }
            else
            {
                uploadPath = hakchi.GetRemoteGameSyncPath(ConfigIni.Instance.ConsoleType);
            }

            // add sub-tasks
            tasker.AddTask(BuildMenu, 0);
            tasker.AddTask(BuildFiles, 1);
            tasker.AddTask(CheckRemoteStorageRequirements, 1);
            tasker.AddTask(PrepareRemoteTransfer, 1);
            tasker.AddTask(CalculateRemoteDiff, 1);
            if (ConfigIni.Instance.ForceSSHTransfers || hakchi.Shell is clovershell.ClovershellConnection)
            {
                tasker.AddTask(SyncRemoteGamesShell, 28);
            }
            else if (hakchi.Shell is INetworkShell)
            {
                tasker.AddTask(SyncRemoteGamesFTP, 28);
            }
            tasker.AddTask(RemoteCleanup, 1);
            tasker.AddTask(LinkGames, 1);
            tasker.AddTask(ShellTasks.SyncConfig, 1);

            return(Tasker.Conclusion.Success);
        }
Esempio n. 3
0
        public Tasker.Conclusion ExportGames(Tasker tasker, Object syncObject = null)
        {
            // get specialized view
            transferForm = tasker.GetSpecificViews <TaskerTransferForm>().First();

            // set up progress bar
            tasker.SetTitle(Resources.ExportGames);
            tasker.SetState(Tasker.State.Starting);
            tasker.SetStatusImage(Resources.sign_up);

            // safeguard
            if (Games == null || Games.Count == 0)
            {
                return(Tasker.Conclusion.Error);
            }

            // add sub-tasks
            tasker.AddTask(ShowExportDialog, 0);
            tasker.AddTask(BuildMenu, 0);
            tasker.AddTask(BuildFiles, 1);
            tasker.AddTask(CheckLocalStorageRequirements, 1);
            tasker.AddTask(CalculateLocalDiff, 1);
            tasker.AddTask(SyncLocalGames, 12);

            return(Tasker.Conclusion.Success);
        }
Esempio n. 4
0
        private void buttonImport_Click(object sender, EventArgs e)
        {
            if (listViewGames.SelectedItems.Count > 0)
            {
                gameCopied = true;
                using (var tasker = new Tasks.Tasker(this))
                {
                    tasker.AttachView(new TaskerTaskbar());
                    tasker.AttachView(new TaskerForm());
                    tasker.SetTitle(Resources.CopyingGames);
                    if (hakchi.Shell.IsOnline)
                    {
                        foreach (var game in SelectedGames)
                        {
                            tasker.AddTask(GameCopyTask(game));
                        }
                    }

                    tasker.Start();
                }
            }
        }