added server name in window title
This commit is contained in:
		
							parent
							
								
									d197d1f501
								
							
						
					
					
						commit
						b23e96728b
					
				@ -320,6 +320,11 @@ void Courtroom::set_widgets()
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Courtroom::set_window_title(QString p_title)
 | 
			
		||||
{
 | 
			
		||||
  this->setWindowTitle(p_title);
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Courtroom::set_size_and_pos(QWidget *p_widget, QString p_identifier)
 | 
			
		||||
{
 | 
			
		||||
  QString design_ini_path = ao_app->get_theme_path() + "courtroom_design.ini";
 | 
			
		||||
 | 
			
		||||
@ -31,6 +31,7 @@ public:
 | 
			
		||||
  void append_music(QString f_music){music_list.append(f_music);}
 | 
			
		||||
 | 
			
		||||
  void set_widgets();
 | 
			
		||||
  void set_window_title(QString p_title);
 | 
			
		||||
  void set_size_and_pos(QWidget *p_widget, QString p_identifier);
 | 
			
		||||
  void set_taken(int n_char, bool p_taken);
 | 
			
		||||
  void set_char_select_page();
 | 
			
		||||
 | 
			
		||||
@ -158,6 +158,11 @@ QString Lobby::get_chatlog()
 | 
			
		||||
  return return_value;
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
int Lobby::get_selected_server()
 | 
			
		||||
{
 | 
			
		||||
  return ui_server_list->currentRow();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
void Lobby::on_public_servers_clicked()
 | 
			
		||||
{
 | 
			
		||||
  ui_public_servers->set_image("publicservers_selected.png");
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										1
									
								
								lobby.h
									
									
									
									
									
								
							
							
						
						
									
										1
									
								
								lobby.h
									
									
									
									
									
								
							@ -30,6 +30,7 @@ public:
 | 
			
		||||
  void show_loading_overlay(){ui_loading_background->show();}
 | 
			
		||||
  void hide_loading_overlay(){ui_loading_background->hide();}
 | 
			
		||||
  QString get_chatlog();
 | 
			
		||||
  int get_selected_server();
 | 
			
		||||
 | 
			
		||||
  ~Lobby();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										5
									
								
								main.cpp
									
									
									
									
									
								
							
							
						
						
									
										5
									
								
								main.cpp
									
									
									
									
									
								
							@ -1,4 +1,3 @@
 | 
			
		||||
#include <QDebug>
 | 
			
		||||
 | 
			
		||||
#include "aoapplication.h"
 | 
			
		||||
 | 
			
		||||
@ -7,8 +6,11 @@
 | 
			
		||||
#include "lobby.h"
 | 
			
		||||
#include "courtroom.h"
 | 
			
		||||
 | 
			
		||||
#include <QDebug>
 | 
			
		||||
 | 
			
		||||
int main(int argc, char *argv[])
 | 
			
		||||
{
 | 
			
		||||
 | 
			
		||||
    AOApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
 | 
			
		||||
    AOApplication main_app(argc, argv);
 | 
			
		||||
    main_app.construct_lobby();
 | 
			
		||||
@ -17,5 +19,6 @@ int main(int argc, char *argv[])
 | 
			
		||||
    main_app.send_ms_packet(f_packet);
 | 
			
		||||
    main_app.w_lobby->show();
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    return main_app.exec();
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
@ -138,9 +138,16 @@ void AOApplication::server_packet_received(AOPacket *p_packet)
 | 
			
		||||
    loaded_music = 0;
 | 
			
		||||
 | 
			
		||||
    destruct_courtroom();
 | 
			
		||||
 | 
			
		||||
    construct_courtroom();
 | 
			
		||||
 | 
			
		||||
    QString window_title = "Attorney Online 2";
 | 
			
		||||
    int selected_server = w_lobby->get_selected_server();
 | 
			
		||||
 | 
			
		||||
    if (selected_server >= 0 && selected_server < server_list.size())
 | 
			
		||||
      window_title += ": " + server_list.at(selected_server).name;
 | 
			
		||||
 | 
			
		||||
    w_courtroom->set_window_title(window_title);
 | 
			
		||||
 | 
			
		||||
    w_lobby->show_loading_overlay();
 | 
			
		||||
    w_lobby->set_loading_text("Loading");
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -4,7 +4,13 @@
 | 
			
		||||
#include <QDebug>
 | 
			
		||||
 | 
			
		||||
QString AOApplication::get_base_path(){
 | 
			
		||||
 | 
			
		||||
#ifdef OMNI_DEBUG
 | 
			
		||||
  return "/media/omnitroid/Data/winshare/AO/client/base/";
 | 
			
		||||
#else
 | 
			
		||||
  return (QDir::currentPath() + "/base/");
 | 
			
		||||
#endif
 | 
			
		||||
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
QString AOApplication::get_theme_path()
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user