Skip to content

Commit

Permalink
Minor Tidy-Ups ready for first release :-)
Browse files Browse the repository at this point in the history
  • Loading branch information
SMerrony committed Mar 5, 2022
1 parent 45a6c6a commit dc0dcb3
Show file tree
Hide file tree
Showing 7 changed files with 34 additions and 27 deletions.
Binary file removed Screenshots/DasherA-20220304.png
Binary file not shown.
Binary file added Screenshots/DasherA-20220305.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 17 additions & 11 deletions Src/gui.adb
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,6 @@ package body GUI is
Gtk_New (Dialog);
Dialog.Set_Destroy_With_Parent (True);
Dialog.Set_Modal (True);
-- TODO: Dialog.Set_Logo
Dialog.Set_Title (App_Title & " - Resize Terminal");
Dlg_Box := Dialog.Get_Content_Area;

Expand Down Expand Up @@ -425,7 +424,6 @@ package body GUI is
Gtk_New (Dialog);
Dialog.Set_Destroy_With_Parent (True);
Dialog.Set_Modal (True);
-- TODO: Dialog.Set_Logo
Dialog.Set_Title (App_Title & " - Serial Port");
Dlg_Box := Dialog.Get_Content_Area;
Gtk.Grid.Gtk_New (Ser_Grid);
Expand Down Expand Up @@ -497,26 +495,26 @@ package body GUI is
when 3 => Rate := B9600;
when 4 => Rate := B19200;
when 5 => Rate := B38400;
when others => null; -- TODO raise exception;
when others => null;
end case;
case Bits_Combo.Get_Active is
when 0 => Bits := CS7;
when 1 => Bits := CS8;
when others => null; -- TODO raise exception;
when others => null;
end case;
case Parity_Combo.Get_Active is
when 0 => Parity := None;
when 1 => Parity := Even;
when 2 => Parity := Odd;
when others => null; -- TODO raise exception;
when others => null;
end case;
case Stop_Bits_Combo.Get_Active is
when 0 => Stop_Bits := One;
when 1 => Stop_Bits := Two;
when others => null; -- TODO raise exception;
when others => null;
end case;
Serial.Open (Port_Str, Rate, Bits, Parity, Stop_Bits);
-- TODO handle exceptions

Redirector.Router.Set_Destination (Redirector.Async);
Serial_Connect_Item.Set_Sensitive (False);
Serial_Disconnect_Item.Set_Sensitive (True);
Expand All @@ -525,6 +523,10 @@ package body GUI is
Xmodem_Rx_Item.Set_Sensitive (True);
Xmodem_Send_Item.Set_Sensitive (True);
Xmodem_Send1k_Item.Set_Sensitive (True);
exception
when others =>
Unused_Buttons := Gtkada.Dialogs.Message_Dialog (Msg => "Could not open Serial Port",
Title => "DasherA - Error");
end;
end if;
end if;
Expand Down Expand Up @@ -557,7 +559,6 @@ package body GUI is
Gtk_New (Dialog);
Dialog.Set_Destroy_With_Parent (True);
Dialog.Set_Modal (True);
-- TODO: Dialog.Set_Logo
Dialog.Set_Title (App_Title & " - Telnet Host");
Dlg_Box := Dialog.Get_Content_Area;
Gtk.Label.Gtk_New (Host_Label, "Host:");
Expand Down Expand Up @@ -589,14 +590,17 @@ package body GUI is
begin
Port_Num := Positive'Value (Port_Entry.Get_Text);
Telnet_Sess := Telnet.New_Connection (String(Host_Str), Port_Num);
-- TODO handle exceptions
Redirector.Router.Set_Destination (Redirector.Network);
Net_Connect_Item.Set_Sensitive (False);
Net_Disconnect_Item.Set_Sensitive (True);
Serial_Connect_Item.Set_Sensitive (False);
Serial_Disconnect_Item.Set_Sensitive (False);
Saved_Host := To_Unbounded_String (Host_Str);
Saved_Port := To_Unbounded_String (Port_Entry.Get_Text);
exception
when others =>
Unused_Buttons := Gtkada.Dialogs.Message_Dialog (Msg => "Could not connect",
Title => "DasherA - Error");
end;
end if;
end if;
Expand Down Expand Up @@ -1211,7 +1215,6 @@ package body GUI is

-- Virtual Keys, Function Keys and Template
Main_Grid.Add (Create_Keys_Box);
-- TODO All the labels
Template_Revealer := Create_Template_Labels_Revealer;
Main_Grid.Add (Template_Revealer);
Main_Grid.Add (Create_FKeys_Box);
Expand Down Expand Up @@ -1262,14 +1265,17 @@ package body GUI is
Port_Num : constant Positive := Positive'Value (Slice (Host_Arg, Colon_Ix + 1, Length(Host_Arg)));
begin
Telnet_Sess := Telnet.New_Connection (Host_Str, Port_Num);
-- TODO handle exceptions
Redirector.Router.Set_Destination (Redirector.Network);
Net_Connect_Item.Set_Sensitive (False);
Net_Disconnect_Item.Set_Sensitive (True);
Serial_Connect_Item.Set_Sensitive (False);
Serial_Disconnect_Item.Set_Sensitive (False);
Saved_Host := To_Unbounded_String (Host_Str);
Saved_Port := To_Unbounded_String (Slice (Host_Arg, Colon_Ix + 1, Length(Host_Arg)));
exception
when others =>
Unused_Buttons := Gtkada.Dialogs.Message_Dialog (Msg => "Could not connect to host",
Title => "DasherA - Error");
end;
end if;
end if;
Expand Down
4 changes: 2 additions & 2 deletions Src/gui.ads
Original file line number Diff line number Diff line change
Expand Up @@ -41,11 +41,11 @@ package GUI is
package Handlers is new Gtk.Handlers.Callback (Widget_Type => Gtk.Widget.Gtk_Widget_Record);
package SB_Timeout_P is new Glib.Main.Generic_Sources (Gtk.Box.Gtk_Box);

App_SemVer : constant String := "v0.11.0x"; -- TODO Update Version each release!
App_SemVer : constant String := "v0.11.0"; -- TODO Update Version each release!
App_Title : constant String := "DasherA";
App_Comment : constant String := "A Data General DASHER terminal emulator";
App_Author : constant String := "Stephen Merrony";
App_Copyright : constant String := "Copyright ©2021 S.Merrony";
App_Copyright : constant String := "Copyright ©2022 S.Merrony";
App_Icon : constant String := "DGlogoOrange.ico";
App_Website : constant String := "https://github.com/SMerrony/dashera";

Expand Down
2 changes: 1 addition & 1 deletion Src/telnet.adb
Original file line number Diff line number Diff line change
Expand Up @@ -29,13 +29,13 @@ package body Telnet is
Sess : aliased constant Session_Acc_T := new Session_T;
Address : GNAT.Sockets.Sock_Addr_Type;
begin
-- Exceptions should be handled by caller
GNAT.Sockets.Create_Socket (Sess.Conn);
Ada.Text_IO.Put_Line ("DEBUG: Host: " & Host_Str & ", Port: " & Port_Num'Image);
Address.Addr := GNAT.Sockets.Addresses (GNAT.Sockets.Get_Host_By_Name (Host_Str), 1);
Address.Port := GNAT.Sockets.Port_Type (Port_Num);
GNAT.Sockets.Connect_Socket (Sess.Conn, Address);
-- GNAT.Sockets.Set_Socket_Option (Socket => Sess.Conn, Option => (No_Delay, True));
-- TODO handle exceptions
Sess.Host_Str := To_Unbounded_String (Host_Str);
Sess.Port_Num := Port_Num;
Receiver_Task := new Receiver;
Expand Down
25 changes: 13 additions & 12 deletions Src/terminal.adb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ package body Terminal is

T.Updated := True;

Processor_Task := new Processor; -- TODO this is wonky...
Processor_Task := new Processor;
Processor_Task.Start (T);

return T;
Expand Down Expand Up @@ -383,17 +383,18 @@ package body Terminal is
T.Skip_Byte := True;
when Dasher_Normal =>
T.Underscored := False;
T.Skip_Byte := True;
when Dasher_Tab =>
T.Cursor_X := T.Cursor_X + 1; -- always at least 1 column
while (T.Cursor_X + 1) mod 8 /= 0 loop
if T.Cursor_X >= Display.Get_Visible_Cols - 1 then
T.Cursor_X := 0; -- TODO What about Cursor_Y ???
else
T.Cursor_X := T.Cursor_X + 1;
end if;
end loop;
T.Skip_Byte := True;
T.Skip_Byte := True;
-- TAB handling removed, according to the docs it is handled at the host end, not locally
-- when Dasher_Tab =>
-- T.Cursor_X := T.Cursor_X + 1; -- always at least 1 column
-- while (T.Cursor_X + 1) mod 8 /= 0 loop
-- if T.Cursor_X >= Display.Get_Visible_Cols - 1 then
-- T.Cursor_X := 0; -- ??? What about Cursor_Y ???
-- else
-- T.Cursor_X := T.Cursor_X + 1;
-- end if;
-- end loop;
-- T.Skip_Byte := True;
when Dasher_Write_Window_Addr =>
T.Getting_X_Addr := True;
T.Skip_Byte := True;
Expand Down
2 changes: 1 addition & 1 deletion Templates/MEMACS_template.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ Yank
End\Para


Exchge\Pt&Mk
Exchge\Pt&Mk



Expand Down

0 comments on commit dc0dcb3

Please sign in to comment.