scanhandler:
scan local area network for any IRC Servers which may be open
This commit is contained in:
32
src/main.py
32
src/main.py
@@ -16,6 +16,7 @@ from PrivacyNoticeDialog import PrivacyNoticeDialog
|
||||
from IRCPanel import IRCPanel
|
||||
from AboutDialog import AboutDialog
|
||||
from NotesDialog import NotesDialog
|
||||
from ScanWizard import ScanWizardDialog
|
||||
|
||||
# Set up logging
|
||||
logging.basicConfig(level=logging.INFO, format='%(asctime)s - %(levelname)s - %(message)s')
|
||||
@@ -68,7 +69,6 @@ class IRCFrame(wx.Frame):
|
||||
self.away = False
|
||||
self.timestamps = True
|
||||
|
||||
# Notes data - Add this
|
||||
self.notes_data = defaultdict(dict)
|
||||
|
||||
# User color mapping - darker colors for white theme
|
||||
@@ -358,6 +358,7 @@ class IRCFrame(wx.Frame):
|
||||
|
||||
# Tools menu
|
||||
tools_menu = wx.Menu()
|
||||
tools_menu.Append(210, "&wxScan\tCtrl+S")
|
||||
tools_menu.Append(208, "&wxNotes\tCtrl+T") # Add Notes menu item
|
||||
tools_menu.Append(201, "&WHOIS User\tCtrl+I")
|
||||
tools_menu.Append(202, "Change &Nick\tCtrl+N")
|
||||
@@ -369,6 +370,7 @@ class IRCFrame(wx.Frame):
|
||||
tools_menu.Append(205, "Set &Highlights")
|
||||
tools_menu.Append(206, "Auto-join Channels")
|
||||
tools_menu.Append(207, "Command Help")
|
||||
self.Bind(wx.EVT_MENU, self.on_scan_local_network, id=210)
|
||||
self.Bind(wx.EVT_MENU, self.on_notes, id=208) # Bind Notes menu item
|
||||
self.Bind(wx.EVT_MENU, self.on_menu_whois, id=201)
|
||||
self.Bind(wx.EVT_MENU, self.on_menu_change_nick, id=202)
|
||||
@@ -377,6 +379,7 @@ class IRCFrame(wx.Frame):
|
||||
self.Bind(wx.EVT_MENU, self.on_menu_highlights, id=205)
|
||||
self.Bind(wx.EVT_MENU, self.on_menu_autojoin, id=206)
|
||||
self.Bind(wx.EVT_MENU, self.on_menu_help, id=207)
|
||||
self.Bind(wx.EVT_MENU, self.on_scan_local_network, id=210)
|
||||
|
||||
menubar.Append(file_menu, "&File")
|
||||
menubar.Append(edit_menu, "&Edit")
|
||||
@@ -882,6 +885,33 @@ Available commands:
|
||||
except Exception as e:
|
||||
logger.error(f"Error adding channel: {e}")
|
||||
|
||||
def on_scan_local_network(self, event):
|
||||
"""Launch the local network scan wizard."""
|
||||
try:
|
||||
wizard = ScanWizardDialog(self)
|
||||
wizard.run()
|
||||
wizard.Destroy()
|
||||
except Exception as e:
|
||||
logger.error(f"Error opening scan wizard: {e}")
|
||||
self.log_server(f"Scan wizard failed to open: {e}", wx.Colour(255, 0, 0))
|
||||
|
||||
def quick_connect(self, server, port):
|
||||
"""Populate connection fields and initiate a connection if idle."""
|
||||
try:
|
||||
if self.is_connected() or self.is_connecting:
|
||||
wx.MessageBox("Please disconnect before using Quick Connect.", "Already connected", wx.OK | wx.ICON_INFORMATION)
|
||||
return False
|
||||
self.server_ctrl.SetValue(server)
|
||||
self.port_ctrl.SetValue(str(port))
|
||||
self.SetStatusText(f"Quick connect ready: {server}:{port}")
|
||||
wx.CallAfter(self.on_connect, None)
|
||||
self.log_server(f"Quick connecting to {server}:{port}", wx.Colour(0, 0, 128))
|
||||
return True
|
||||
except Exception as e:
|
||||
logger.error(f"Quick connect failed: {e}")
|
||||
self.log_server(f"Quick connect failed: {e}", wx.Colour(255, 0, 0))
|
||||
return False
|
||||
|
||||
# Menu handlers
|
||||
def on_menu_join(self, event):
|
||||
try:
|
||||
|
||||
Reference in New Issue
Block a user