add website settings ui #1020

This commit is contained in:
riderkick 2018-02-22 00:17:49 +08:00
parent 916bb89c59
commit fbedce2864
21 changed files with 444 additions and 859 deletions

View File

@ -81,7 +81,6 @@ var
FAVORITESDB_FILE,
CONFIG_FOLDER,
CONFIG_FILE,
CONFIG_ADVANCED,
REVISION_FILE,
UPDATE_FILE,
BASE_FILE,
@ -101,8 +100,7 @@ var
// ini files
revisionfile,
updatesfile: TIniFile;
configfile,
advancedfile: TIniFileRun;
configfile: TIniFileRun;
// base url, should be in base.ini
DEFAULT_SELECTED_WEBSITES: String = 'MangaFox,MangaHere,MangaInn,MangaReader';
@ -256,14 +254,12 @@ end;
procedure FreeIniFiles;
begin
FreeNil(configfile);
FreeNil(advancedfile);
end;
procedure SetIniFiles;
begin
FreeIniFiles;
configfile := TIniFileRun.Create(CONFIG_FILE);
advancedfile := TIniFileRun.Create(CONFIG_ADVANCED);
end;
procedure ReadBaseFile;
@ -316,7 +312,6 @@ begin
CONFIG_FOLDER := APPDATA_DIRECTORY + 'config' + PathDelim;
CONFIG_FILE := CONFIG_FOLDER + 'config.ini';
CONFIG_ADVANCED := CONFIG_FOLDER + 'advanced.ini';
ACCOUNTS_FILE := CONFIG_FOLDER + 'accounts.db';
MODULES_FILE := CONFIG_FOLDER + 'modules.json';
LUA_WEBSITEMODULE_FILE := CONFIG_FOLDER + 'luamodules.json';

View File

@ -16,6 +16,7 @@ var
isUpdating,
isPendingExitCounter,
isNormalExit: Boolean;
isStartup: Boolean = True;
//Instance
FMDInstance: TSimpleIPCServer;

View File

@ -70,7 +70,7 @@ type
{ TWebsiteModuleSettings }
TWebsiteModuleSettings = class
TWebsiteModuleSettings = class(TPersistent)
private
FCookies: String;
FMaxConnectionLimit: Integer;

View File

@ -22,7 +22,7 @@ uses
TAGraph, TASources, TASeries, TATools, AnimatedGif, uBaseUnit, uDownloadsManager,
uFavoritesManager, uUpdateThread, uSilentThread, uMisc,
uGetMangaInfosThread, frmDropTarget, frmAccountManager, frmWebsiteOptionCustom,
frmWebsiteOptionAdvanced, frmCustomColor, frmLogger, frmTransferFavorites,
frmCustomColor, frmLogger, frmTransferFavorites,
frmLuaModulesUpdater, CheckUpdate, accountmanagerdb, DBDataProcess, MangaFoxWatermark,
SimpleTranslator, FMDOptions, httpsendthread, SimpleException;
@ -679,6 +679,10 @@ type
gifWaiting: TAnimatedGif;
gifWaitingRect: TRect;
// embed form
procedure EmbedForm(const AForm: TForm; const AParent: TWinControl);
// generate >> nodes
procedure GeneratetvDownloadFilterNodes;
@ -920,9 +924,9 @@ implementation
{$R *.lfm}
uses
frmImportFavorites, frmShutdownCounter, frmSelectDirectory, WebsiteModules,
FMDVars, RegExpr, sqlite3dyn, Clipbrd, ssl_openssl_lib, LazFileUtils, LazUTF8,
webp, DBUpdater, LuaWebsiteModules;
frmImportFavorites, frmShutdownCounter, frmSelectDirectory,
frmWebsiteSettings, WebsiteModules, FMDVars, RegExpr, sqlite3dyn, Clipbrd,
ssl_openssl_lib, LazFileUtils, LazUTF8, webp, DBUpdater, LuaWebsiteModules;
var
// thread for open db
@ -1208,66 +1212,27 @@ begin
end;
// embed form
CustomColorForm := TCustomColorForm.Create(Self);
EmbedForm(CustomColorForm, tsCustomColor);
AccountManagerForm := TAccountManagerForm.Create(Self);
with AccountManagerForm do begin
Parent := tsAccounts;
Align := alClient;
ChildSizing.LeftRightSpacing := 0;
ChildSizing.TopBottomSpacing := 0;
Show;
if Screen.PixelsPerInch > 96 then
AutoAdjustLayout(lapAutoAdjustForDPI, Screen.PixelsPerInch, 96, 0, 0);
end;
EmbedForm(AccountManagerForm, tsAccounts);
WebsiteOptionCustomForm := TCustomOptionForm.Create(Self);
with WebsiteOptionCustomForm do
begin
Parent := sbWebsiteOptions;
BorderStyle := bsNone;
Align := alClient;
Show;
if Screen.PixelsPerInch > 96 then
AutoAdjustLayout(lapAutoAdjustForDPI, Screen.PixelsPerInch, 96, 0, 0);
end;
EmbedForm(WebsiteOptionCustomForm, sbWebsiteOptions);
WebsiteOptionAdvancedForm := TWebsiteOptionAdvancedForm.Create(Self);
with WebsiteOptionAdvancedForm do
begin
Parent := tsWebsiteAdvanced;
BorderStyle := bsNone;
Align := alClient;
Show;
if Screen.PixelsPerInch > 96 then
AutoAdjustLayout(lapAutoAdjustForDPI, Screen.PixelsPerInch, 96, 0, 0);
end;
WebsiteSettingsForm := TWebsiteSettingsForm.Create(Self);
EmbedForm(WebsiteSettingsForm, tsWebsiteAdvanced);
LuaModulesUpdaterForm := TLuaModulesUpdaterForm.Create(Self);
EmbedForm(LuaModulesUpdaterForm, tsWebsiteModules);
CustomColorForm := TCustomColorForm.Create(Self);
with CustomColorForm do
begin
Parent := tsCustomColor;
BorderStyle := bsNone;
Align := alClient;
Show;
if Screen.PixelsPerInch > 96 then
AutoAdjustLayout(lapAutoAdjustForDPI, Screen.PixelsPerInch, 96, 0, 0);
end;
AddVT(Self.vtMangaList);
AddVT(Self.clbChapterList);
AddVT(Self.vtDownload);
AddVT(Self.vtFavorites);
AddVT(Self.vtOptionMangaSiteSelection);
LuaModulesUpdaterForm := TLuaModulesUpdaterForm.Create(Self);
with LuaModulesUpdaterForm do
begin
Parent := tsWebsiteModules;
BorderStyle := bsNone;
Align := alClient;
Show;
if Screen.PixelsPerInch > 96 then
AutoAdjustLayout(lapAutoAdjustForDPI, Screen.PixelsPerInch, 96, 0, 0);
end;
// logger
FormLogger := TFormLogger.Create(Self);
@ -1797,7 +1762,11 @@ begin
ScanLuaWebsiteModulesFile;
AddToAboutStatus('Modules', IntToStr(Modules.Count));
// load configfile
Modules.LoadFromFile;
WebsiteOptionCustomForm.CreateWebsiteOption;
WebsiteSettingsForm.LoadWebsiteSettings;
//load configfile
LoadMangaOptions;
LoadOptions;
ApplyOptions;
@ -1809,9 +1778,6 @@ begin
FavoriteManager.Restore;
UpdateVtFavorites;
Modules.LoadFromFile;
frmWebsiteOptionCustom.WebsiteOptionCustomForm.CreateWebsiteOption;
if cbSelectManga.ItemIndex > -1 then
OpenDataDB(cbSelectManga.Items[cbSelectManga.ItemIndex]);
if OptionAutoCheckLatestVersion then
@ -1828,6 +1794,8 @@ begin
if Sender is TTimer then
TTimer(Sender).Free;
isStartup := False;
end;
procedure TMainForm.medURLCutClick(Sender: TObject);
@ -2499,6 +2467,19 @@ begin
ChapterList[i].Downloaded := False;
end;
procedure TMainForm.EmbedForm(const AForm: TForm; const AParent: TWinControl);
begin
with AForm do
begin
Parent := AParent;
BorderStyle := bsNone;
Align := alClient;
Show;
if Screen.PixelsPerInch > 96 then
AutoAdjustLayout(lapAutoAdjustForDPI, Screen.PixelsPerInch, 96, 0, 0);
end;
end;
procedure TMainForm.btVisitMyBlogClick(Sender: TObject);
begin
OpenURL('http://akarink.wordpress.com/');
@ -5273,6 +5254,7 @@ begin
end;
// add them to vt websites selection and availablewebsites
vtOptionMangaSiteSelection.BeginUpdate;
for i := 0 to categories.Count - 1 do
begin
node := vtOptionMangaSiteSelection.AddChild(nil, nil);
@ -5291,6 +5273,7 @@ begin
AvailableWebsites.Add(s);
end;
end;
vtOptionMangaSiteSelection.EndUpdate;
AvailableWebsites.Duplicates := dupIgnore;
AvailableWebsites.Sorted := True;
finally
@ -5716,7 +5699,8 @@ begin
tvDownloadFilterRefresh(True);
// refresh custom option
WebsiteOptionCustomForm.CreateWebsiteOption;
if not isStartup then
WebsiteOptionCustomForm.CreateWebsiteOption;
end;
end;
end;

View File

@ -1,431 +0,0 @@
object WebsiteOptionAdvancedForm: TWebsiteOptionAdvancedForm
Left = 235
Height = 307
Top = 142
Width = 510
ClientHeight = 307
ClientWidth = 510
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '1.9.0.0'
object pcAdvanced: TPageControl
Left = 0
Height = 307
Top = 0
Width = 510
ActivePage = tsCookies
Align = alClient
TabIndex = 0
TabOrder = 0
object tsCookies: TTabSheet
Caption = 'Cookies'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 4
ChildSizing.VerticalSpacing = 4
ClientHeight = 279
ClientWidth = 502
object vtCookies: TVirtualStringTree
Left = 6
Height = 267
Top = 6
Width = 490
Align = alClient
Colors.DropTargetBorderColor = clHotLight
Colors.FocusedSelectionBorderColor = clHotLight
Colors.SelectionRectangleBorderColor = clHotLight
Colors.UnfocusedSelectionBorderColor = clBtnShadow
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <
item
Position = 0
Text = 'Website'
end
item
Position = 1
Text = 'Cookies'
Width = 400
end>
Header.DefaultHeight = 23
Header.Height = 23
Header.Options = [hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
PopupMenu = pmCookies
TabOrder = 0
TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toGridExtensions, toInitOnSave, toToggleOnDblClick, toWheelPanning]
TreeOptions.PaintOptions = [toHideFocusRect, toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toFullVertGridLines]
TreeOptions.SelectionOptions = [toExtendedFocus, toRightClickSelect]
OnColumnDblClick = vtCookiesColumnDblClick
OnCompareNodes = vtCookiesCompareNodes
OnEditing = vtCookiesEditing
OnFreeNode = vtCookiesFreeNode
OnGetText = vtCookiesGetText
OnGetNodeDataSize = vtCookiesGetNodeDataSize
OnHeaderClick = vtCookiesHeaderClick
OnKeyDown = vtCookiesKeyDown
OnNewText = vtCookiesNewText
end
end
object tsUserAgent: TTabSheet
Caption = 'User Agent'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 4
ChildSizing.VerticalSpacing = 4
ClientHeight = 279
ClientWidth = 502
object vtUserAgent: TVirtualStringTree
Left = 6
Height = 267
Top = 6
Width = 490
Align = alClient
Colors.DropTargetBorderColor = clHotLight
Colors.FocusedSelectionBorderColor = clHotLight
Colors.SelectionRectangleBorderColor = clHotLight
Colors.UnfocusedSelectionBorderColor = clBtnShadow
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <
item
Position = 0
Text = 'Website'
end
item
Position = 1
Text = 'User Agent'
Width = 400
end>
Header.DefaultHeight = 23
Header.Height = 23
Header.Options = [hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
PopupMenu = pmCookies
TabOrder = 0
TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toGridExtensions, toInitOnSave, toToggleOnDblClick, toWheelPanning]
TreeOptions.PaintOptions = [toHideFocusRect, toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toFullVertGridLines]
TreeOptions.SelectionOptions = [toExtendedFocus, toRightClickSelect]
OnColumnDblClick = vtCookiesColumnDblClick
OnCompareNodes = vtCookiesCompareNodes
OnEditing = vtCookiesEditing
OnFreeNode = vtCookiesFreeNode
OnGetText = vtCookiesGetText
OnGetNodeDataSize = vtCookiesGetNodeDataSize
OnHeaderClick = vtCookiesHeaderClick
OnKeyDown = vtCookiesKeyDown
OnNewText = vtCookiesNewText
end
end
object tsDownloads: TTabSheet
Caption = 'Downloads'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 4
ChildSizing.VerticalSpacing = 4
ClientHeight = 279
ClientWidth = 502
object pcDownloads: TPageControl
Left = 6
Height = 267
Top = 6
Width = 490
ActivePage = tsMaxThreadsPerTask
Align = alClient
TabIndex = 0
TabOrder = 0
object tsMaxThreadsPerTask: TTabSheet
Caption = 'Max threads per task'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 4
ChildSizing.VerticalSpacing = 4
ClientHeight = 239
ClientWidth = 482
object vtDownloadMaxThreadsPerTask: TVirtualStringTree
Left = 6
Height = 227
Top = 6
Width = 470
Align = alClient
Colors.DropTargetBorderColor = clHotLight
Colors.FocusedSelectionBorderColor = clHotLight
Colors.SelectionRectangleBorderColor = clHotLight
Colors.UnfocusedSelectionBorderColor = clBtnShadow
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <
item
Position = 0
Text = 'Website'
end
item
Position = 1
Text = 'Value'
Width = 400
end>
Header.DefaultHeight = 23
Header.Height = 23
Header.Options = [hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
PopupMenu = pmCookies
TabOrder = 0
TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toGridExtensions, toInitOnSave, toToggleOnDblClick, toWheelPanning]
TreeOptions.PaintOptions = [toHideFocusRect, toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toFullVertGridLines]
TreeOptions.SelectionOptions = [toExtendedFocus, toRightClickSelect]
OnColumnDblClick = vtCookiesColumnDblClick
OnCompareNodes = vtCookiesCompareNodes
OnEditing = vtCookiesEditing
OnFreeNode = vtCookiesFreeNode
OnGetText = vtCookiesGetText
OnGetNodeDataSize = vtCookiesGetNodeDataSize
OnHeaderClick = vtCookiesHeaderClick
OnKeyDown = vtCookiesKeyDown
OnNewText = vtCookiesNewText
end
end
end
end
object tsUpdateList: TTabSheet
Caption = 'Update List'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 4
ChildSizing.VerticalSpacing = 4
ClientHeight = 279
ClientWidth = 502
object pcUpdateList: TPageControl
Left = 6
Height = 267
Top = 6
Width = 490
ActivePage = tsDirectoryPageNumber
Align = alClient
TabIndex = 0
TabOrder = 0
object tsDirectoryPageNumber: TTabSheet
Caption = 'Directory page number'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 4
ChildSizing.VerticalSpacing = 4
ClientHeight = 239
ClientWidth = 482
object vtUpdateListDirectoryPageNumber: TVirtualStringTree
Left = 6
Height = 227
Top = 6
Width = 470
Align = alClient
Colors.DropTargetBorderColor = clHotLight
Colors.FocusedSelectionBorderColor = clHotLight
Colors.SelectionRectangleBorderColor = clHotLight
Colors.UnfocusedSelectionBorderColor = clBtnShadow
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <
item
Position = 0
Text = 'Website'
end
item
Position = 1
Text = 'Value'
Width = 400
end>
Header.DefaultHeight = 23
Header.Height = 23
Header.Options = [hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
PopupMenu = pmCookies
TabOrder = 0
TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toGridExtensions, toInitOnSave, toToggleOnDblClick, toWheelPanning]
TreeOptions.PaintOptions = [toHideFocusRect, toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toFullVertGridLines]
TreeOptions.SelectionOptions = [toExtendedFocus, toRightClickSelect]
OnColumnDblClick = vtCookiesColumnDblClick
OnCompareNodes = vtCookiesCompareNodes
OnEditing = vtCookiesEditing
OnFreeNode = vtCookiesFreeNode
OnGetText = vtCookiesGetText
OnGetNodeDataSize = vtCookiesGetNodeDataSize
OnHeaderClick = vtCookiesHeaderClick
OnKeyDown = vtCookiesKeyDown
OnNewText = vtCookiesNewText
end
end
object tsNumberofThreads: TTabSheet
Caption = 'Number of threads'
ChildSizing.LeftRightSpacing = 6
ChildSizing.TopBottomSpacing = 6
ChildSizing.HorizontalSpacing = 4
ChildSizing.VerticalSpacing = 4
ClientHeight = 239
ClientWidth = 482
object vtUpdateListNumberOfThreads: TVirtualStringTree
Left = 6
Height = 227
Top = 6
Width = 470
Align = alClient
Colors.DropTargetBorderColor = clHotLight
Colors.FocusedSelectionBorderColor = clHotLight
Colors.SelectionRectangleBorderColor = clHotLight
Colors.UnfocusedSelectionBorderColor = clBtnShadow
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <
item
Position = 0
Text = 'Website'
end
item
Position = 1
Text = 'Value'
Width = 400
end>
Header.DefaultHeight = 23
Header.Height = 23
Header.Options = [hoColumnResize, hoDrag, hoShowSortGlyphs, hoVisible]
PopupMenu = pmCookies
TabOrder = 0
TreeOptions.MiscOptions = [toAcceptOLEDrop, toEditable, toFullRepaintOnResize, toGridExtensions, toInitOnSave, toToggleOnDblClick, toWheelPanning]
TreeOptions.PaintOptions = [toHideFocusRect, toShowDropmark, toShowHorzGridLines, toShowVertGridLines, toThemeAware, toUseBlendedImages, toFullVertGridLines]
TreeOptions.SelectionOptions = [toExtendedFocus, toRightClickSelect]
OnColumnDblClick = vtCookiesColumnDblClick
OnCompareNodes = vtCookiesCompareNodes
OnEditing = vtCookiesEditing
OnFreeNode = vtCookiesFreeNode
OnGetText = vtCookiesGetText
OnGetNodeDataSize = vtCookiesGetNodeDataSize
OnHeaderClick = vtCookiesHeaderClick
OnKeyDown = vtCookiesKeyDown
OnNewText = vtCookiesNewText
end
end
end
end
end
object pmCookies: TPopupMenu
Images = imglstpmCokies
left = 221
top = 89
object MenuItem1: TMenuItem
Caption = 'Add'
ImageIndex = 0
OnClick = MenuItem1Click
end
object MenuItem2: TMenuItem
Caption = 'Edit'
ImageIndex = 1
OnClick = MenuItem2Click
end
object MenuItem3: TMenuItem
Caption = '-'
end
object MenuItem4: TMenuItem
Caption = 'Delete'
ImageIndex = 2
OnClick = MenuItem4Click
end
end
object imglstpmCokies: TImageList
AllocBy = 2
left = 320
top = 89
Bitmap = {
4C69030000001000000010000000FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF003B7F320015A9000015A9000015A9
000015A9000015AA009915AA00CC15AA00CC15AA009915A9000015A9000015A9
000015A90000094D0000FFFFFF00FFFFFF00119A0000129F000014A8000014A8
000014A8000014A800CC72E961FF71E860FF14A800CC14A8000014A8000014A8
0000129F0000119A0000FFFFFF00FFFFFF00119A0000119B0000129E000014A5
000014A5000014A500CC69E058FF69E058FF14A500CC14A5000014A50000129E
0000119B0000119A0000FFFFFF00FFFFFF00119A0000119B0000119B0000129D
000013A2000013A200CC62D951FF61D850FF13A200CC13A20000129D0000119B
0000119B0000119A0000FFFFFF00FFFFFF00119A0000119B0000119B0000119B
0000129C0000129E00CC5AD149FF59D048FF129E00CC129C0000119B0000119B
0000119B0000119A0000FFFFFF00FFFFFF00119A0099119A00CC119A00CC119A
00CC119A00CC119A00CC54CB43FF52C941FF119A00CC119A00CC119A00CC119A
00CC119A00CC119A0099FFFFFF00FFFFFF00109600CC5ED54DFF55CC44FF54CB
43FF53CA42FF52C941FF4BC23AFF4AC139FF4FC63EFF4EC53DFF4DC43CFF4CC3
3BFF4EC53DFF109600CCFFFFFF00FFFFFF000F9200CC59D048FF50C73FFF50C7
3FFF4FC63EFF4AC139FF3BB32AFF31A920FF31A920FF2CA51BFF2BA31AFF2DA5
1CFF33AB22FF0F9200CCFFFFFF00FFFFFF000E8E00990E8D00CC0E8D00CC0E8D
00CC0E8D00CC0E8D00CC2DAE1CFF2BAC1AFF0E8D00CC0E8D00CC0E8D00CC0E8D
00CC0E8D00CC0E8E0099FFFFFF00FFFFFF000E8D00000E8C00000E8C00000E8C
00000E8B00000D8900CC29B618FF27B416FF0D8900CC0E8B00000E8C00000E8C
00000E8C00000E8D0000FFFFFF00FFFFFF000E8D00000E8C00000E8C00000E8A
00000C8400000C8400CC25C014FF24C013FF0C8400CC0C8400000E8A00000E8C
00000E8C00000E8D0000FFFFFF00FFFFFF000747000000000000000000000320
00000A7D00000A7D00CC23CD12FF22CC11FF0A7D00CC0A7D0000032000000000
00000000000000000000FFFFFF00FFFFFF000000000000000000000000000000
0000021D0000066D00CC22D811FF22D811FF066D00CC021D0000000000000000
00000000000000000000FFFFFF00FFFFFF0000000000000000040000001B0000
003000000033024700A6025D00CC025D00CC024700A600000033000000310000
001F0000000600000000FFFFFF00FFFFFF0000000000000000020000000E0000
00180000001A0000001A0000001A0000001A0000001A0000001A000000190000
00100000000300000000FFFFFF00000000000000000000000000000000000000
000000000000000000000000000001272D000175860055555500555555000101
E42B0101E09D0101D23F0101B600000000000000000000000000000000000000
00000000000001272D0001758600019BB200019BB200555555005555551F1515
BC9D8888FFFF0101C5B90101B443000000000000000000000000000000000127
2D0001758600019BB200019BB200019BB200019BB2005555552450505069F6F6
F6FF6868F8FF5C5CF2FF0000A8B1000000000000000001272D0001758600019B
B200019BB200019BB200019BB200019BB200019AB240158395A3F6F6F6FFCCCC
CCFFDDDDDDFF060683B50000A032001F2A00005E7D00019BB200019BB200019B
B200019BB200019BB200019BB200019AB2400195ADB788EEFFFF33AABBFFDDDD
DDFF171717830909312905055500007CA500007DA600019BB200019BB200019B
B200019BB200019BB200019AB2400195ADB788EEFFFF83EBFCFF56CDDEFF087A
8CB00C0C0C2F0A0A0A000A0A0A00007CA500007DA600019BB200019BB200019B
B200019BB200019AB2400195ADB788EEFFFF7EE7F8FF5ACFE0FF0395ACC0039A
B0430A0A0A000A0A0A000A0A0A00007CA500007DA600019BB200019BB200019B
B200019AB2400195ADB788EEFFFF78E3F4FF5DD2E3FF028DA4C20292A9440399
AF000A0A0A000A0A0A000A0A0A00007CA500007DA600019BB200019BB200019A
B2400195ADB788EEFFFF71DEEFFF60D3E4FF02859BC3028AA1450291A8000399
AF000A0A0A000A0A0A000A0A0A00007CA500007DA600019BB200019AB2400195
ADB788EEFFFF69DAEBFF60D3E4FF027C92C5028298450289A0000291A8000399
AF000A0A0A000505050000000000007CA500007DA600019AB2400195ADB788EE
FFFF63D5E6FF5FD3E4FF017389C701798F45028197000289A0000291A800024D
5800000000000000000000000000007CA500007CA527018DA8A688EEFFFF5DD1
E2FF5BD0E1FF016B80C80170864601788E000281970001455000000000000000
000000000000000000000000000000759B060072976CC0E4F1EF44BBCCFF58CE
DFFF016379CA01687D47016F8500013C47000000000000000000000000000000
0000000000000000000000000000016B8E3962A5BBC0C2E6F2FFA0CEDDF50159
6FC30060764701343E0000000000000000000000000000000000000000000000
0000000000000000000000000000015E7B85C2E6F2FF5591A5D1014C649A0131
41500000001500000013000000110000000F0000000D0000000A000000080000
000600000004000000030000000100000000014B649A012E3C63010A0D350000
002D0000002A00000026000000210000001D0000001900000014000000100000
000B000000080000000500000002FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF000000A8000000A9480000A9CC0000
A9CC0000A9930000A7000000A20000009A0000009E000000A4000000A82B0000
A97E0000A9B00000A966FFFFFF00FFFFFF000000A4000000A4CC7474FCFF6B6B
F4FE3636CDE50000A4CC0000A10000009A0000009E000000A3890606A8CF0000
A4BD0000A54A0000A501FFFFFF00FFFFFF0000009F0000009F6600009ECC3737
C9E56262EAFF5858E3FA1616AFD600009A330E0EA99F2828BEDD00009EB40000
9F1F0000A4000000A500FFFFFF00FFFFFF0000009F0000009E00000098330000
968A000096CC4141CDEE5151D9FD2727B7E32F2FBEE3000096B100009A180000
9F000000A4000000A500FFFFFF00FFFFFF0000009F0000009E00000098000000
900000008D3300008ECC3131BCF33333BCFA090997D400008E0000008F000000
8E0000008E000000A500FFFFFF00FFFFFF000000800000008000000080000000
8215000086B01A1AA8E72222B4F907078ED214149FE105058DD2000082000000
7C000000780000007800FFFFFF00FFFFFF00000078000000780000007B000000
7E911515A6E51D1DBEFD07078AD400007F6300007EAE0A0A94DC00007EB60000
7A000000780000007800FFFFFF00FFFFFF000000700000007000000075670D0D
96DC1717CCFF0F0FA2E50000777500007E0000007A000000769104048AD50000
76860000730000007200FFFFFF00FFFFFF0000006C0000006D1F00006ECC1515
D1FB1111C3F400006EB40000701100007000000078000000720000006E820000
6EB800006D4100006C00FFFFFF00FFFFFF00000066000000668C0A0A9FE51212
DDFF030378D3000067330000510000000000000000000000380000006A000000
66840000668900006404FFFFFF00FFFFFF000000180000005FCC1111DBFE0C0C
AFEC00005F8B0000190000000000000000000000000000000000000000000000
320000005F7300004832FFFFFF00FFFFFF000000001C0000325E000059CC0000
57BC0000164200000020000000160000000F0000000D00000010000000150000
001B00001D3800002D4CFFFFFF00FFFFFF000000000E00000014000000190000
001900000016000000100000000B0000000800000007000000080000000B0000
000E0000001100000013FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00
}
end
end

View File

@ -1,22 +0,0 @@
{"version":1,"strings":[
{"hash":174464899,"name":"twebsiteoptionadvancedform.tscookies.caption","sourcebytes":[67,111,111,107,105,101,115],"value":"Cookies"},
{"hash":230269173,"name":"twebsiteoptionadvancedform.vtcookies.header.columns[0].text","sourcebytes":[87,101,98,115,105,116,101],"value":"Website"},
{"hash":174464899,"name":"twebsiteoptionadvancedform.vtcookies.header.columns[1].text","sourcebytes":[67,111,111,107,105,101,115],"value":"Cookies"},
{"hash":71439252,"name":"twebsiteoptionadvancedform.tsuseragent.caption","sourcebytes":[85,115,101,114,32,65,103,101,110,116],"value":"User Agent"},
{"hash":230269173,"name":"twebsiteoptionadvancedform.vtuseragent.header.columns[0].text","sourcebytes":[87,101,98,115,105,116,101],"value":"Website"},
{"hash":71439252,"name":"twebsiteoptionadvancedform.vtuseragent.header.columns[1].text","sourcebytes":[85,115,101,114,32,65,103,101,110,116],"value":"User Agent"},
{"hash":240327891,"name":"twebsiteoptionadvancedform.tsdownloads.caption","sourcebytes":[68,111,119,110,108,111,97,100,115],"value":"Downloads"},
{"hash":261838155,"name":"twebsiteoptionadvancedform.tsmaxthreadspertask.caption","sourcebytes":[77,97,120,32,116,104,114,101,97,100,115,32,112,101,114,32,116,97,115,107],"value":"Max threads per task"},
{"hash":230269173,"name":"twebsiteoptionadvancedform.vtdownloadmaxthreadspertask.header.columns[0].text","sourcebytes":[87,101,98,115,105,116,101],"value":"Website"},
{"hash":6063029,"name":"twebsiteoptionadvancedform.vtdownloadmaxthreadspertask.header.columns[1].text","sourcebytes":[86,97,108,117,101],"value":"Value"},
{"hash":170482212,"name":"twebsiteoptionadvancedform.tsupdatelist.caption","sourcebytes":[85,112,100,97,116,101,32,76,105,115,116],"value":"Update List"},
{"hash":110671906,"name":"twebsiteoptionadvancedform.tsdirectorypagenumber.caption","sourcebytes":[68,105,114,101,99,116,111,114,121,32,112,97,103,101,32,110,117,109,98,101,114],"value":"Directory page number"},
{"hash":230269173,"name":"twebsiteoptionadvancedform.vtupdatelistdirectorypagenumber.header.columns[0].text","sourcebytes":[87,101,98,115,105,116,101],"value":"Website"},
{"hash":6063029,"name":"twebsiteoptionadvancedform.vtupdatelistdirectorypagenumber.header.columns[1].text","sourcebytes":[86,97,108,117,101],"value":"Value"},
{"hash":116141123,"name":"twebsiteoptionadvancedform.tsnumberofthreads.caption","sourcebytes":[78,117,109,98,101,114,32,111,102,32,116,104,114,101,97,100,115],"value":"Number of threads"},
{"hash":230269173,"name":"twebsiteoptionadvancedform.vtupdatelistnumberofthreads.header.columns[0].text","sourcebytes":[87,101,98,115,105,116,101],"value":"Website"},
{"hash":6063029,"name":"twebsiteoptionadvancedform.vtupdatelistnumberofthreads.header.columns[1].text","sourcebytes":[86,97,108,117,101],"value":"Value"},
{"hash":18340,"name":"twebsiteoptionadvancedform.menuitem1.caption","sourcebytes":[65,100,100],"value":"Add"},
{"hash":310020,"name":"twebsiteoptionadvancedform.menuitem2.caption","sourcebytes":[69,100,105,116],"value":"Edit"},
{"hash":78392485,"name":"twebsiteoptionadvancedform.menuitem4.caption","sourcebytes":[68,101,108,101,116,101],"value":"Delete"}
]}

View File

@ -1,311 +0,0 @@
unit frmWebsiteOptionAdvanced;
{$mode objfpc}{$H+}
interface
uses
Classes, Windows, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls,
LCLProc, Grids, Menus, VirtualTrees, FMDOptions, frmWebsiteSelection;
type
TNameValue = record
Name,
Value: String;
end;
PNameValue = ^TNameValue;
{ TWebsiteOptionAdvancedForm }
TWebsiteOptionAdvancedForm = class(TForm)
imglstpmCokies: TImageList;
MenuItem1: TMenuItem;
MenuItem2: TMenuItem;
MenuItem3: TMenuItem;
MenuItem4: TMenuItem;
pcUpdateList: TPageControl;
pcDownloads: TPageControl;
pcAdvanced: TPageControl;
pmCookies: TPopupMenu;
tsMaxThreadsPerTask: TTabSheet;
tsDirectoryPageNumber: TTabSheet;
tsNumberofThreads: TTabSheet;
tsUpdateList: TTabSheet;
tsDownloads: TTabSheet;
tsCookies: TTabSheet;
tsUserAgent: TTabSheet;
vtCookies: TVirtualStringTree;
vtDownloadMaxThreadsPerTask: TVirtualStringTree;
vtUpdateListDirectoryPageNumber: TVirtualStringTree;
vtUpdateListNumberOfThreads: TVirtualStringTree;
vtUserAgent: TVirtualStringTree;
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure MenuItem1Click(Sender: TObject);
procedure MenuItem2Click(Sender: TObject);
procedure MenuItem4Click(Sender: TObject);
procedure vtCookiesColumnDblClick(Sender: TBaseVirtualTree; Column: TColumnIndex;
Shift: TShiftState);
procedure vtCookiesCompareNodes(Sender: TBaseVirtualTree; Node1,
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
procedure vtCookiesEditing(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; var Allowed: Boolean);
procedure vtCookiesFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure vtCookiesGetNodeDataSize(Sender: TBaseVirtualTree;
var NodeDataSize: Integer);
procedure vtCookiesGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: String);
{$if VTMajorVersion < 5}
procedure vtCookiesHeaderClick(Sender: TVTHeader; Column: TColumnIndex;
Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
{$else}
procedure vtCookiesHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
{$endif}
procedure vtCookiesKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
procedure vtCookiesNewText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; const NewText: String);
private
{ private declarations }
procedure LoadFromFileToVT(const AVT: VirtualTrees.TVirtualStringTree; const ASection: String);
procedure GetWebsite(const AVT: VirtualTrees.TVirtualStringTree; const S: TStrings);
public
{ public declarations }
end;
var
WebsiteOptionAdvancedForm: TWebsiteOptionAdvancedForm;
implementation
uses frmCustomColor;
{$R *.lfm}
{ TWebsiteOptionAdvancedForm }
procedure TWebsiteOptionAdvancedForm.FormCreate(Sender: TObject);
begin
AddVT(vtCookies);
AddVT(vtUserAgent);
AddVT(vtDownloadMaxThreadsPerTask);
AddVT(vtUpdateListDirectoryPageNumber);
AddVT(vtUpdateListNumberOfThreads);
LoadFromFileToVT(vtCookies, 'Cookies');
LoadFromFileToVT(vtUserAgent, 'UserAgent');
LoadFromFileToVT(vtDownloadMaxThreadsPerTask, 'DownloadMaxThreadsPerTask');
LoadFromFileToVT(vtUpdateListDirectoryPageNumber, 'UpdateListDirectoryPageNumber');
LoadFromFileToVT(vtUpdateListNumberOfThreads, 'UpdateListNumberOfThreads');
end;
procedure TWebsiteOptionAdvancedForm.FormDestroy(Sender: TObject);
begin
RemoveVT(vtCookies);
RemoveVT(vtUserAgent);
RemoveVT(vtDownloadMaxThreadsPerTask);
RemoveVT(vtUpdateListDirectoryPageNumber);
RemoveVT(vtUpdateListNumberOfThreads);
end;
procedure TWebsiteOptionAdvancedForm.MenuItem1Click(Sender: TObject);
var
Data: PNameValue;
Node: PVirtualNode;
begin
if Screen.ActiveControl is VirtualTrees.TVirtualStringTree then
with TWebsiteSelectionForm.Create(Self) do
try
GetWebsite(VirtualTrees.TVirtualStringTree(Screen.ActiveControl), cbWebsites.Items);
if (ShowModal = mrOk) and (cbWebsites.Text <> '') then
with VirtualTrees.TVirtualStringTree(Screen.ActiveControl) do
begin
Node := AddChild(nil);
Data := GetNodeData(Node);
Data^.Name := cbWebsites.Text;
advancedfile.WriteString(DefaultText, cbWebsites.Text, '');
EditNode(Node, 1);
end;
finally
Free;
end;
end;
procedure TWebsiteOptionAdvancedForm.MenuItem2Click(Sender: TObject);
begin
if Screen.ActiveControl is VirtualTrees.TVirtualStringTree then
with VirtualTrees.TVirtualStringTree(Screen.ActiveControl) do
EditNode(FocusedNode, 1);
end;
procedure TWebsiteOptionAdvancedForm.MenuItem4Click(Sender: TObject);
var
Data: PNameValue;
begin
if Screen.ActiveControl is VirtualTrees.TVirtualStringTree then
with VirtualTrees.TVirtualStringTree(Screen.ActiveControl) do
begin
Data := GetNodeData(FocusedNode);
advancedfile.DeleteKey(DefaultText, Data^.Name);
DeleteNode(FocusedNode);
end;
end;
procedure TWebsiteOptionAdvancedForm.vtCookiesColumnDblClick(Sender: TBaseVirtualTree;
Column: TColumnIndex; Shift: TShiftState);
begin
if Column <> 0 then
Sender.EditNode(Sender.FocusedNode, Column);
end;
procedure TWebsiteOptionAdvancedForm.vtCookiesCompareNodes(Sender: TBaseVirtualTree;
Node1, Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
var
Data1, Data2: PNameValue;
begin
Data1 := Sender.GetNodeData(Node1);
Data2 := Sender.GetNodeData(Node2);
case Column of
0: Result := CompareStr(Data1^.Name, Data2^.Name);
1: Result := CompareStr(Data1^.Value, Data2^.Value);
end;
end;
procedure TWebsiteOptionAdvancedForm.vtCookiesEditing(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; var Allowed: Boolean);
begin
Allowed := Column <> 0;
end;
procedure TWebsiteOptionAdvancedForm.vtCookiesFreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
var
Data: PNameValue;
begin
Data := Sender.GetNodeData(Node);
if Assigned(Data) then
Finalize(Data^);
end;
procedure TWebsiteOptionAdvancedForm.vtCookiesGetNodeDataSize(Sender: TBaseVirtualTree;
var NodeDataSize: Integer);
begin
NodeDataSize := SizeOf(TNameValue);
end;
procedure TWebsiteOptionAdvancedForm.vtCookiesGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType; var CellText: String);
var
Data: PNameValue;
begin
Data := Sender.GetNodeData(Node);
case Column of
0: CellText := Data^.Name;
1: CellText := Data^.Value;
end;
end;
{$if VTMajorVersion < 5}
procedure TWebsiteOptionAdvancedForm.vtCookiesHeaderClick(Sender: TVTHeader;
Column: TColumnIndex; Button: TMouseButton; Shift: TShiftState; X, Y: Integer
);
{$else}
procedure TWebsiteOptionAdvancedForm.vtCookiesHeaderClick(Sender: TVTHeader; HitInfo: TVTHeaderHitInfo);
var
Column: TColumnIndex;
{$endif}
begin
{$if VTMajorVersion >= 5}
Column := HitInfo.Column;
{$endif}
Sender.SortColumn := Column;
if Sender.SortDirection = sdAscending then
Sender.SortDirection := sdDescending
else
Sender.SortDirection := sdAscending;
Sender.Treeview.SortTree(Sender.SortColumn, Sender.SortDirection);
end;
procedure TWebsiteOptionAdvancedForm.vtCookiesKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if not (Sender is VirtualTrees.TVirtualStringTree) then Exit;
with VirtualTrees.TVirtualStringTree(Sender) do
if (Key = VK_RETURN) and (FocusedColumn <> 0) then
EditNode(FocusedNode, FocusedColumn);
end;
procedure TWebsiteOptionAdvancedForm.vtCookiesNewText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; const NewText: String);
var
Data: PNameValue;
begin
if Column = 0 then Exit;
Data := Sender.GetNodeData(Node);
if Data^.Value <> NewText then
begin
Data^.Value := NewText;
advancedfile.WriteString(VirtualTrees.TVirtualStringTree(Sender).DefaultText, Data^.Name, NewText);
end;
end;
procedure TWebsiteOptionAdvancedForm.LoadFromFileToVT(const AVT: VirtualTrees.TVirtualStringTree; const ASection: String);
var
s: TStringList;
i: Integer;
Node: PVirtualNode;
Data: PNameValue;
begin
if AVT = nil then Exit;
if ASection = '' then Exit;
AVT.Clear;
AVT.DefaultText := ASection;
s := TStringList.Create;
try
advancedfile.ReadSectionRaw(ASection, s);
if s.Count > 0 then
begin
AVT.BeginUpdate;
try
for i := 0 to s.Count - 1 do
begin
Node := AVT.AddChild(nil);
Data := AVT.GetNodeData(Node);
Data^.Name := s.Names[i];
Data^.Value := s.ValueFromIndex[i];
end;
AVT.Header.AutoFitColumns(False, smaUseColumnOption, 0, 0);
AVT.Header.SortColumn := 0;
AVT.Header.SortDirection := sdAscending;
AVT.SortTree(AVT.Header.SortColumn, AVT.Header.SortDirection);
finally
AVT.EndUpdate;
end;
end;
finally
s.Free;
end;
end;
procedure TWebsiteOptionAdvancedForm.GetWebsite(const AVT: VirtualTrees.TVirtualStringTree; const S: TStrings);
var
Node: PVirtualNode;
p: Integer;
begin
if AVT = nil then Exit;
if S = nil then Exit;
s.Assign(AvailableWebsites);
if s.Count <> 0 then
begin
Node := AVT.GetFirst();
while Node <> nil do
begin
p := s.IndexOf(PNameValue(AVT.GetNodeData(Node))^.Name);
if p <> - 1 then
s.Delete(p);
Node := AVT.GetNext(Node);
end;
end;
end;
end.

View File

@ -0,0 +1,133 @@
object WebsiteSettingsForm: TWebsiteSettingsForm
Left = 280
Height = 461
Top = 93
Width = 572
Caption = 'WebsiteSettingsForm'
ClientHeight = 461
ClientWidth = 572
OnCreate = FormCreate
OnDestroy = FormDestroy
LCLVersion = '1.8.0.6'
object pnTop: TPanel
Left = 0
Height = 23
Top = 0
Width = 572
Align = alTop
AutoSize = True
BorderSpacing.Bottom = 6
BevelOuter = bvNone
ClientHeight = 23
ClientWidth = 572
TabOrder = 0
object edSearch: TEditButton
Left = 0
Height = 23
Top = 0
Width = 177
ButtonWidth = 23
Glyph.Data = {
36040000424D3604000000000000360000002800000010000000100000000100
2000000000000004000064000000640000000000000000000000FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00000000010000
00070000000E00000014000000190000001A0000001900000017000000150000
00120000000E0000000B00000008000000050000000200000001000000020000
000D0000001B000000280000003100000033001A3064002D57CC002C56CC0018
305D0000001C000000160000000F0000000A0000000400000001000000000000
0000000000000000000001131F0000214048002B55CC5494B7FF34679AFF0030
5ACA00224248000D170000000000000000000000000000000000000000000000
00000116210000214000014D7C41014B79BB3A719FFF386F9DFF5F9FC0FF4578
ABFF003763C600356046002D4E00010101000000000000000000013048000021
400001568600002B5548002B55CC4F8DB3FF68ACC8FF4880ACFF5087B3FF6AAA
C8FF5588BBFF00416EC1003E6A440101010001385B0001263D00015F9000002B
55000157873F015585B65FA1C0FF3F79A3FF4278A7FF66A6C5FF619DC2FF5E95
C1FF74B4D1FF6598CBFF010101AB0101013C014B7900014B7A00015F9000002B
5548002B55CC336898FF508CB3FF69ABC8FF67A7C6FF4D80B3FF71B1CEFF6EA9
CDFF6CA3CEFF6D6D6DFFAA9999FF010101A5014C7A42014B7A000160913E015E
8FB16AAEC9FF66A8C5FF5692B8FF4B80AFFF5D97BFFF77B9D2FF669DC8FF7BBA
D5FF7E7E7EFFCEC0C0FF797979FF5588BBFF014F7EA6014E7D0001629383126D
9BB82078A2C33385ABD058A2C0E774B9D1FB6EACCCFF669DC8FF83C7DAFF8888
88FFD3CACAFF838383FF60A4C6FF63A7C9FF015382A501528100016395050163
9414016293280161924101619277106C9AAB4B9BBADB79B9D5FC919191FFD9D4
D4FF8D8D8DFF68ACCEFF74B8D4FF015887B40156864001558400016395000163
9400016293000161920001629300016293100162936D00000069DDDCDCFF9494
94FF70B4D6FF80C4DBFF015C8DB2001A63CC0013584800226E00016395000163
94000162930001619200016293000162930001639400000000240000006788CC
DDFF87CBDDFF016091AF003080CC3F72B6FF002774CC00247048016395000163
940001629300016192000162930001629300016394000000000001334C390165
969C0164959C0163943E00398B48003688CC5285C9FF002E7ECC016395000163
940001629300016192000162930001629300016394000000000001334C000165
97000164960001639400003A8C00003E9248003C8FCC00378A48FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFF
FF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00FFFFFF00
}
MaxLength = 0
NumGlyphs = 1
OnButtonClick = edSearchButtonClick
OnChange = edSearchChange
PasswordChar = #0
TabOrder = 0
TextHint = 'Website name'
end
end
object spMain: TPairSplitter
Left = 0
Height = 432
Top = 29
Width = 572
Align = alClient
Position = 150
object spList: TPairSplitterSide
Cursor = crArrow
Left = 0
Height = 432
Top = 0
Width = 150
ClientWidth = 150
ClientHeight = 432
object vtWebsite: TVirtualStringTree
Left = 0
Height = 432
Top = 0
Width = 150
Align = alClient
DefaultText = 'Node'
Header.AutoSizeIndex = 0
Header.Columns = <>
Header.DefaultHeight = 17
Header.MainColumn = -1
TabOrder = 0
TreeOptions.PaintOptions = [toHideFocusRect, toShowButtons, toShowDropmark, toThemeAware, toUseBlendedImages]
TreeOptions.SelectionOptions = [toFullRowSelect]
OnClick = vtWebsiteClick
OnCompareNodes = vtWebsiteCompareNodes
OnFreeNode = vtWebsiteFreeNode
OnGetText = vtWebsiteGetText
end
end
object spProps: TPairSplitterSide
Cursor = crArrow
Left = 155
Height = 432
Top = 0
Width = 417
ClientWidth = 417
ClientHeight = 432
object prSettings: TTIPropertyGrid
Left = 0
Height = 432
Top = 0
Width = 417
Align = alClient
CheckboxForBoolean = True
DefaultValueFont.Color = clWindowText
Filter = [tkInteger, tkChar, tkEnumeration, tkFloat, tkSet, tkMethod, tkSString, tkLString, tkAString, tkWString, tkVariant, tkArray, tkRecord, tkInterface, tkClass, tkObject, tkWChar, tkBool, tkInt64, tkQWord, tkDynArray, tkInterfaceRaw, tkProcVar, tkUString, tkUChar, tkHelper, tkFile, tkClassRef, tkPointer]
Indent = 16
NameFont.Color = clWindowText
ValueFont.Color = clMaroon
end
end
end
end

View File

@ -0,0 +1,4 @@
{"version":1,"strings":[
{"hash":63106205,"name":"twebsitesettingsform.caption","sourcebytes":[87,101,98,115,105,116,101,83,101,116,116,105,110,103,115,70,111,114,109],"value":"WebsiteSettingsForm"},
{"hash":263118389,"name":"twebsitesettingsform.edsearch.texthint","sourcebytes":[87,101,98,115,105,116,101,32,110,97,109,101],"value":"Website name"}
]}

View File

@ -0,0 +1,147 @@
unit frmWebsiteSettings;
{$mode objfpc}{$H+}
interface
uses
Classes, SysUtils, FileUtil, ListFilterEdit, RTTIGrids, Forms, Controls,
Graphics, Dialogs, StdCtrls, ExtCtrls, PairSplitter, EditBtn, VirtualTrees;
type
{ TWebsiteSettingsForm }
TWebsiteSettingsForm = class(TForm)
edSearch: TEditButton;
spMain: TPairSplitter;
spList: TPairSplitterSide;
spProps: TPairSplitterSide;
pnTop: TPanel;
prSettings: TTIPropertyGrid;
vtWebsite: TVirtualStringTree;
procedure edSearchButtonClick(Sender: TObject);
procedure edSearchChange(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure vtWebsiteClick(Sender: TObject);
procedure vtWebsiteCompareNodes(Sender: TBaseVirtualTree; Node1,
Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
procedure vtWebsiteFreeNode(Sender: TBaseVirtualTree; Node: PVirtualNode);
procedure vtWebsiteGetText(Sender: TBaseVirtualTree; Node: PVirtualNode;
Column: TColumnIndex; TextType: TVSTTextType; var CellText: String);
private
public
procedure LoadWebsiteSettings;
end;
var
WebsiteSettingsForm: TWebsiteSettingsForm;
implementation
uses WebsiteModules, frmCustomColor;
type
PWebsiteSettingsItem = ^TWebsiteSettingsItem;
TWebsiteSettingsItem = record
Website: String;
Settings: TWebsiteModuleSettings;
end;
{$R *.lfm}
{ TWebsiteSettingsForm }
procedure TWebsiteSettingsForm.FormCreate(Sender: TObject);
begin
AddVT(vtWebsite);
prSettings.PreferredSplitterX:=200;
end;
procedure TWebsiteSettingsForm.edSearchChange(Sender: TObject);
var
s: String;
node: PVirtualNode;
begin
s:=AnsiUpperCase(edSearch.Text);
vtWebsite.BeginUpdate;
node:=vtWebsite.GetFirst();
if s<>'' then
while node<>nil do
begin
vtWebsite.IsVisible[node]:=Pos(s,AnsiUpperCase(PWebsiteSettingsItem(vtWebsite.GetNodeData(node))^.Website))<>0;
node:=vtWebsite.GetNext(node);
end
else
while node<>nil do
begin
vtWebsite.IsVisible[node]:=True;
node:=vtWebsite.GetNext(node);
end;
vtWebsite.EndUpdate;
end;
procedure TWebsiteSettingsForm.edSearchButtonClick(Sender: TObject);
begin
edSearch.Clear;
end;
procedure TWebsiteSettingsForm.FormDestroy(Sender: TObject);
begin
RemoveVT(vtWebsite);
end;
procedure TWebsiteSettingsForm.vtWebsiteClick(Sender: TObject);
begin
if vtWebsite.SelectedCount=0 then Exit;
prSettings.TIObject:=PWebsiteSettingsItem(vtWebsite.GetNodeData(vtWebsite.GetFirstSelected()))^.Settings;
end;
procedure TWebsiteSettingsForm.vtWebsiteCompareNodes(Sender: TBaseVirtualTree;
Node1, Node2: PVirtualNode; Column: TColumnIndex; var Result: Integer);
begin
Result:=AnsiCompareStr(PWebsiteSettingsItem(Sender.GetNodeData(Node1))^.Website,
PWebsiteSettingsItem(Sender.GetNodeData(Node2))^.Website);
end;
procedure TWebsiteSettingsForm.vtWebsiteFreeNode(Sender: TBaseVirtualTree;
Node: PVirtualNode);
begin
Finalize(PWebsiteSettingsItem(Sender.GetNodeData(Node))^);
end;
procedure TWebsiteSettingsForm.vtWebsiteGetText(Sender: TBaseVirtualTree;
Node: PVirtualNode; Column: TColumnIndex; TextType: TVSTTextType;
var CellText: String);
begin
CellText:=PWebsiteSettingsItem(Sender.GetNodeData(Node))^.Website;
end;
procedure TWebsiteSettingsForm.LoadWebsiteSettings;
var
i: Integer;
node: PVirtualNode;
data: PWebsiteSettingsItem;
begin
vtWebsite.NodeDataSize:=SizeOf(TWebsiteSettingsItem);
vtWebsite.BeginUpdate;
for i:=0 to Modules.Count-1 do
with Modules[i] do
begin
node:=vtWebsite.AddChild(nil);
vtWebsite.ValidateNode(node,False);
data:=vtWebsite.GetNodeData(node);
data^.Website:=Website;
data^.Settings:=Settings;
end;
vtWebsite.Sort(nil,0,sdAscending,false);
vtWebsite.EndUpdate;
end;
end.

View File

@ -2403,6 +2403,14 @@ msgstr "User Agent"
msgid "Select a website"
msgstr "Wähle eine Webseite"
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr "Compressing..."

View File

@ -2458,6 +2458,14 @@ msgstr "Παράγοντας χρήστη"
msgid "Select a website"
msgstr "Επιλέξτε έναν ιστότοπο"
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr "Συμπίεση..."

View File

@ -2396,6 +2396,14 @@ msgstr "User Agent"
msgid "Select a website"
msgstr "Select a website"
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr "Compressing..."

View File

@ -2407,6 +2407,14 @@ msgstr "Agente de Usuario"
msgid "Select a website"
msgstr "Seleccionar un Sitio Web"
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr "Comprimiendo..."

View File

@ -2396,6 +2396,14 @@ msgstr "User Agent"
msgid "Select a website"
msgstr "Pilih situs"
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr "Mengompresi..."

View File

@ -2405,6 +2405,14 @@ msgstr "User Agent"
msgid "Select a website"
msgstr "Wybierz stronę internetową"
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr "Kompresja danych..."

View File

@ -2313,6 +2313,14 @@ msgstr ""
msgid "Select a website"
msgstr ""
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr ""

View File

@ -2408,6 +2408,14 @@ msgstr "User Agent"
msgid "Select a website"
msgstr "Selecionar um website"
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr "Compactando..."

View File

@ -2403,6 +2403,14 @@ msgstr "User Agent"
msgid "Select a website"
msgstr "Выбрать сайт"
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr "Сжатие..."

View File

@ -2426,6 +2426,14 @@ msgstr "User Agent"
msgid "Select a website"
msgstr "Bir websitesi seç"
#: twebsitesettingsform.caption
msgid "WebsiteSettingsForm"
msgstr ""
#: twebsitesettingsform.edsearch.texthint
msgid "Website name"
msgstr ""
#: udownloadsmanager.rs_compressing
msgid "Compressing..."
msgstr "Sıkıştırılıyor..."

View File

@ -271,36 +271,42 @@
<FormatVersion Value="1"/>
</local>
</RunParams>
<RequiredPackages Count="9">
<RequiredPackages Count="11">
<Item1>
<PackageName Value="LCL"/>
<PackageName Value="RunTimeTypeInfoControls"/>
</Item1>
<Item2>
<PackageName Value="TAChartLazarusPkg"/>
<PackageName Value="LazControls"/>
</Item2>
<Item3>
<PackageName Value="richmemopackage"/>
<PackageName Value="LCL"/>
</Item3>
<Item4>
<PackageName Value="virtualtreeview_package"/>
<PackageName Value="TAChartLazarusPkg"/>
</Item4>
<Item5>
<PackageName Value="multiloglaz"/>
<PackageName Value="richmemopackage"/>
</Item5>
<Item6>
<PackageName Value="laz_synapse"/>
<PackageName Value="virtualtreeview_package"/>
</Item6>
<Item7>
<PackageName Value="dcpcrypt"/>
<PackageName Value="multiloglaz"/>
</Item7>
<Item8>
<PackageName Value="BESENPkg"/>
<DefaultFilename Value="..\3rd\BESENPkg.lpk" Prefer="True"/>
<PackageName Value="laz_synapse"/>
</Item8>
<Item9>
<PackageName Value="dcpcrypt"/>
</Item9>
<Item10>
<PackageName Value="BESENPkg"/>
<DefaultFilename Value="..\3rd\BESENPkg.lpk" Prefer="True"/>
</Item10>
<Item11>
<PackageName Value="internettools"/>
<DefaultFilename Value="..\3rd\internettools\internettools.lpk" Prefer="True"/>
</Item9>
</Item11>
</RequiredPackages>
<Units Count="18">
<Unit0>
@ -364,60 +370,59 @@
<ResourceBaseClass Value="Form"/>
</Unit8>
<Unit9>
<Filename Value="forms\frmWebsiteOptionAdvanced.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="WebsiteOptionAdvancedForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit9>
<Unit10>
<Filename Value="forms\frmWebsiteSelection.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="WebsiteSelectionForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit10>
<Unit11>
</Unit9>
<Unit10>
<Filename Value="forms\frmCustomColor.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="CustomColorForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit11>
<Unit12>
</Unit10>
<Unit11>
<Filename Value="forms\frmLogger.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="FormLogger"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit12>
<Unit13>
</Unit11>
<Unit12>
<Filename Value="forms\frmSelectDirectory.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="SelectDirectoryForm"/>
<ResourceBaseClass Value="Form"/>
</Unit13>
<Unit14>
</Unit12>
<Unit13>
<Filename Value="forms\frmTransferFavorites.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="TransferFavoritesForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit14>
<Unit15>
</Unit13>
<Unit14>
<Filename Value="forms\frmLuaModulesUpdater.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="LuaModulesUpdaterForm"/>
<HasResources Value="True"/>
<ResourceBaseClass Value="Form"/>
</Unit14>
<Unit15>
<Filename Value="..\baseunits\DBUpdater.pas"/>
<IsPartOfProject Value="True"/>
</Unit15>
<Unit16>
<Filename Value="..\baseunits\DBUpdater.pas"/>
<Filename Value="..\baseunits\SelfUpdater.pas"/>
<IsPartOfProject Value="True"/>
</Unit16>
<Unit17>
<Filename Value="..\baseunits\SelfUpdater.pas"/>
<Filename Value="forms\frmWebsiteSettings.pas"/>
<IsPartOfProject Value="True"/>
<ComponentName Value="WebsiteSettingsForm"/>
<ResourceBaseClass Value="Form"/>
</Unit17>
</Units>
</ProjectOptions>