diff options
| author | Cerapter <cerap@protonmail.com> | 2018-07-27 22:06:09 +0200 |
|---|---|---|
| committer | Cerapter <cerap@protonmail.com> | 2018-07-27 22:06:09 +0200 |
| commit | 977a88a2672ff9bd6ebec8b29eb37f7a120c1e1f (patch) | |
| tree | bf25709cbbed097b85b1258c2b403c5eb46af214 | |
| parent | 3295e5a78e55e1cc11b6ee705fff3ca54c2a02f6 (diff) | |
Ability to set a default username added.
- Done by adding a `default_username = whatever` to your `config.ini`.
- `whatever` can be any string.
- If nothing is given, it defaults to the, uh, default nothing.
| -rw-r--r-- | aoapplication.h | 3 | ||||
| -rw-r--r-- | courtroom.cpp | 2 | ||||
| -rw-r--r-- | text_file_functions.cpp | 6 |
3 files changed, 11 insertions, 0 deletions
diff --git a/aoapplication.h b/aoapplication.h index eb518f3..947bb1d 100644 --- a/aoapplication.h +++ b/aoapplication.h @@ -133,6 +133,9 @@ public: //may contain, from config.ini. int get_max_log_size(); + // Returns the username the user may have set in config.ini. + QString get_default_username(); + //Returns the list of words in callwords.ini QStringList get_call_words(); diff --git a/courtroom.cpp b/courtroom.cpp index 264192d..d3e3728 100644 --- a/courtroom.cpp +++ b/courtroom.cpp @@ -111,6 +111,8 @@ Courtroom::Courtroom(AOApplication *p_ao_app) : QMainWindow() ui_ooc_chat_name->setFrame(false); ui_ooc_chat_name->setPlaceholderText("Name"); + ui_ooc_chat_name->setText(p_ao_app->get_default_username()); + //ui_area_password = new QLineEdit(this); //ui_area_password->setFrame(false); ui_music_search = new QLineEdit(this); diff --git a/text_file_functions.cpp b/text_file_functions.cpp index f35de91..db858cb 100644 --- a/text_file_functions.cpp +++ b/text_file_functions.cpp @@ -99,6 +99,12 @@ int AOApplication::get_max_log_size() else return f_result.toInt(); } +QString AOApplication::get_default_username() +{ + QString f_result = read_config("default_username"); + return f_result; +} + QStringList AOApplication::get_call_words() { QStringList return_value; |
