mirror of
https://github.com/claunia/apprepodbmgr.git
synced 2025-12-16 19:24:42 +00:00
Refactor: Separate engine code from GUI.
This commit is contained in:
@@ -25,68 +25,21 @@
|
||||
// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
//
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using Gtk;
|
||||
using Schemas;
|
||||
using osrepodbmgr.Core;
|
||||
|
||||
namespace osrepodbmgr
|
||||
{
|
||||
static class MainClass
|
||||
{
|
||||
public static List<string> files;
|
||||
public static Dictionary<string, DBFile> hashes;
|
||||
public static string path;
|
||||
public static DBEntry dbInfo;
|
||||
public static bool unarUsable;
|
||||
public delegate void UnarChangeStatusDelegate();
|
||||
public static event UnarChangeStatusDelegate UnarChangeStatus;
|
||||
public static string tmpFolder;
|
||||
public static long noFilesInArchive;
|
||||
public static string archiveFormat;
|
||||
public static Process unarProcess;
|
||||
public static bool copyArchive;
|
||||
public static string selectedFile;
|
||||
public static OpticalDiscType workingDisc;
|
||||
public static BlockMediaType workingDisk;
|
||||
public static CICMMetadataType metadata;
|
||||
|
||||
public static void Main(string[] args)
|
||||
{
|
||||
Settings.LoadSettings();
|
||||
CheckUnar();
|
||||
Core.Settings.LoadSettings();
|
||||
Context.CheckUnar();
|
||||
Application.Init();
|
||||
frmAdd win = new frmAdd();
|
||||
win.Show();
|
||||
Application.Run();
|
||||
}
|
||||
|
||||
public static void CheckUnar()
|
||||
{
|
||||
Core.Finished += CheckUnarFinished;
|
||||
Core.Failed += CheckUnarFailed;
|
||||
|
||||
Thread thdCheckUnar = new Thread(Core.CheckUnar);
|
||||
thdCheckUnar.Start();
|
||||
}
|
||||
|
||||
static void CheckUnarFinished()
|
||||
{
|
||||
unarUsable = true;
|
||||
if(UnarChangeStatus != null)
|
||||
UnarChangeStatus();
|
||||
Core.Finished -= CheckUnarFinished;
|
||||
Core.Failed -= CheckUnarFailed;
|
||||
}
|
||||
|
||||
static void CheckUnarFailed(string text)
|
||||
{
|
||||
unarUsable = false;
|
||||
if(UnarChangeStatus != null)
|
||||
UnarChangeStatus();
|
||||
Core.Finished -= CheckUnarFinished;
|
||||
Core.Failed -= CheckUnarFailed;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user