Skip to content
Snippets Groups Projects
Commit 90fe8a77 authored by Rob Swindell's avatar Rob Swindell :speech_balloon:
Browse files

Display/accept credits/byte values in units of powers of 1024 (e.g. M, B, G)

parent 6ee38d32
Branches
Tags
1 merge request!463MRC mods by Codefenix (2024-10-20)
Pipeline #3350 passed
...@@ -82,6 +82,12 @@ void __fastcall TMainForm::PutUserDate(TEdit* Edit, enum user_field fnum) ...@@ -82,6 +82,12 @@ void __fastcall TMainForm::PutUserDate(TEdit* Edit, enum user_field fnum)
Edit->Tag = false; Edit->Tag = false;
} }
//--------------------------------------------------------------------------- //---------------------------------------------------------------------------
void __fastcall TMainForm::PutUserBytes(TEdit* Edit, enum user_field fnum)
{
AnsiString str = parse_byte_count(Edit->Text.c_str(), 1);
PutUserStr(Edit, fnum, str.c_str());
}
//---------------------------------------------------------------------------
void __fastcall TMainForm::GetUserDate(TEdit* Edit, time_t t) void __fastcall TMainForm::GetUserDate(TEdit* Edit, time_t t)
{ {
char tmp[64]; char tmp[64];
...@@ -238,7 +244,9 @@ void __fastcall TMainForm::GetUserData(int number) ...@@ -238,7 +244,9 @@ void __fastcall TMainForm::GetUserData(int number)
GetUserFlags(RestrictionsEdit, user.rest); GetUserFlags(RestrictionsEdit, user.rest);
GetUserText(CreditsEdit, user.cdt); GetUserText(CreditsEdit, user.cdt);
CreditsStaticText->Caption = byte_estimate_to_str(user.cdt, tmp, sizeof(tmp), 1, 1);
GetUserText(FreeCreditsEdit, user.freecdt); GetUserText(FreeCreditsEdit, user.freecdt);
FreeCreditsStaticText->Caption = byte_estimate_to_str(user.freecdt, tmp, sizeof(tmp), 1, 1);
GetUserText(MinutesEdit, user.min); GetUserText(MinutesEdit, user.min);
// Stats // Stats
...@@ -257,8 +265,10 @@ void __fastcall TMainForm::GetUserData(int number) ...@@ -257,8 +265,10 @@ void __fastcall TMainForm::GetUserData(int number)
GetUserText(FeedbackEdit, user.fbacks); GetUserText(FeedbackEdit, user.fbacks);
GetUserText(UploadedFilesEdit, user.uls); GetUserText(UploadedFilesEdit, user.uls);
GetUserText(UploadedBytesEdit, user.ulb); GetUserText(UploadedBytesEdit, user.ulb);
UploadedBytesStaticText->Caption = byte_estimate_to_str(user.ulb, tmp, sizeof(tmp), 1, 1);
GetUserText(DownloadedFilesEdit, user.dls); GetUserText(DownloadedFilesEdit, user.dls);
GetUserText(DownloadedBytesEdit, user.dlb); GetUserText(DownloadedBytesEdit, user.dlb);
DownloadedBytesStaticText->Caption = byte_estimate_to_str(user.dlb, tmp, sizeof(tmp), 1, 1);
GetUserText(LeechEdit, user.leech); GetUserText(LeechEdit, user.leech);
// Extended Comment // Extended Comment
...@@ -392,8 +402,8 @@ void __fastcall TMainForm::PutUserData(int number) ...@@ -392,8 +402,8 @@ void __fastcall TMainForm::PutUserData(int number)
PutUserText(RestrictionsEdit, USER_REST); PutUserText(RestrictionsEdit, USER_REST);
PutUserDate(ExpireEdit, USER_EXPIRE); PutUserDate(ExpireEdit, USER_EXPIRE);
PutUserText(CreditsEdit, USER_CDT); PutUserBytes(CreditsEdit, USER_CDT);
PutUserText(FreeCreditsEdit, USER_FREECDT); PutUserBytes(FreeCreditsEdit, USER_FREECDT);
PutUserText(MinutesEdit, USER_MIN); PutUserText(MinutesEdit, USER_MIN);
PutUserDate(FirstOnEdit, USER_FIRSTON); PutUserDate(FirstOnEdit, USER_FIRSTON);
...@@ -410,9 +420,9 @@ void __fastcall TMainForm::PutUserData(int number) ...@@ -410,9 +420,9 @@ void __fastcall TMainForm::PutUserData(int number)
PutUserText(EmailTodayEdit, USER_ETODAY); PutUserText(EmailTodayEdit, USER_ETODAY);
PutUserText(FeedbackEdit, USER_FBACKS); PutUserText(FeedbackEdit, USER_FBACKS);
PutUserText(UploadedFilesEdit, USER_ULS); PutUserText(UploadedFilesEdit, USER_ULS);
PutUserText(UploadedBytesEdit, USER_ULB); PutUserBytes(UploadedBytesEdit, USER_ULB);
PutUserText(DownloadedFilesEdit, USER_DLS); PutUserText(DownloadedFilesEdit, USER_DLS);
PutUserText(DownloadedBytesEdit, USER_DLB); PutUserBytes(DownloadedBytesEdit, USER_DLB);
PutUserText(LeechEdit, USER_LEECH); PutUserText(LeechEdit, USER_LEECH);
if(Memo->Tag) { if(Memo->Tag) {
......
object MainForm: TMainForm object MainForm: TMainForm
Left = 1015 Left = 1081
Top = 651 Top = 601
ActiveControl = ScrollBar ActiveControl = ScrollBar
BorderIcons = [biSystemMenu, biMinimize] BorderIcons = [biSystemMenu, biMinimize]
BorderStyle = bsSingle BorderStyle = bsSingle
...@@ -33,9 +33,9 @@ object MainForm: TMainForm ...@@ -33,9 +33,9 @@ object MainForm: TMainForm
Top = 81 Top = 81
Width = 447 Width = 447
Height = 278 Height = 278
ActivePage = SecurityTabSheet ActivePage = StatsTabSheet
Align = alClient Align = alClient
TabIndex = 1 TabIndex = 2
TabOrder = 0 TabOrder = 0
object PersonalTabSheet: TTabSheet object PersonalTabSheet: TTabSheet
Caption = 'Personal' Caption = 'Personal'
...@@ -217,7 +217,7 @@ object MainForm: TMainForm ...@@ -217,7 +217,7 @@ object MainForm: TMainForm
TabOrder = 5 TabOrder = 5
OnChange = EditChange OnChange = EditChange
end end
object GroupBox9: TGroupBox object AddressGroupBox: TGroupBox
Left = 72 Left = 72
Top = 160 Top = 160
Width = 297 Width = 297
...@@ -301,7 +301,7 @@ object MainForm: TMainForm ...@@ -301,7 +301,7 @@ object MainForm: TMainForm
end end
object Label28: TLabel object Label28: TLabel
Left = 264 Left = 264
Top = 56 Top = 104
Width = 65 Width = 65
Height = 21 Height = 21
AutoSize = False AutoSize = False
...@@ -309,7 +309,7 @@ object MainForm: TMainForm ...@@ -309,7 +309,7 @@ object MainForm: TMainForm
end end
object Label29: TLabel object Label29: TLabel
Left = 264 Left = 264
Top = 32 Top = 56
Width = 65 Width = 65
Height = 21 Height = 21
AutoSize = False AutoSize = False
...@@ -362,7 +362,7 @@ object MainForm: TMainForm ...@@ -362,7 +362,7 @@ object MainForm: TMainForm
end end
object MinutesEdit: TEdit object MinutesEdit: TEdit
Left = 336 Left = 336
Top = 56 Top = 104
Width = 89 Width = 89
Height = 21 Height = 21
CharCase = ecUpperCase CharCase = ecUpperCase
...@@ -372,7 +372,7 @@ object MainForm: TMainForm ...@@ -372,7 +372,7 @@ object MainForm: TMainForm
end end
object FreeCreditsEdit: TEdit object FreeCreditsEdit: TEdit
Left = 336 Left = 336
Top = 32 Top = 56
Width = 89 Width = 89
Height = 21 Height = 21
CharCase = ecUpperCase CharCase = ecUpperCase
...@@ -380,7 +380,7 @@ object MainForm: TMainForm ...@@ -380,7 +380,7 @@ object MainForm: TMainForm
TabOrder = 6 TabOrder = 6
OnChange = EditChange OnChange = EditChange
end end
object GroupBox8: TGroupBox object FlagSetGroupBox: TGroupBox
Left = 8 Left = 8
Top = 40 Top = 40
Width = 233 Width = 233
...@@ -456,17 +456,35 @@ object MainForm: TMainForm ...@@ -456,17 +456,35 @@ object MainForm: TMainForm
OnChange = EditChange OnChange = EditChange
end end
end end
object CreditsStaticText: TStaticText
Left = 336
Top = 32
Width = 89
Height = 21
AutoSize = False
BorderStyle = sbsSunken
TabOrder = 8
end
object FreeCreditsStaticText: TStaticText
Left = 336
Top = 80
Width = 89
Height = 21
AutoSize = False
BorderStyle = sbsSunken
TabOrder = 9
end
end end
object StatsTabSheet: TTabSheet object StatsTabSheet: TTabSheet
Caption = 'Statistics' Caption = 'Statistics'
ImageIndex = 2 ImageIndex = 2
object GroupBox1: TGroupBox object TimeOnGroupBox: TGroupBox
Left = 152 Left = 152
Top = 120 Top = 120
Width = 137 Width = 137
Height = 121 Height = 121
Caption = 'Time On' Caption = 'Time On'
TabOrder = 0 TabOrder = 4
DesignSize = ( DesignSize = (
137 137
121) 121)
...@@ -526,7 +544,7 @@ object MainForm: TMainForm ...@@ -526,7 +544,7 @@ object MainForm: TMainForm
Width = 57 Width = 57
Height = 21 Height = 21
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
TabOrder = 2 TabOrder = 3
OnChange = EditChange OnChange = EditChange
end end
object LastCallTimeEdit: TEdit object LastCallTimeEdit: TEdit
...@@ -535,11 +553,11 @@ object MainForm: TMainForm ...@@ -535,11 +553,11 @@ object MainForm: TMainForm
Width = 57 Width = 57
Height = 21 Height = 21
Anchors = [akTop, akRight] Anchors = [akTop, akRight]
TabOrder = 3 TabOrder = 2
OnChange = EditChange OnChange = EditChange
end end
end end
object GroupBox2: TGroupBox object LogonsGroupBoxx: TGroupBox
Left = 8 Left = 8
Top = 88 Top = 88
Width = 137 Width = 137
...@@ -579,13 +597,13 @@ object MainForm: TMainForm ...@@ -579,13 +597,13 @@ object MainForm: TMainForm
OnChange = EditChange OnChange = EditChange
end end
end end
object GroupBox3: TGroupBox object DatesGroupBox: TGroupBox
Left = 8 Left = 8
Top = 8 Top = 8
Width = 137 Width = 137
Height = 73 Height = 73
Caption = 'Dates' Caption = 'Dates'
TabOrder = 2 TabOrder = 0
object Label17: TLabel object Label17: TLabel
Left = 8 Left = 8
Top = 20 Top = 20
...@@ -619,13 +637,13 @@ object MainForm: TMainForm ...@@ -619,13 +637,13 @@ object MainForm: TMainForm
OnChange = EditChange OnChange = EditChange
end end
end end
object GroupBox4: TGroupBox object PostsGroupBox: TGroupBox
Left = 8 Left = 8
Top = 168 Top = 168
Width = 137 Width = 137
Height = 73 Height = 73
Caption = 'Posts' Caption = 'Posts'
TabOrder = 3 TabOrder = 2
object Label32: TLabel object Label32: TLabel
Left = 8 Left = 8
Top = 20 Top = 20
...@@ -659,13 +677,13 @@ object MainForm: TMainForm ...@@ -659,13 +677,13 @@ object MainForm: TMainForm
OnChange = EditChange OnChange = EditChange
end end
end end
object GroupBox5: TGroupBox object EmailGroupBox: TGroupBox
Left = 296 Left = 296
Top = 144 Top = 144
Width = 137 Width = 137
Height = 97 Height = 97
Caption = 'E-mail' Caption = 'E-mail'
TabOrder = 4 TabOrder = 6
object Label34: TLabel object Label34: TLabel
Left = 8 Left = 8
Top = 20 Top = 20
...@@ -715,13 +733,13 @@ object MainForm: TMainForm ...@@ -715,13 +733,13 @@ object MainForm: TMainForm
OnChange = EditChange OnChange = EditChange
end end
end end
object GroupBox6: TGroupBox object UploadsGroupBox: TGroupBox
Left = 152 Left = 152
Top = 8 Top = 8
Width = 137 Width = 137
Height = 73 Height = 97
Caption = 'Uploads' Caption = 'Uploads'
TabOrder = 5 TabOrder = 3
object Label37: TLabel object Label37: TLabel
Left = 8 Left = 8
Top = 20 Top = 20
...@@ -754,14 +772,23 @@ object MainForm: TMainForm ...@@ -754,14 +772,23 @@ object MainForm: TMainForm
TabOrder = 1 TabOrder = 1
OnChange = EditChange OnChange = EditChange
end end
object UploadedBytesStaticText: TStaticText
Left = 72
Top = 68
Width = 58
Height = 21
AutoSize = False
BorderStyle = sbsSunken
TabOrder = 2
end
end end
object GroupBox7: TGroupBox object DownloadsGroupBox: TGroupBox
Left = 296 Left = 296
Top = 8 Top = 8
Width = 137 Width = 137
Height = 97 Height = 121
Caption = 'Downloads' Caption = 'Downloads'
TabOrder = 6 TabOrder = 5
object Label39: TLabel object Label39: TLabel
Left = 8 Left = 8
Top = 20 Top = 20
...@@ -780,7 +807,7 @@ object MainForm: TMainForm ...@@ -780,7 +807,7 @@ object MainForm: TMainForm
end end
object Label42: TLabel object Label42: TLabel
Left = 8 Left = 8
Top = 68 Top = 92
Width = 57 Width = 57
Height = 21 Height = 21
AutoSize = False AutoSize = False
...@@ -804,18 +831,27 @@ object MainForm: TMainForm ...@@ -804,18 +831,27 @@ object MainForm: TMainForm
end end
object LeechEdit: TEdit object LeechEdit: TEdit
Left = 72 Left = 72
Top = 68 Top = 92
Width = 57 Width = 57
Height = 21 Height = 21
TabOrder = 2 TabOrder = 2
OnChange = EditChange OnChange = EditChange
end end
object DownloadedBytesStaticText: TStaticText
Left = 72
Top = 68
Width = 58
Height = 21
AutoSize = False
BorderStyle = sbsSunken
TabOrder = 3
end
end end
end end
object SettingsTabSheet: TTabSheet object SettingsTabSheet: TTabSheet
Caption = 'Settings' Caption = 'Settings'
ImageIndex = 3 ImageIndex = 3
object GroupBox10: TGroupBox object TerminalGroupBox: TGroupBox
Left = 8 Left = 8
Top = 8 Top = 8
Width = 209 Width = 209
...@@ -863,13 +899,13 @@ object MainForm: TMainForm ...@@ -863,13 +899,13 @@ object MainForm: TMainForm
TabOrder = 1 TabOrder = 1
end end
end end
object GroupBox11: TGroupBox object LogonGroupBox: TGroupBox
Left = 224 Left = 224
Top = 8 Top = 8
Width = 209 Width = 209
Height = 113 Height = 113
Caption = 'Logon' Caption = 'Logon'
TabOrder = 1 TabOrder = 2
DesignSize = ( DesignSize = (
209 209
113) 113)
...@@ -890,13 +926,13 @@ object MainForm: TMainForm ...@@ -890,13 +926,13 @@ object MainForm: TMainForm
TabOrder = 0 TabOrder = 0
end end
end end
object GroupBox13: TGroupBox object ChatGroupBox: TGroupBox
Left = 224 Left = 224
Top = 128 Top = 128
Width = 209 Width = 209
Height = 113 Height = 113
Caption = 'Chat' Caption = 'Chat'
TabOrder = 2 TabOrder = 3
DesignSize = ( DesignSize = (
209 209
113) 113)
...@@ -917,13 +953,13 @@ object MainForm: TMainForm ...@@ -917,13 +953,13 @@ object MainForm: TMainForm
TabOrder = 0 TabOrder = 0
end end
end end
object GroupBox15: TGroupBox object CommandShellGroupBox: TGroupBox
Left = 8 Left = 8
Top = 168 Top = 168
Width = 209 Width = 209
Height = 73 Height = 73
Caption = 'Command Shell' Caption = 'Command Shell'
TabOrder = 3 TabOrder = 1
object ShellEdit: TEdit object ShellEdit: TEdit
Left = 8 Left = 8
Top = 24 Top = 24
...@@ -947,7 +983,7 @@ object MainForm: TMainForm ...@@ -947,7 +983,7 @@ object MainForm: TMainForm
object MsgFileSettingsTabSheet: TTabSheet object MsgFileSettingsTabSheet: TTabSheet
Caption = 'Msg/File Settings' Caption = 'Msg/File Settings'
ImageIndex = 4 ImageIndex = 4
object GroupBox16: TGroupBox object MessageGroupBox: TGroupBox
Left = 8 Left = 8
Top = 8 Top = 8
Width = 209 Width = 209
...@@ -982,20 +1018,20 @@ object MainForm: TMainForm ...@@ -982,20 +1018,20 @@ object MainForm: TMainForm
Left = 128 Left = 128
Top = 64 Top = 64
Width = 73 Width = 73
Height = 24 Height = 21
Anchors = [akLeft, akTop, akRight] Anchors = [akLeft, akTop, akRight]
CharCase = ecUpperCase CharCase = ecUpperCase
TabOrder = 1 TabOrder = 1
OnChange = EditChange OnChange = EditChange
end end
end end
object GroupBox12: TGroupBox object FileGroupBox: TGroupBox
Left = 224 Left = 224
Top = 8 Top = 8
Width = 209 Width = 209
Height = 153 Height = 153
Caption = 'File' Caption = 'File'
TabOrder = 1 TabOrder = 2
DesignSize = ( DesignSize = (
209 209
153) 153)
...@@ -1021,7 +1057,7 @@ object MainForm: TMainForm ...@@ -1021,7 +1057,7 @@ object MainForm: TMainForm
Left = 168 Left = 168
Top = 120 Top = 120
Width = 33 Width = 33
Height = 24 Height = 21
Anchors = [akLeft, akTop, akBottom] Anchors = [akLeft, akTop, akBottom]
CharCase = ecUpperCase CharCase = ecUpperCase
MaxLength = 3 MaxLength = 3
...@@ -1032,7 +1068,7 @@ object MainForm: TMainForm ...@@ -1032,7 +1068,7 @@ object MainForm: TMainForm
Left = 184 Left = 184
Top = 88 Top = 88
Width = 17 Width = 17
Height = 24 Height = 21
Anchors = [akLeft, akTop, akBottom] Anchors = [akLeft, akTop, akBottom]
CharCase = ecUpperCase CharCase = ecUpperCase
MaxLength = 1 MaxLength = 1
...@@ -1055,13 +1091,13 @@ object MainForm: TMainForm ...@@ -1055,13 +1091,13 @@ object MainForm: TMainForm
TabOrder = 2 TabOrder = 2
end end
end end
object GroupBox14: TGroupBox object QwkGroupBox: TGroupBox
Left = 8 Left = 8
Top = 112 Top = 112
Width = 209 Width = 209
Height = 129 Height = 129
Caption = 'QWK Message Packet' Caption = 'QWK Message Packet'
TabOrder = 2 TabOrder = 1
DesignSize = ( DesignSize = (
209 209
129) 129)
......
...@@ -109,7 +109,7 @@ __published: // IDE-managed Components ...@@ -109,7 +109,7 @@ __published: // IDE-managed Components
TEdit* ShellEdit; TEdit* ShellEdit;
TEdit* EditorEdit; TEdit* EditorEdit;
TEdit* TempFileExtEdit; TEdit* TempFileExtEdit;
TGroupBox *GroupBox1; TGroupBox *TimeOnGroupBox;
TCheckBox *ExpertCheckBox; TCheckBox *ExpertCheckBox;
TCheckListBox* TerminalCheckListBox; TCheckListBox* TerminalCheckListBox;
TCheckListBox* MessageCheckListBox; TCheckListBox* MessageCheckListBox;
...@@ -121,6 +121,25 @@ __published: // IDE-managed Components ...@@ -121,6 +121,25 @@ __published: // IDE-managed Components
TAction* SaveUser; TAction* SaveUser;
TAction* NewUser; TAction* NewUser;
TImageList* ImageList; TImageList* ImageList;
TGroupBox *DatesGroupBox;
TGroupBox *LogonsGroupBoxx;
TGroupBox *PostsGroupBox;
TGroupBox *UploadsGroupBox;
TGroupBox *DownloadsGroupBox;
TGroupBox *EmailGroupBox;
TGroupBox *FlagSetGroupBox;
TGroupBox *TerminalGroupBox;
TGroupBox *CommandShellGroupBox;
TGroupBox *LogonGroupBox;
TGroupBox *ChatGroupBox;
TGroupBox *MessageGroupBox;
TGroupBox *FileGroupBox;
TGroupBox *QwkGroupBox;
TGroupBox *AddressGroupBox;
TStaticText *CreditsStaticText;
TStaticText *FreeCreditsStaticText;
TStaticText *UploadedBytesStaticText;
TStaticText *DownloadedBytesStaticText;
void __fastcall EditChange(TObject *Sender); void __fastcall EditChange(TObject *Sender);
void __fastcall FormShow(TObject *Sender); void __fastcall FormShow(TObject *Sender);
void __fastcall ScrollBarChange(TObject *Sender); void __fastcall ScrollBarChange(TObject *Sender);
...@@ -143,6 +162,7 @@ private: // User declarations ...@@ -143,6 +162,7 @@ private: // User declarations
void __fastcall PutUserStr(TEdit*, enum user_field, const char*); void __fastcall PutUserStr(TEdit*, enum user_field, const char*);
void __fastcall PutUserText(TEdit*, enum user_field); void __fastcall PutUserText(TEdit*, enum user_field);
void __fastcall PutUserDate(TEdit*, enum user_field); void __fastcall PutUserDate(TEdit*, enum user_field);
void __fastcall PutUserBytes(TEdit*, enum user_field);
void __fastcall SaveChanges(void); void __fastcall SaveChanges(void);
void __fastcall SetBit(bool set_it, uint32_t& field, uint32_t bit); void __fastcall SetBit(bool set_it, uint32_t& field, uint32_t bit);
public: // User declarations public: // User declarations
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment