Freeciv21
Develop your civilization from humble roots to a global empire
page_network.h
Go to the documentation of this file.
1 /**************************************************************************
2 \^~~~~\ ) ( /~~~~^/ * _ Copyright (c) 1996-2020 Freeciv21 and
3  ) *** \ {**} / *** ( * _ {o} _ Freeciv contributors. This file is
4  ) *** \_ ^^ _/ *** ( * {o}{o}{o} part of Freeciv21. Freeciv21 is free
5  ) **** vv **** ( * ~\ | /~software: you can redistribute it and/or
6  )_**** ****_( * OoO modify it under the terms of the GNU
7  )*** m m ***( * /|\ General Public License as published
8  by the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version. You should have received a copy of
10  the GNU General Public License along with Freeciv21.
11  If not, see https://www.gnu.org/licenses/.
12 **************************************************************************/
13 #pragma once
14 
15 #include "ui_page_network.h"
16 #include <QWidget>
17 // client
18 #include "servers.h"
19 
20 #include "fc_client.h" // conn state
21 class fc_client;
22 class QItemSelection;
23 
24 class page_network : public QWidget {
25  Q_OBJECT
26 
27 public:
28  page_network(QWidget *, fc_client *);
29  ~page_network() override;
31  void update_network_lists();
32  void set_connection_state(enum connection_state state);
33  void destroy_server_scans();
35  const char *message);
36 private slots:
37  void slot_meta_scan();
38  void slot_connect();
39  void slot_lan_scan();
40  void slot_selection_changed(const QItemSelection &,
41  const QItemSelection &);
42 
43 private:
44  void update_server_list(enum server_scan_type sstype,
45  const struct server_list *list);
46  bool check_server_scan(server_scan *scan_data);
47 
48  fc_client *king; // protect The King
49  QTimer *meta_scan_timer;
50  QTimer *lan_scan_timer;
51  Ui::FormPageNetwork ui;
52 };
53 
54 void server_scan_error(server_scan *, const char *);
void update_network_lists()
Stop and restart the metaserver and lan server scans.
void update_server_list(enum server_scan_type sstype, const struct server_list *list)
Updates list of servers in network page in proper QTableViews.
void slot_meta_scan()
Executes metaserver scan network.
void slot_lan_scan()
Executes lan scan network.
void slot_connect()
If on the network page, switch page to the login page (with new server and port).
QTimer * lan_scan_timer
Definition: page_network.h:50
void update_network_page()
void handle_authentication_req(enum authentication_type type, const char *message)
Configure the dialog depending on what type of authentication request the server is making.
bool check_server_scan(server_scan *scan_data)
This function updates the list of servers every so often.
~page_network() override
QTimer * meta_scan_timer
Definition: page_network.h:49
void slot_selection_changed(const QItemSelection &, const QItemSelection &)
void destroy_server_scans()
Free the server scans.
void set_connection_state(enum connection_state state)
Update network page connection state.
page_network(QWidget *, fc_client *)
fc_client * king
Definition: page_network.h:48
Ui::FormPageNetwork ui
Definition: page_network.h:51
connection_state
Definition: fc_client.h:42
authentication_type
Definition: packets.h:67
void server_scan_error(server_scan *, const char *)
Callback function for when there's an error in the server scan.
server_scan_type
Definition: servers.h:79