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;