Skip to content

Commit

Permalink
UI rewrite, search during initial load support
Browse files Browse the repository at this point in the history
  • Loading branch information
libgenapps committed Nov 20, 2017
1 parent 974ec79 commit 2149779
Show file tree
Hide file tree
Showing 85 changed files with 3,206 additions and 2,822 deletions.
8 changes: 4 additions & 4 deletions App.config
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<startup>

<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup>
</configuration>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>
</configuration>
17 changes: 17 additions & 0 deletions App.xaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<Application x:Class="LibgenDesktop.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
ShutdownMode="OnExplicitShutdown">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Red.xaml" />
<ResourceDictionary Source="Views\Styles\CommonStyles.xaml" />
<ResourceDictionary Source="Views\Styles\WindowStyles.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>
</Application>
16 changes: 16 additions & 0 deletions App.xaml.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using System.Windows;
using LibgenDesktop.Infrastructure;

namespace LibgenDesktop
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
base.OnStartup(e);
IWindowContext mainWindowContext = WindowManager.CreateWindow(RegisteredWindows.WindowKey.MAIN_WINDOW);
mainWindowContext.Closed += (sender, args) => Shutdown();
mainWindowContext.Show();
}
}
}
85 changes: 0 additions & 85 deletions Cache/CachedDataAccessor.cs

This file was deleted.

63 changes: 0 additions & 63 deletions Cache/DataCache.cs

This file was deleted.

53 changes: 0 additions & 53 deletions Cache/LoadBooksOperation.cs

This file was deleted.

51 changes: 0 additions & 51 deletions Cache/SearchBooksOperation.cs

This file was deleted.

40 changes: 40 additions & 0 deletions Common/Constants.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
namespace LibgenDesktop.Common
{
internal static class Constants
{
public const int MAIN_WINDOW_MIN_WIDTH = 1000;
public const int MAIN_WINDOW_MIN_HEIGHT = 500;
public const int BOOK_WINDOW_MIN_WIDTH = 1000;
public const int BOOK_WINDOW_MIN_HEIGHT = 500;
public const int ERROR_WINDOW_MIN_WIDTH = 400;
public const int ERROR_WINDOW_MIN_HEIGHT = 300;
public const int TITLE_COLUMN_MIN_WIDTH = 150;
public const int AUTHORS_COLUMN_MIN_WIDTH = 150;
public const int SERIES_COLUMN_MIN_WIDTH = 150;
public const int YEAR_COLUMN_MIN_WIDTH = 60;
public const int PUBLISHER_COLUMN_MIN_WIDTH = 150;
public const int FORMAT_COLUMN_MIN_WIDTH = 80;
public const int FILESIZE_COLUMN_MIN_WIDTH = 130;
public const int OCR_COLUMN_MIN_WIDTH = 55;

public const string DEFAULT_DATABASE_FILE_NAME = "libgen.db";
public const int DEFAULT_MAIN_WINDOW_WIDTH = 1200;
public const int DEFAULT_MAIN_WINDOW_HEIGHT = 650;
public const int DEFAULT_BOOK_WINDOW_WIDTH = 1200;
public const int DEFAULT_BOOK_WINDOW_HEIGHT = 618;
public const int DEFAULT_TITLE_COLUMN_WIDTH = 200;
public const int DEFAULT_AUTHORS_COLUMN_WIDTH = 200;
public const int DEFAULT_SERIES_COLUMN_WIDTH = 180;
public const int DEFAULT_YEAR_COLUMN_WIDTH = 60;
public const int DEFAULT_PUBLISHER_COLUMN_WIDTH = 180;
public const int DEFAULT_FORMAT_COLUMN_WIDTH = 100;
public const int DEFAULT_FILESIZE_COLUMN_WIDTH = 150;
public const int DEFAULT_OCR_COLUMN_WIDTH = 55;

public const int SEARCH_REPORT_PROGRESS_BATCH_SIZE = 2000;
public const int INSERT_TRANSACTION_BATCH = 500;

public const string BOOK_COVER_URL_PREFIX = "http://libgen.io/covers/";
public const string BOOK_DOWNLOAD_URL_PREFIX = "http://libgen.io/book/index.php?md5=";
}
}
Loading

0 comments on commit 2149779

Please sign in to comment.