Freeciv21
Develop your civilization from humble roots to a global empire
gotodlg.h
Go to the documentation of this file.
1 /**************************************************************************
2  Copyright (c) 1996-2020 Freeciv21 and Freeciv contributors. This file is
3  part of Freeciv21. Freeciv21 is free software: you can redistribute it
4  and/or modify it under the terms of the GNU General Public License as
5  published by the Free Software Foundation, either version 3 of the
6  License, or (at your option) any later version. You should have received
7  a copy of the GNU General Public License along with Freeciv21. If not,
8  see https://www.gnu.org/licenses/.
9 **************************************************************************/
10 #pragma once
11 
12 // Qt
13 #include <QWidget>
14 // common
15 #include "unit.h"
16 
17 class QTableWidget;
18 class QPushButton;
19 class QCheckBox;
20 class QGridLayout;
21 class QItemSelection;
22 class QLabel;
23 
24 /***************************************************************************
25  Class for displaying goto/airlift dialog (widget)
26 ***************************************************************************/
27 class goto_dialog : public QWidget {
28  Q_OBJECT
29  QTableWidget *goto_tab;
30  QPushButton *goto_city;
31  QPushButton *airlift_city;
32  QPushButton *close_but;
33  QCheckBox *show_all;
34  QGridLayout *layout;
35  QLabel *show_all_label;
36 
37 public:
38  goto_dialog(QWidget *parent = 0);
39  void init();
40  ~goto_dialog() override;
41  void update_dlg();
42  void show_me();
43  void sort_def();
44 
45 private slots:
46  void go_to_city();
47  void airlift_to();
48  void close_dlg();
49  void item_selected(const QItemSelection &sl, const QItemSelection &ds);
50  void checkbox_changed(int state);
51 
52 protected:
53  void paint(QPainter *painter, QPaintEvent *event);
54  void paintEvent(QPaintEvent *event) override;
55 
56 private:
57  void fill_tab(struct player *pplayer);
59 };
60 
61 void popup_goto_dialog();
void sort_def()
Sorts dialog by default column (0)
Definition: gotodlg.cpp:167
QPushButton * close_but
Definition: gotodlg.h:32
void go_to_city()
Slot for goto for city.
Definition: gotodlg.cpp:285
QPushButton * goto_city
Definition: gotodlg.h:30
void update_dlg()
Updates table in widget.
Definition: gotodlg.cpp:195
void init()
Sets variables which must be destroyed later.
Definition: gotodlg.cpp:98
void close_dlg()
Slot for hiding dialog.
Definition: gotodlg.cpp:305
struct tile * original_tile
Definition: gotodlg.h:58
QCheckBox * show_all
Definition: gotodlg.h:33
~goto_dialog() override
Destructor for goto dialog.
Definition: gotodlg.cpp:109
goto_dialog(QWidget *parent=0)
Constructor for goto_dialog.
Definition: gotodlg.cpp:38
void checkbox_changed(int state)
Slot for checkbox 'all nations'.
Definition: gotodlg.cpp:119
QLabel * show_all_label
Definition: gotodlg.h:35
QTableWidget * goto_tab
Definition: gotodlg.h:29
void paint(QPainter *painter, QPaintEvent *event)
Paints rectangles for goto_dialog.
Definition: gotodlg.cpp:314
QPushButton * airlift_city
Definition: gotodlg.h:31
void airlift_to()
Slot for airlifting unit.
Definition: gotodlg.cpp:264
void show_me()
Shows and moves widget.
Definition: gotodlg.cpp:175
void paintEvent(QPaintEvent *event) override
Paint event for goto_dialog.
Definition: gotodlg.cpp:326
void item_selected(const QItemSelection &sl, const QItemSelection &ds)
User has chosen some city on table.
Definition: gotodlg.cpp:128
QGridLayout * layout
Definition: gotodlg.h:34
void fill_tab(struct player *pplayer)
Helper for function for filling table.
Definition: gotodlg.cpp:215
enum event_type event
Definition: events.cpp:68
void popup_goto_dialog()
Definition: gotodlg.cpp:338
Definition: player.h:231
Definition: tile.h:42