Skip to content

Commit

Permalink
New settings: enable_user_commands
Browse files Browse the repository at this point in the history
Added an option to the config file: enable/disable commands entered into the text input
Added new option to the "settings" dialog
  • Loading branch information
danhetrick committed Mar 14, 2021
1 parent e5c0d05 commit 4959a5e
Show file tree
Hide file tree
Showing 10 changed files with 33,067 additions and 33,039 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@ Version 0.860
* Removed some legacy plugin code from the chat interface
* New adaptive help system: commands that are disabled from commandline or settings will no longer appear in /help or autocomplete
* Made the "hide messages" section in the "settings" dialog a little prettier
* Added an option to the config file: enable/disable commands entered into the text input
* Added new option to the "settings" dialog

Version 0.850
* Changed the splash logo
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<p align="center">
<img src="https://github.com/nutjob-laboratories/erk/raw/master/images/logo_200x200.png"><br>
<a href="https://github.com/nutjob-laboratories/erk/releases/tag/0.840.114"><b>Download last stable release</b></a><br>
<a href="https://github.com/nutjob-laboratories/erk/raw/master/downloads/erk-latest.zip"><b>Download Ərk 0.860.067</b></a><br>
<a href="https://github.com/nutjob-laboratories/erk/raw/master/downloads/erk-latest.zip"><b>Download Ərk 0.860.071</b></a><br>
<a href="https://github.com/nutjob-laboratories/erk/blob/master/documentation/Erk_Scripting_and_Commands.pdf"><b>View Ərk command and scripting documentation</b></a>
</p>

**Ərk** is a graphical open source [Internet relay chat](https://en.wikipedia.org/wiki/Internet_Relay_Chat) client. The current development version is **0.860.067**.
**Ərk** is a graphical open source [Internet relay chat](https://en.wikipedia.org/wiki/Internet_Relay_Chat) client. The current development version is **0.860.071**.

**Ərk** is fully functional and ready for your use on Windows or Linux. Bugs are being fixed all the time, and features are still being tweaked, but it's ready.

Expand Down
Binary file modified downloads/erk-0.860.zip
Binary file not shown.
Binary file modified downloads/erk-latest.zip
Binary file not shown.
8 changes: 8 additions & 0 deletions erk/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,12 +154,15 @@
WRITE_PRIVATE_TO_CONSOLE = True
WRITE_NOTICE_TO_CONSOLE = True

ENABLE_COMMANDS = True

def save_settings(filename=SETTINGS_FILE):

if filename==None: filename = SETTINGS_FILE

settings = {

"enable_user_commands": ENABLE_COMMANDS,
"write_private_messages_to_console": WRITE_PRIVATE_TO_CONSOLE,
"write_notice_messages_to_console": WRITE_NOTICE_TO_CONSOLE,
"ignore_public_messages": IGNORE_PUBLIC,
Expand Down Expand Up @@ -265,6 +268,9 @@ def save_settings(filename=SETTINGS_FILE):

def patch_settings(data):

if not "enable_user_commands" in data:
data["enable_user_commands"] = ENABLE_COMMANDS

if not "write_private_messages_to_console" in data:
data["write_private_messages_to_console"] = WRITE_PRIVATE_TO_CONSOLE

Expand Down Expand Up @@ -481,6 +487,7 @@ def load_settings(filename=SETTINGS_FILE):
global IGNORE_NOTICE
global WRITE_PRIVATE_TO_CONSOLE
global WRITE_NOTICE_TO_CONSOLE
global ENABLE_COMMANDS

# Load in settings if the settings file exists...
if os.path.isfile(filename):
Expand All @@ -489,6 +496,7 @@ def load_settings(filename=SETTINGS_FILE):

data = patch_settings(data)

ENABLE_COMMANDS = data["enable_user_commands"]
WRITE_PRIVATE_TO_CONSOLE = data["write_private_messages_to_console"]
WRITE_NOTICE_TO_CONSOLE = data["write_notice_messages_to_console"]
IGNORE_PUBLIC = data["ignore_public_messages"]
Expand Down
2 changes: 1 addition & 1 deletion erk/data/minor.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
67
71
14 changes: 11 additions & 3 deletions erk/dialogs/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -783,7 +783,7 @@ def __init__(self,configfile=USER_FILE,parent=None,app=None):
hsButton.setIcon(QIcon(EDIT_ICON))
hsButton.setToolTip("Set history length")

self.historyLabel = QLabel("Command history: <b>"+str(config.HISTORY_LENGTH)+" lines</b>")
self.historyLabel = QLabel("Input history length: <b>"+str(config.HISTORY_LENGTH)+" lines</b>")

histEdLayout = QHBoxLayout()
histEdLayout.addWidget(hsButton)
Expand Down Expand Up @@ -820,8 +820,11 @@ def __init__(self,configfile=USER_FILE,parent=None,app=None):

autoBox.setStyleSheet("QGroupBox { font: bold; } QGroupBox::title { subcontrol-position: top center; }")

cpLayout = QVBoxLayout()
self.inputCommands = QCheckBox("Enable command input",self)
if config.ENABLE_COMMANDS: self.inputCommands.setChecked(True)

cpLayout = QVBoxLayout()
cpLayout.addWidget(self.inputCommands)
cpLayout.addWidget(histBox)
cpLayout.addWidget(autoBox)
cpLayout.addStretch()
Expand Down Expand Up @@ -1166,6 +1169,8 @@ def __init__(self,configfile=USER_FILE,parent=None,app=None):

def save(self):

config.ENABLE_COMMANDS = self.inputCommands.isChecked()

config.WRITE_NOTICE_TO_CONSOLE = self.writeNotice.isChecked()
config.WRITE_PRIVATE_TO_CONSOLE = self.writePrivate.isChecked()

Expand Down Expand Up @@ -1242,7 +1247,10 @@ def save(self):

if self.parent!= None:
if config.SHOW_CONSOLE_BUTTONS:
events.show_all_console_buttons()
if config.ENABLE_COMMANDS:
events.show_all_console_buttons()
else:
events.hide_all_console_buttons()
else:
events.hide_all_console_buttons()

Expand Down
Loading

0 comments on commit 4959a5e

Please sign in to comment.