DELTA 18893 42870 607
SVN  †,—^h …h €ƒ	 G €‰/ G €„0#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

extern "C" {
#include "diplodlg_g.h"
}
#include "game.h"
#include "research.h"
#include "sprite.h"
#include "tilespec.h"

// gui-qt
#include <QHeaderView>
#include <QLayout>
#include <QMap>
#include <QSpinBox>
#include <QStyle>
#include <QTabWidget>
#include <QTableWidget>
#include <QWidget>

class QIcon;
class QLabel;
class QPushButton;

******
  Diplomacy tab for one nation
****************************************************************************/
class diplo_wdg: public QWidget
{
  Q_OBJECT
  QGridLayout *layout;
  QLabel *plr1_accept;
  QLabel *plr2_accept;
  QPushButton *accept_treaty;
  QPushButton *cancel_treaty;
  QSpinBox *gold_edit1;
  QSpinBox *gold_edit2;
  QTableWidget *text_edit;

public:
  diplo_wdg(int id, int id2);
  ~diplo_wdg();
  void update_wdg();
  void set_index(int ind);
  int get_index();
  struct Treaty treaty;

private slots:
  void all_advances();
  void dbl_click(QTableWidgetItem *item);
  void give_advance(int tech);
  void give_city(int city_num);
  void give_embassy();
  void give_shared_vision();
  void gold_changed1(int val);
  void gold_changed2(int val);
  void pact_allianze();
  void pact_ceasfire();
  void pact_peace();
  void response_accept();
  void response_cancel();
  void sea_map_clause();
  void show_menu(int player);
  void show_menu_p1();
  void show_menu_p2();
  void world_map_clause();

protected:
  void closeEvent(QCloseEvent *event);
private:
  int player1;
  int player2;
  int active_menu;
  int curr_player;
  bool p1_accept;
  bool p2_accept;
  int index;
};

******
  Diplomacy dialog containing many diplo_wdg
****************************************************************************/
class diplo_dlg: public QTabWidget
{
  Q_OBJECT
  QMap<int, diplo_wdg *> treaty_list;

public:
  diplo_dlg(int counterpart, int initiated_from);
  ~diplo_dlg();
  void update_dlg();
  void init(bool raise);
  diplo_wdg *find_widget(int counterpart);
  void close_widget(int counterpart);
  void add_widget(int counterpart, int initiated_from);
  void make_active(int party);

private:
  int index;
};

#endif /* FC__DIPLODLG_H */
ENDREP
DELTA 25334 26520 20138
SVN  ³`´M<ƒP á €u há,š ”â1 ‚}ö3ª ‚:ùO€g šü) Q™@– Tz€ Z–@ ™Ošresearch_advance_name_translation(research,
                                                    research->researchingresearch->researching_costnresearch_advance_name_translation(researchresearch_advance_name_translation(research,
                                                           Adds plr_report to tabvoid plr_report::init()
{
  gui()->gimme_place(this, "PLR");
  index = gui()->add_game_tab(this, _("Players"));
  gui()->game_tab_widget->setCurrentIndexENDREP
DELTA 18984 0 832
SVN  Œ#‰_‚Hß# G  …H€‚ G • K† €{ ƒ_ˆ2€ƒ% G µ K† ¸ G ° K† ¶ G ¥ K† €_ G » K† € G €| K† €‹H G ¥ K† €C G § K† €N G ¤ K† €J G £ K† €1 G ž K† €‚( G ’ K† ¯ G ¸ K† € G ³ K† €‚  G ª K† €D G ¬ K† €ƒ$ G ¾ K† €‚ G €7 K† €" G €@ K† € G ¬ K† €‚: G ® K† € G €I K† €U G Ÿ K† €m G Ÿ K† €n G ž K† €O G ° K† €ƒX G ¬ K† €_ G § K† €j G ­ K† €mfc_config.h>
#endif

// Qt
#include <QApplication>
#include <QMainWindow>
#include <QLineEdit>
#include <QStatusBar>
#include <QTabBar>
#include <QTextEdit>

// common
#include "game.h"

// gui-qt
#include "fc_client.h"
#include "optiondlg.h"


extern QApplication *qapp;

******
  Constructor
*/
fc_client::fc_client() : QObject()
{
  struct rgbcolor *prgbcolor;

  /**
   * Somehow freeciv-client-common asks to switch to page when all widgets
   * haven't been created yet by Qt, even constructor finished job,
   * so we null all Qt objects, so while switching we will know if they
   * were created.
   * After adding new QObjects null them here.
   */
  main_window = NULL;
  main_wdg = NULL;
  connect_lan = NULL;
  connect_metaserver = NULL;
  central_layout = NULL;
  output_window = NULL;
  scenarios_view = NULL;
  connect_host_edit = NULL;
  connect_port_edit = NULL;
  connect_login_edit = NULL;
  connect_password_edit = NULL;
  connect_confirm_password_edit = NULL;
  button = NULL;
  button_box = NULL;
  server_notifier = NULL;
  chat_line = NULL;
  connect_tab_widget = NULL;
  lan_widget = NULL;
  wan_widget = NULL;
  info_widget = NULL;
  saves_load = NULL;
  scenarios_load = NULL;
  start_players = NULL;
  meta_scan_timer = NULL;
  lan_scan_timer = NULL;
  status_bar = NULL;
  status_bar_label = NULL;
  menu_bar = NULL;
  mapview_wdg = NULL;
  messages_window = NULL;
  game_info_label = NULL;
  central_wdg = NULL;
  game_tab_widget = NULL;
  ver_dock_layout = NULL;
  start_players_tree = NULL;
  unit_sel = NULL;
  info_tile_wdg = NULL;
  opened_dialog = NULL;
  current_unit_id = -1;
  current_unit_target_id[ATK_CITY] = -1;
  current_unit_target_id[ATK_UNIT] = -1;
  quitting = false;

  for (int i = 0; i < LAST_WIDGET; i++) {
    dock_widget[i] = NULL;
  }

  for (int i = 0; i <= PAGE_GGZ; i++) {
    pages_layout[i] = NULL;
    pages[i] = NULL;
  }
  main_window = new QMainWindow;
  central_wdg = new QWidget;
  central_layout = new QGridLayout;

  // General part not related to any single page
  create_dock_widgets();
  menu_bar = new mr_menu();
  menu_bar->setup_menus();
  main_window->setMenuBar(menu_bar);
  status_bar = main_window->statusBar();
  status_bar_label = new QLabel;
  status_bar_label->setAlignment(Qt::AlignCenter);
  status_bar->addWidget(status_bar_label, 1);
  set_status_bar(_("Welcome to Freeciv"));

  switch_page_mapper = new QSignalMapper;
  // PAGE_MAIN
  pages[PAGE_MAIN] = new QWidget(central_wdg);
  page = PAGE_MAIN;
  create_main_page();

  // PAGE_START
  pages[PAGE_START] = new QWidget(central_wdg);
  create_start_page();

  // PAGE_SCENARIO
  pages[PAGE_SCENARIO] = new QWidget(central_wdg);
  create_scenario_page();

  // PAGE_LOAD
  pages[PAGE_LOAD] = new QWidget(central_wdg);
  create_load_page();

  // PAGE_NETWORK
  pages[PAGE_NETWORK] = new QWidget(central_wdg);
  create_network_page();
  meta_scan_timer = new QTimer;
  lan_scan_timer = new QTimer;
  pages[PAGE_NETWORK]->setVisible(false);

  // PAGE_GAME
  pages[PAGE_GAME] = new QWidget(central_wdg);
  init_mapcanvas_and_overview();
  create_game_page();
  pages[PAGE_GAME]->setVisible(false);

  // PAGE_GGZ
  pages[PAGE_GGZ] = NULL;
  central_layout->addLayout(pages_layout[PAGE_MAIN], 1, 1);
  central_layout->addLayout(pages_layout[PAGE_NETWORK], 1, 1);
  central_layout->addLayout(pages_layout[PAGE_LOAD], 1, 1);
  central_layout->addLayout(pages_layout[PAGE_SCENARIO], 1, 1);
  central_layout->addLayout(pages_layout[PAGE_START], 1, 1);
  central_layout->addLayout(pages_layout[PAGE_GAME], 1, 1);
  central_wdg->setLayout(central_layout);
  main_window->setCentralWidget(central_wdg);
  main_window->addDockWidget(Qt::RightDockWidgetArea,
                             dock_widget[ (int) OUTPUT_DOCK_WIDGET]);
  main_window->addDockWidget(Qt::BottomDockWidgetArea,
                             dock_widget[ (int) MESSAGE_DOCK_WIDGET]);

  connect(switch_page_mapper, SIGNAL(mapped( int)),
                this, SLOT(switch_page(int)));
  fc_fonts.init_fonts();
  /* workaround for changing tileset from main page */
  prgbcolor = rgbcolor_new(0,0,0);
  game.plr_bg_color = prgbcolor
  qRegisterMetaType<QTextCursor> ("QTextCursor");
  fc_allocate_ow_mutex();
  real_output_window_append(_("This is Qt-client for Freeciv."), NULL, -1);
  fc_release_ow_mutex();
  chat_welcome_message();

  set_client_state(C_S_DISCONNECTED);

  startTimer(TIMER_INTERVAL);
  connect(qapp, SIGNAL(aboutToQuit()), this, SLOT(closing()));
  qapp->exec();

  free_mapcanvas_and_overview();
  tileset_free_tiles(tileset);
}

******
  Returns status if fc_client is being closed
*/
bool fc_client::is_closing()
{
  return quitting;
}

******
  Called when fc_client is going to quit
*/
void fc_client::closing()
{
  quitting = true;
}


******
  Appends text to chat window
*/
void fc_client::append_output_window(const QString &str)
{
  output_window->append(str);
}

******
  Return whether chatline should be active on page.
*/
bool fc_client::chat_active_on_page(enum client_pages check)
{
  if (check == PAGE_START || check == PAGE_GAME) {
    return true;
  }

  return false;
}

******
  Switch from one client page to another.
  Argument is int cause QSignalMapper doesn't want to work with enum
  Because chat widget is in 2 layouts we need to switch between them here
  (addWidget removes it from prevoius layout automatically)
*/
void fc_client::switch_page(int new_pg)
{
  char buf[256];
  enum client_pages new_page;

  new_page = static_cast<client_pages>(new_pg);
  main_window->menuBar()->setVisible(false);
  hide_dock_widgets();
  ver_dock_layout->addWidget(output_window);
  ver_dock_layout->addWidget(chat_line);

  for (int i = 0; i < PAGE_GGZ + 1; i++) {
    if (i == new_page) {
      show_children(pages_layout[i], true);
    } else {
      show_children(pages_layout[i], false);
    }
  }

  page = new_page;
  switch (page) {
  case PAGE_MAIN:
    show_dock_widget(static_cast<int>(OUTPUT_DOCK_WIDGET), true);
    break;
  case PAGE_START:
    pages_layout[PAGE_START]->addWidget(chat_line, 5, 0, 1, 3);
    pages_layout[PAGE_START]->addWidget(output_window,3,0,2,8);
    break;
  case PAGE_LOAD:
    update_load_page();
    break;
  case PAGE_GAME:
    main_window->showMaximized();
    main_window->menuBar()->setVisible(true);
    show_dock_widget(static_cast<int>(OUTPUT_DOCK_WIDGET), true);
    show_dock_widget(static_cast<int>(MESSAGE_DOCK_WIDGET), true);
    mapview_wdg->setFocus();
    center_on_something();
    break;
  case PAGE_SCENARIO:
    update_scenarios_page();
    break;
  case PAGE_NETWORK:
    hide_dock_widgets();
    update_network_lists();
    connect_host_edit->setText(server_host);
    fc_snprintf(buf, sizeof(buf), "%d", server_port);
    connect_port_edit->setText(buf);
    connect_login_edit->setText(user_name);
    break;
  case PAGE_GGZ:
    break;
  }
}

******
  Returns currently open page
*/
enum client_pages fc_client::current_page()
{
  return page;
}

******
  Add notifier for server input
*/
void fc_client::add_server_source(int sock)
{
  server_notifier = new QSocketNotifier(sock, QSocketNotifier::Read);

  connect(server_notifier, SIGNAL(activated(int)), this, SLOT(server_input(int)));
}

******
  There is input from server
*/
void fc_client::server_input(int sock)
{
  input_from_server(sock);
}

******
  Enter pressed on chatline
*/
void fc_client::chat()
{
  send_chat(chat_line->text().toUtf8().data());
  real_output_window_append(chat_line->text().toUtf8().data(), NULL, -1);
  chat_line->clear();
}



******
  Timer event handling
*/
void fc_client::timerEvent(QTimerEvent *event)
{
  // Prevent current timer from repeating with possibly wrong interval
  killTimer(event->timerId());

  // Call timer callback in client common code and
  // start new timer with correct interval
  startTimer(real_timer_callback() * 1000);
}

******
  Quit App
*/
void fc_client::quit()
{
  qapp->quit();
}

******
  Disconnect from server and return to MAIN PAGE
*/
void fc_client::slot_disconnect()
{
  if (client.conn.used) {
    disconnect_from_server();
  }

  switch_page(PAGE_MAIN);
}

******
  User clicked Observe button in START_PAGE
*/
void fc_client::slot_pregame_observe()
{
  if (client_is_observer() || client_is_global_observer()) {
    send_chat("/take -");
    obs_button->setText(_("Don't Observe"));
  } else {
    send_chat("/obs");
    obs_button->setText(_("Observe"));
  }
}

******
  User clicked Start in START_PAGE
*/
void fc_client::slot_pregame_start()
{
  send_chat("/start");
}

******
  Shows all widgets for given layout
*/
void fc_client::show_children(const QLayout* layout, bool show)
{
  QLayoutItem *item = NULL;
  QWidget *widget = NULL;

  if (layout) {
    for (int i = 0; i < layout->count(); i++) {
      item = layout->itemAt(i);
      widget = item ? item->widget() : 0;

      if (widget) {
        widget->setVisible(show);
      }

      if (item->layout()) {
        show_children(item->layout(), show);
      }
    }
  }
}

******
  Finds not used index on game_view_tab and returns it
*/
void fc_client::gimme_place(QWidget* widget, QString str)
{
  QString x;
  x = opened_repo_dlgs.key(widget);

      if (x.isEmpty()) {
        opened_repo_dlgs.insert(str, widget);
        return;
    }
  log_error("Failed to find place for new tab widget");
  return;
}

******
  Checks if given report is opened, if you create new report as tab on game
  page, figure out some original string and put in in repodlg.h as comment to
  that QWidget class.
*/
bool fc_client::is_repo_dlg_open(QString str)
{
  QWidget *w;

  w = opened_repo_dlgs.value(str);

  if (w == NULL) {
    return false;
  }

  return true;
}

******
  Returns index on game tab page of given report dialog 
*/
int fc_client::gimme_index_of(QString str)
{
  int i;
  QWidget *w;

  w = opened_repo_dlgs.value(str);
  i = game_tab_widget->indexOf(w);
  return i;
}

******
  Shows/closes unit selection widget
*/
void fc_client::toggle_unit_sel_widget(struct tile *ptile)
{
  if (unit_sel != NULL) {
    unit_sel->close();
    delete unit_sel;
    unit_sel = new unit_select(ptile, gui()->mapview_wdg);
    unit_sel->show();
  } else {
    unit_sel = new unit_select(ptile, gui()->mapview_wdg);
    unit_sel->show();
  }
}

******
  Update unit selection widget if open
*/
void fc_client::update_unit_sel()
{
  if (unit_sel != NULL){
    unit_sel->update_units();
    unit_sel->create_pixmap();
    unit_sel->update();
  }
}

******
  Removes report dialog string from the list marking it as closed
*/
void fc_client::remove_repo_dlg(QString str)
{
  opened_repo_dlgs.remove(str);
}

******
  Popups client options
*/
void fc_client::popup_client_options()
{
  option_dialog_popup(_("Set local options"), client_optset);
}

******
  Popups client options
*/
void fc_client::popup_server_options()
{
  option_dialog_popup(_("Set server options"), server_optset);
}

******
  Returns desired font
*/
QFont *fc_font::get_font(QString name)
{
  /**
   * example: get_font("gui_qt_font_city_label")
   */

  if (font_map.contains(name)) {
    return font_map.value(name);
  } else {
    return NULL;
  }
}

******
  Initiazlizes fonts from client options
*/
void fc_font::init_fonts()
{
  QFont *f;
  QString s;

  /**
   * default font names are:
   * gui_qt_font_city_label
   * gui_qt_font_notify_label and so on.
   * (full list is in options.c in client dir)
   */

  options_iterate(client_optset, poption) {
    if (option_type(poption) == OT_FONT) {
      f = new QFont;
      s = option_font_get(poption);
      f->fromString(s);
      s = option_name(poption);
      set_font(s, f);
    }
  } options_iterate_end;
}

******
  Adds new font or overwrite old one
*/
void fc_font::set_font(QString name, QFont * qf)
{
  font_map.insert(name,qf);
}

fc_game_tab_widget::fc_game_tab_widget(): QTabWidget()
{
  connect(this, SIGNAL(currentChanged(int)), SLOT(restore_label_color(int)));
}

******
  Restores black color of label
*/
void fc_game_tab_widget::restore_label_color(int index)
{
  change_color(index, QColor(Qt::black));
}

******
  Changes color of tab widget's label
*/
void fc_game_tab_widget::change_color(int index, QColor col)
{
  tabBar()->setTabTextColor(index, col);
}
ENDREP
DELTA 25193 5329 290
SVN  #
 …  ˆ„~		\
	meta_diploENDREP
DELTA 22933 52594 5293
SVN  ¯´0Q‹C ˆ' ¨ |‹9‹ o‹„ t‹w€ tŽ{€ƒ4 Šm€ šr” J›m€ƒP 8ž€k \ 8 X¡/‡ Š`¡|€Z U­.Qt
#include <QTabWidget>
#include <QMap>tilespec.h"misccanvas.h"
#include "chatline.h"
#include "dialogs.h"
#include "mapview.h"
#include "menu.h"
#include "pages.h"
#include "ratesdlg.h"class QLabel;
class QLineEdit;
class QLineEdit;
class QString;
class QTableWidget;
class QTextEdit;
class QTimer;
class QSocketNotifier;
class QDialog;
class QApplication;
class QTreeWidget;
class QDockWidget;
class QStatusBar;
class QMainWindow;

class fc_game_tab_widget: public QTabWidget
{
  Q_OBJECT
public:
  fc_game_tab_widget();
  void change_color(int index, QColor col);
private slots:
  void restore_label_color(int index);
}  unit_select *unit_sel;
  info_tile *info_tile_wdg;
  choice_dialog *opened_dialog;
  int current_unit_id;
  int current_unit_target_id[ATK_COUNT];unit_label *unitinfo);
  void rm_game_tab(int index); /* doesn't delete widget */
  void update_start_page();
  void toggle_unit_sel_widget(struct tile *ptile);
  void update_unit_sel();
  void popup_tile_info(struct tile *ptile);
  void popdown_tile_info();
  void set_current_unit(int curr, int target, action_target_kind tgt);
  void get_current_unit(int *curr, int *target, action_target_kind tgt);
  void set_diplo_dialog(choice_dialog *widget);
  choice_dialog *get_diplo_dialogfc_game_tab_widget *game_tab_widget;
  void gimme_place(QWidget* widget, QString str);
  int gimme_index_ofbool is_closing(closingMap<QString, QWidget*> opened_repo_dlgs;
  bool send_new_aifill_to_server;
  bool quittingENDREP
DELTA 18893 21553 1192
SVN  •{ð)ƒ$º …X €7 G ª CŽ@€§y G © CŽ@¨ G €K CŽ@€„; G ¼ CŽ@€ G § CŽ@€k G ¨ CŽ@€k G » CŽ@€©\ G ¥ CŽ@€{ G « CŽ@€‚  G ¨ CŽ@€} G ¦ CŽ@€~ G £ CŽ@€w G   CŽ@€| G ¢ CŽ@€{ G ¢ CŽ@€ƒ5 G ¥ CŽ@€ƒ3 G ª CŽ@€‰C G ¥ CŽ@€E G ¤ CŽ@€E G ¢ CŽ@€B G ¢ CŽ@» G €H CŽ@€‰l G ± CŽ@€3 G ± CŽ@€5 G ª CŽ@€ G €C CŽ@€„z G · CŽ@€ G ´ CŽ@€ƒ4 G © CŽ@€‚	 G ² CŽ@€l G § CŽ@€Y G ¹ CŽ@€D G  ‚†l€ƒ= G  r‰l€† G  CŒ7€ƒ@ G  {Ž€‚ G  E‘Q€ƒE G  Q”€yfc_config.h>
#endif

#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// gui-qt
#include "qtg_cxxside.h"

#include "diplodlg.h"

typedef advance *p_advance;
typedef city *p_city;

******
  Constructor for diplomacy widget
*********/
diplo_wdg::diplo_wdg(int counterpart, int initiated_from): QWidget()
{
  QString text;
  QString text2;
  QLabel *plr1_label;
  QLabel *plr2_label;
  QLabel *label;
  QLabel *label2;
  QLabel *label3;
  QLabel *label4;
  QLabel *goldlab1;
  QLabel *goldlab2;
  QPushButton *add_clause1;
  QPushButton *add_clause2;
  QPixmap *pix = NULL;
  struct sprite *sprite, *sprite2;
  char plr_buf[4 * MAX_LEN_NAME];
  QHeaderView *header;

  if (counterpart == initiated_from) {
    initiated_from = client_player_number();
  }
  p1_accept = false;
  p2_accept = false;
  player1 = initiated_from;
  player2 = counterpart;
  layout = new QGridLayout;

  init_treaty(&treaty, player_by_number(counterpart),
              player_by_number(initiated_from));
  label3 = new QLabel;
  text = "<b><h3><center>"
         + QString(nation_plural_for_player(player_by_number(initiated_from)))
         + "</center></h3></b>";
  label3->setText(text);
  label4 = new QLabel;
  text = "<b><h3><center>"
         + QString(nation_plural_for_player(player_by_number(counterpart)))
         + "</center></h3></b>";
  label4->setText(text);
  layout->addWidget(label3, 0, 5);
  layout->addWidget(label4, 5, 5);
  plr1_label = new QLabel;
  label = new QLabel;
  sprite = get_nation_flag_sprite(tileset,
                                  nation_of_player(player_by_number
                                                   (initiated_from)));
  if (sprite != NULL) {
    pix = sprite->pm;
    plr1_label->setPixmap(*pix);
  } else {
    plr1_label->setText("FLAG MISSING");
  }
  text = ruler_title_for_player(player_by_number(initiated_from),
                                plr_buf, sizeof(plr_buf));
  text = "<b><center>" + text + "</center></b>";
  label->setText(text);
  plr1_accept = new QLabel;
  sprite = get_treaty_thumb_sprite(tileset, false);
  layout->addWidget(plr1_label, 1, 0);
  layout->addWidget(label, 1, 5);
  layout->addWidget(plr1_accept, 1, 10);
  label2 = new QLabel;
  sprite2 = get_nation_flag_sprite(tileset,
                                   nation_of_player(player_by_number
                                                    (counterpart)));
  plr2_label = new QLabel;
  if (sprite2 != NULL) {
    pix = sprite2->pm;
    plr2_label->setPixmap(*pix);
  } else {
    plr2_label->setText("FLAG MISSING");
  }
  text2 = ruler_title_for_player(player_by_number(counterpart),
                                 plr_buf, sizeof(plr_buf));
  text2 = "<b><center>" + text2 + "</center></b>";
  label2->setText(text2);
  plr2_accept = new QLabel;
  layout->addWidget(plr2_label, 6, 0);
  layout->addWidget(label2, 6, 5);
  layout->addWidget(plr2_accept, 6, 10);
  goldlab1 = new QLabel(_("Gold:"));
  goldlab1->setAlignment(Qt::AlignRight);
  goldlab2 = new QLabel(_("Gold:"));
  goldlab2->setAlignment(Qt::AlignRight);
  gold_edit1 = new QSpinBox;
  gold_edit2 = new QSpinBox;
  gold_edit1->setMinimum(0);
  gold_edit2->setMinimum(0);
  if (game.info.trading_gold) {
    gold_edit2->setMaximum(player_by_number(player1)->economic.gold);
  }
  connect(gold_edit1, SIGNAL(valueChanged(int)), SLOT(gold_changed1(int)));
  connect(gold_edit2, SIGNAL(valueChanged(int)), SLOT(gold_changed2(int)));
  pix = get_arrow_sprite(tileset, ARROW_PLUS)->pm;
  add_clause1 = new QPushButton(style()->standardIcon(QStyle::SP_ArrowRight),
                                _("Add Clause..."));
  add_clause2 = new QPushButton(style()->standardIcon(QStyle::SP_ArrowRight),
                                _("Add Clause..."));
  connect(add_clause1, SIGNAL(clicked()), SLOT(show_menu_p2()));
  connect(add_clause2, SIGNAL(clicked()), SLOT(show_menu_p1()));
  layout->addWidget(goldlab1, 7, 4);
  layout->addWidget(goldlab2, 3, 4);
  layout->addWidget(gold_edit1, 7, 5);
  layout->addWidget(gold_edit2, 3, 5);
  layout->addWidget(add_clause1, 7, 6);
  layout->addWidget(add_clause2, 3, 6);

  text_edit = new QTableWidget();
  text_edit->setColumnCount(1);
  text_edit->setProperty("showGrid", "false");
  text_edit->setProperty("selectionBehavior", "SelectRows");
  text_edit->setEditTriggers(QAbstractItemView::NoEditTriggers);
  text_edit->verticalHeader()->setVisible(false);
  text_edit->horizontalHeader()->setVisible(false);
  text_edit->setSelectionMode(QAbstractItemView::SingleSelection);
  header = text_edit->horizontalHeader();
  header->setStretchLastSection(true);
  connect(text_edit, SIGNAL(itemDoubleClicked(QTableWidgetItem *)),
          SLOT(dbl_click(QTableWidgetItem *)));
  text_edit->clearContents();
  text_edit->setRowCount(0);
  layout->addWidget(text_edit, 9, 0, 8, 11);
  accept_treaty =
    new QPushButton(style()->standardIcon(QStyle::SP_DialogYesButton),
                    _("Accept treaty"));
  cancel_treaty =
    new QPushButton(style()->standardIcon(QStyle::SP_DialogNoButton),
                    _("Cancel meeting"));
  connect(accept_treaty, SIGNAL(clicked()), SLOT(response_accept()));
  connect(cancel_treaty, SIGNAL(clicked()), SLOT(response_cancel()));
  layout->addWidget(accept_treaty, 17, 5);
  layout->addWidget(cancel_treaty, 17, 6);
  setLayout(layout);
  update_wdg();

}

******
  Destructor for diplomacy widget
*********/
diplo_wdg::~diplo_wdg()
{
}

******
  Double click on treaty list - it removes clicked clause from list
*********/
void diplo_wdg::dbl_click(QTableWidgetItem *item)
{
  int i, r;

  r = item->row();
  i = 0;
  clause_list_iterate(treaty.clauses, pclause) {
    if (i == r) {
      dsend_packet_diplomacy_remove_clause_req(&client.conn,
                                               player_number(treaty.plr0),
                                               player_number(pclause->from),
                                               pclause->type,
                                               pclause->value);
      return;
    }
    i++;
  } clause_list_iterate_end;
}

******
  Received event about diplomacy widget being closed
*********/
void diplo_wdg::closeEvent(QCloseEvent *event)
{
  if (!gui()->is_closing()) {
    response_cancel();
  }
  event->accept();
}

******
  Gold changed on first spinner
*********/
void diplo_wdg::gold_changed1(int val)
{
  dsend_packet_diplomacy_create_clause_req(&client.conn,
                                           player2, player2,
                                           CLAUSE_GOLD, val);
}

******
  Gold changed on second spinner
*********/
void diplo_wdg::gold_changed2(int val)
{
  dsend_packet_diplomacy_create_clause_req(&client.conn,
                                           player2, player1,
                                           CLAUSE_GOLD, val);
}

******
  Shows popup menu with available clauses to create
*********/
void diplo_wdg::show_menu(int player)
{
  int city_num;
  int other_player;
  struct player *pgiver, *pother;
  const struct advance *padv;
  enum diplstate_type ds;
  QAction *action_menu;
  QAction *all_advancs;
  QAction *some_action;
  QAction *world_map, *sea_map;
  QMap <QString, int>city_list;
  QMap <QString, int>::const_iterator city_iter;
  QMap <QString, p_advance> adv_list;
  QMap <QString, p_advance>::const_iterator adv_iter;
  QMenu *map_menu, *adv_menu, *city_menu, *pacts_menu;
  QMenu menu(this);
  QVariant qvar, tech_var, city_var;

  curr_player = player;
  if (curr_player == player1) {
    other_player = player2;
  } else {
    other_player = player1;
  }
  pgiver = player_by_number(player);
  pother = player_by_number(other_player);

  /* Maps */
  map_menu = menu.addMenu(_("_Maps"));
  world_map = new QAction(_("World-map"), this);
  connect(world_map, SIGNAL(triggered()), this, SLOT(world_map_clause()));
  map_menu->addAction(world_map);
  sea_map = new QAction(_("Sea-map"), this);
  connect(sea_map, SIGNAL(triggered()), this, SLOT(sea_map_clause()));
  map_menu->addAction(sea_map);

  /* Trading: advances */
  if (game.info.trading_tech) {
    const struct research *gresearch = research_get(pgiver);
    const struct research *oresearch = research_get(pother);
    adv_menu = menu.addMenu(_("_Advances"));
    advance_iterate(A_FIRST, padvance) {
      Tech_type_id i = advance_number(padvance);

      if (research_invention_state(gresearch, i) == TECH_KNOWN
          && research_invention_gettable(oresearch, i,
                                         game.info.tech_trade_allow_holes)
          && (research_invention_state(oresearch, i) == TECH_UNKNOWN
              || research_invention_state(oresearch, i)
                 == TECH_PREREQS_KNOWN)) {
        adv_list.insert(advance_name_translation(padvance), padvance);
      }
    } advance_iterate_end;

    /* All advances */
    all_advancs = new QAction(_("All advances"), this);
    connect(all_advancs, SIGNAL(triggered()), this, SLOT(all_advances()));
    adv_menu->addAction(all_advancs);
    adv_menu->addSeparator();

    /* QMap is sorted by default when iterating */
    adv_iter = adv_list.constBegin();
    if (adv_list.count() > 0) {
      while (adv_iter != adv_list.constEnd()) {
        some_action = adv_menu->addAction(adv_iter.key());
        qvar = qVariantFromValue((void *) adv_iter.value());
        some_action->setData(qvar);
        some_action->setProperty("TECH", 1);
        some_action->setProperty("CITY", 0);
        adv_iter++;
      }
    } else {
      adv_menu->setDisabled(true);
    }

  }

  /* Trading: cities. */
  if (game.info.trading_city) {
    city_menu = menu.addMenu(_("_Cities"));

    city_list_iterate(pgiver->cities, pcity) {
      if (!is_capital(pcity)) {
        city_list.insert(pcity->name, pcity->id);
      }
    } city_list_iterate_end;
    city_iter = city_list.constBegin();
    if (city_list.count() > 0) {
      while (city_iter != city_list.constEnd()) {
        some_action = city_menu->addAction(city_iter.key());
        some_action->setData(city_iter.value());
        some_action->setProperty("TECH", 0);
        some_action->setProperty("CITY", 1);
        city_iter++;
      }
    } else {
      city_menu->setDisabled(true);
    }
  }
  some_action = new QAction(_("_Give shared vision"), this);
  connect(some_action, SIGNAL(triggered()), this,
          SLOT(give_shared_vision()));
  menu.addAction(some_action);
  if (gives_shared_vision(pgiver, pother)) {
    some_action->setDisabled(true);
  }
  some_action = new QAction(_("Give _embassy"), this);
  connect(some_action, SIGNAL(triggered()), this, SLOT(give_embassy()));
  menu.addAction(some_action);
  if (player_has_real_embassy(pother, pgiver)) {
    some_action->setDisabled(true);
  }

  /* Pacts */
  if (player_by_number(curr_player) == client_player()) {
    pacts_menu = menu.addMenu(_("_Pacts"));
    ds = player_diplstate_get(pgiver, pother)->type;
    some_action = new QAction(Q_("?diplomatic_state:Cease-fire"), this);
    connect(some_action, SIGNAL(triggered()), this, SLOT(pact_ceasfire()));
    pacts_menu->addAction(some_action);
    if (ds == DS_CEASEFIRE) {
      some_action->setDisabled(true);
    }
    some_action = new QAction(Q_("?diplomatic_state:Peace"), this);
    connect(some_action, SIGNAL(triggered()), this, SLOT(pact_peace()));
    pacts_menu->addAction(some_action);
    if (ds == DS_PEACE) {
      some_action->setDisabled(true);
    }
    some_action = new QAction(Q_("?diplomatic_state:Alliance"), this);
    connect(some_action, SIGNAL(triggered()), this, SLOT(pact_allianze()));
    pacts_menu->addAction(some_action);
    if (ds == DS_ALLIANCE) {
      some_action->setDisabled(true);
    }
  }

  /* Check user response for not defined responses in slots */
  action_menu = 0;
  action_menu = menu.exec(QCursor::pos());
  if (action_menu) {
    qvar = action_menu->data();
    tech_var = action_menu->property("TECH");
    city_var = action_menu->property("CITY");
    if (tech_var.toInt() == 1 && city_var.toInt() == 0) {
      padv = (advance *) qvar.value < void *>();
      give_advance(advance_number(padv));
    }
    if (tech_var.toInt() == 0 && city_var.toInt() == 1) {
      city_num = qvar.toInt();
      give_city(city_num);
    }
  }
}

******
  Give embassy menu activated
*********/
void diplo_wdg::give_embassy()
{
  dsend_packet_diplomacy_create_clause_req(&client.conn,
                                           player_number(treaty.plr0),
                                           curr_player, CLAUSE_EMBASSY, 0);
}

******
  Give shared vision menu activated
*********/
void diplo_wdg::give_shared_vision()
{
  dsend_packet_diplomacy_create_clause_req(&client.conn,
                                           player_number(treaty.plr0),
                                           curr_player, CLAUSE_VISION, 0);
}

******
  Create alliance menu activated
*********/
void diplo_wdg::pact_allianze()
{
  dsend_packet_diplomacy_create_clause_req(&client.conn,
                                           player_number(treaty.plr0),
                                           curr_player, CLAUSE_ALLIANCE, 0);
}

******
  Ceasfire pact menu activated
*********/
void diplo_wdg::pact_ceasfire()
{
  dsend_packet_diplomacy_create_clause_req(&client.conn,
                                           player_number(treaty.plr0),
                                           curr_player, CLAUSE_CEASEFIRE, 0);
}

******
  Peace pact menu activated
*********/
void diplo_wdg::pact_peace()
{
  dsend_packet_diplomacy_create_clause_req(&client.conn,
                                           player_number(treaty.plr0),
                                           curr_player, CLAUSE_PEACE, 0);
}

******
  Sea map menu activated
*********/
void diplo_wdg::sea_map_clause()
{
  dsend_packet_diplomacy_create_clause_req(&client.conn,
                                           player_number(treaty.plr0),
                                           curr_player, CLAUSE_SEAMAP, 0);
}

******
  World map menu activated
*********/
void diplo_wdg::world_map_clause()
{
  dsend_packet_diplomacy_create_clause_req(&client.conn,
                                           player_number(treaty.plr0),
                                           curr_player, CLAUSE_MAP, 0);
}

******
  Give city menu activated
*********/
void diplo_wdg::give_city(int city_num)
{
  int giver, dest, other;

  giver = curr_player;
  if (curr_player == player1) {
    dest = player2;
  } else {
    dest = player1;
  }

  if (player_by_number(giver) == client_player()) {
    other = dest;
  } else {
    other = giver;
  }

  dsend_packet_diplomacy_create_clause_req(&client.conn, other, giver,
                                           CLAUSE_CITY, city_num);
}

******
  Give advance menu activated
*********/
void diplo_wdg::give_advance(int tech)
{
  int giver, dest, other;

  giver = curr_player;
  if (curr_player == player1) {
    dest = player2;
  } else {
    dest = player1;
  }

  if (player_by_number(giver) == client_player()) {
    other = dest;
  } else {
    other = giver;
  }

  dsend_packet_diplomacy_create_clause_req(&client.conn, other, giver,
                                           CLAUSE_ADVANCE, tech);
}

******
  Give all advances menu activated
*********/
void diplo_wdg::all_advances()
{
  int giver, dest, other;
  const struct research *dresearch, *gresearch;

  giver = curr_player;
  if (curr_player == player1) {
    dest = player2;
  } else {
    dest = player1;
  }

  if (player_by_number(giver) == client_player()) {
    other = dest;
  } else {
    other = giver;
  }

  /* All techs. */
  struct player *pgiver = player_by_number(giver);
  struct player *pdest = player_by_number(dest);

  fc_assert_ret(NULL != pgiver);
  fc_assert_ret(NULL != pdest);

   dresearch = research_get(pdest);
   gresearch = research_get(pgiver);

   advance_iterate(A_FIRST, padvance) {
     Tech_type_id i = advance_number(padvance);

     if (research_invention_state(gresearch, i) == TECH_KNOWN
         && research_invention_gettable(dresearch, i,
                                        game.info.tech_trade_allow_holes)
         && (research_invention_state(dresearch, i) == TECH_UNKNOWN
             || research_invention_state(dresearch, i)
                == TECH_PREREQS_KNOWN)) {
       dsend_packet_diplomacy_create_clause_req(&client.conn, other, giver,
                                                CLAUSE_ADVANCE, i);
     }
   } advance_iterate_end;
}

******
  Show menu for second player
*********/
void diplo_wdg::show_menu_p2()
{
  show_menu(player2);
}

******
  Show menu for first player
*********/
void diplo_wdg::show_menu_p1()
{
  show_menu(player1);
}

******
  Sets index in QTabWidget
*********/
void diplo_wdg::set_index(int ind)
{
  index = ind;
}

******
  Sets index in QTabWidget
*********/
int diplo_wdg::get_index()
{
  return index;
}

******
  Updates diplomacy widget - updates clauses and redraws pixmaps
*********/
void diplo_wdg::update_wdg()
{
  bool blank;
  int i;
  struct sprite *sprite;
  QPixmap *pix = NULL;
  QTableWidgetItem *qitem;

  blank = true;
  text_edit->clearContents();
  text_edit->setRowCount(0);
  i = 0;
  clause_list_iterate(treaty.clauses, pclause) {
    char buf[128];
    client_diplomacy_clause_string(buf, sizeof(buf), pclause);
    text_edit->insertRow(i);
    qitem = new QTableWidgetItem();
    qitem->setText(buf);
    qitem->setTextAlignment(Qt::AlignLeft);
    text_edit->setItem(i, 0, qitem);
    blank = false;
    i++;
  } clause_list_iterate_end;

  if (blank) {
    text_edit->insertRow(0);
    qitem = new QTableWidgetItem();
    qitem->setText(_("--- This treaty is blank. "
                     "Please add some clauses. ---"));
    qitem->setTextAlignment(Qt::AlignLeft);
    text_edit->setItem(0, 0, qitem);
  }

  sprite = get_treaty_thumb_sprite(tileset, treaty.accept0);
  if (sprite != NULL) {
    pix = sprite->pm;
    plr1_accept->setPixmap(*pix);
  } else {
    plr1_accept->setText("PIXMAP MISSING");
  }

  sprite = get_treaty_thumb_sprite(tileset, treaty.accept1);
  if (sprite != NULL) {
    pix = sprite->pm;
    plr2_accept->setPixmap(*pix);
  } else {
    plr2_accept->setText("PIXMAP MISSING");
  }
}

******
  Button 'Accept treaty' has been clicked
*********/
void diplo_wdg::response_accept()
{
  dsend_packet_diplomacy_accept_treaty_req(&client.conn,
                                           player_number(treaty.plr0));
}

******
  Button 'Cancel treaty' has been clicked
*********/
void diplo_wdg::response_cancel()
{
  dsend_packet_diplomacy_cancel_meeting_req(&client.conn,
                                            player_number(treaty.plr0));
}

******
  Constructor for diplomacy dialog
*********/
diplo_dlg::diplo_dlg(int counterpart, int initiated_from): QTabWidget()
{
  add_widget(counterpart, initiated_from);
}

******
  Creates new diplomacy widget and adds to diplomacy dialog
*********/
void diplo_dlg::add_widget(int counterpart, int initiated_from)
{

  diplo_wdg *dw;
  struct sprite *sprite;
  QPixmap *pix;
  int i;

  pix = NULL;
  dw = new diplo_wdg(counterpart, initiated_from);
  treaty_list.insert(counterpart, dw);
  i = addTab(dw, nation_plural_for_player(player_by_number(counterpart)));
  dw->set_index(i);
  sprite = get_nation_flag_sprite(tileset,
                                  nation_of_player(player_by_number
                                                   (counterpart)));
  if (sprite != NULL) {
    pix = sprite->pm;
  }
  if (pix != NULL) {
    setTabIcon(i, QIcon(*pix));
  }
}

******
  Sets given widget as active in current dialog
*********/
void diplo_dlg::make_active(int party)
{
  QWidget *w;

  w = find_widget(party);
  if (w == NULL){
    return;
  }
  setCurrentWidget(w);
}

******
  Initializes some data for diplomacy dialog
*********/
void diplo_dlg::init(bool raise)
{
  if (!can_client_issue_orders()) {
    return;
  }
  if (client.conn.playing->ai_controlled) {
    return;
  }
  setAttribute(Qt::WA_DeleteOnClose);
  gui()->gimme_place(this, "DDI");
  index = gui()->add_game_tab(this, _("Diplomacy"));

  if (raise == false) {
    gui()->game_tab_widget->change_color(index, Qt::red);
  } else {
    gui()->game_tab_widget->setCurrentIndex(index);
  }
}
******
  Destructor for diplomacy dialog
*********/
diplo_dlg::~diplo_dlg()
{
  QMapIterator<int, diplo_wdg *>i(treaty_list);
  diplo_wdg *dw;

   while (i.hasNext()) {
     i.next();
      dw = i.value();
      removeTab(dw->get_index());
      dw->deleteLater();
   }
  gui()->remove_repo_dlg("DDI");
}

******
  Finds diplomacy widget in current dialog
*********/
diplo_wdg *diplo_dlg::find_widget(int counterpart)
{
  return treaty_list.value(counterpart);
}

******
  Closes given diplomacy widget
*********/
void diplo_dlg::close_widget(int counterpart)
{
  diplo_wdg *dw;

  dw = treaty_list.take(counterpart);
  removeTab(dw->get_index());
  dw->deleteLater();
  if (treaty_list.isEmpty()) {
    close();
  }
}

******
  Updates all diplomacy widgets in current dialog
*********/
void diplo_dlg::update_dlg()
{
  QMapIterator <int, diplo_wdg *>i(treaty_list);
  diplo_wdg *dw;

  while (i.hasNext()) {
    i.next();
    dw = i.value();
    dw->update_wdg();
  }
}

                                    bool other_accepted)
{
  int i;
  diplo_dlg *dd;
  diplo_wdg *dw;
  QWidget *w;

  if (!gui()->is_repo_dlg_open("DDI")) {
    return;
  }
  i = gui()->gimme_index_of("DDI");
  fc_assert(i != -1);
  w = gui()->game_tab_widget->widget(i);
  dd = qobject_cast<diplo_dlg *>(w);
  dw = dd->find_widget(counterpart);
  dw->treaty.accept0 = I_accepted;
  dw->treaty.accept1 = other_accepted;
  dw->update_wdg();

}


  int i;
  diplo_dlg *dd;
  QWidget *w;
  QWidget *fw;

  if (client_is_observer()){
    return;
  }
  if (!gui()->is_repo_dlg_open("DDI")) {
    diplo_dlg *dd = new diplo_dlg(counterpart, initiated_from);
    dd->init(false);
    dd->update_dlg();
    dd->make_active(counterpart);
  }
  i = gui()->gimme_index_of("DDI");
  fc_assert(i != -1);
  w = gui()->game_tab_widget->widget(i);
  dd = qobject_cast<diplo_dlg *>(w);
  fw = dd->find_widget(counterpart);
  if (fw == NULL) {
    dd->add_widget(counterpart, initiated_from);
    gui()->game_tab_widget->change_color(i, Qt::red);
  }
  dd->make_active(counterpart);

  /* Bring it to front if user requested meeting */
  if (player_by_number(initiated_from) == client.conn.playing) {
    gui()->game_tab_widget->setCurrentIndex(i);
  }
}

                                    enum clause_type type, int value)
{
  int i;
  diplo_dlg *dd;
  diplo_wdg *dw;
  QWidget *w;

  if (!gui()->is_repo_dlg_open("DDI")) {
    return;
  }
  i = gui()->gimme_index_of("DDI");
  fc_assert(i != -1);
  w = gui()->game_tab_widget->widget(i);
  dd = qobject_cast<diplo_dlg *>(w);
  dw = dd->find_widget(counterpart);
  add_clause(&dw->treaty, player_by_number(giver), type, value);
  dw->update_wdg();
}

int i;
  diplo_dlg *dd;
  QWidget *w;

  if (!gui()->is_repo_dlg_open("DDI")) {
    return;
  }
  i = gui()->gimme_index_of("DDI");
  fc_assert(i != -1);
  w = gui()->game_tab_widget->widget(i);
  dd = qobject_cast<diplo_dlg *>(w);
  dd->close_widget(counterpart);

}

                                    enum clause_type type, int value)
{

  int i;
  diplo_dlg *dd;
  diplo_wdg *dw;
  QWidget *w;

  if (!gui()->is_repo_dlg_open("DDI")) {
    return;
  }
  i = gui()->gimme_index_of("DDI");
  fc_assert(i != -1);
  w = gui()->game_tab_widget->widget(i);
  dd = qobject_cast<diplo_dlg *>(w);
  dw = dd->find_widget(counterpart);
  remove_clause(&dw->treaty, player_by_number(giver), type, value);
  dw->update_wdg();

}

int i;
  diplo_dlg *dd;
  QWidget *w;

  if (!gui()->is_repo_dlg_open("DDI")) {
    return;
  }
  i = gui()->gimme_index_of("DDI");
  fc_assert(i != -1);
  w = gui()->game_tab_widget->widget(i);
  dd = qobject_cast<diplo_dlg *>(w);
  dd->close();
}
ENDREP
DELTA 18893 50448 1077
SVN  ‘'ã!„¤; …X €‚ G § D†@€J G ¦ D†@€„ G © D†@€u G ¢ D†@€M G ¹ D†@» G « D†@€c G €H D†@€ƒ; G £ D†@€` G ¢ D†@€A G £ D†@€~ G ¥ D†@€‚D G § D†@€ƒh G ¶ D†@€„D G ± D†@€p G ¬ D†@€` G › D†@€‚b G ¤ D†@€‚ G « D†@€H G ¤ D†@€Š8 G ¥ D†@€Z G ¢ D†@€‚) G ¬ D†@€d G ¢ D†@€ G œ D†@€~ G ® D†@€ª G ¶ D†@€…7 G › D†@€ƒ5 G €D D†@€? G €L D†@€j G €F D†@€Š7 G œ D†@€\ G œ D†@€L G   D†@€†4 G €R D†@€S G €g D†@€„ G › D†@€N G £ D†@€f G ¤ D†@€) G £ D†@€K G § D†@€0 G  D†@€L G œ D†@€` A €B A†@€p G  7‡ €‚n G  1‰€‚ G  J‹€‚
 A  ƒv1fc_config.h>
#endif

// Qt
#include <QApplication>
#include <QHeaderView>
#include <QMessageBox>

// gui-qt
#include "qtg_cxxside.h"
#include "cityrep.h"

static bool can_city_sell_universal(const struct city *pcity,
                                    struct universal target);

*****
  City item delegate constructor
*******/
city_item_delegate::city_item_delegate(QObject *parent)
                   :QItemDelegate(parent)
{
  QFont f = QApplication::font();
  QFontMetrics fm(f);

  item_height = fm.height() + 4;
}

*****
  City item delgate paint event
*******/
void city_item_delegate::paint(QPainter *painter, 
                               const QStyleOptionViewItem &option, 
                               const QModelIndex &index) const
{
  QStyleOptionViewItemV3 opt = QItemDelegate::setOptions(index, option);

  painter->save();
    QItemDelegate::drawBackground(painter, opt, index);
    opt.displayAlignment = Qt::AlignLeft;
    QItemDelegate::drawDisplay(painter, opt, option.rect,
                               index.data().toString());
   painter->restore();
}

*****
  Size hint for city item delegate
*******/
QSize city_item_delegate::sizeHint(const QStyleOptionViewItem &option,
                                   const QModelIndex &index) const
{
  QSize s = QItemDelegate::sizeHint(option, index);

  s.setHeight(item_height);
  return s;
}

*****
  Constructor for city item
*******/
city_item::city_item(city *pcity): QObject()
{
  i_city = pcity;
}

*****
  Returns used city pointer for city item creation
*******/
city *city_item::get_city()
{
  return i_city;
}

*****
  Sets nothing, but must be declared
*******/
bool city_item::setData(int column, const QVariant &value, int role)
{
  return false;
}

*****
  Returns data from city item (or city pointer from Qt::UserRole)
*******/
QVariant city_item::data(int column, int role) const
{
  struct city_report_spec *spec;
  char buf[64];

  if (role == Qt::UserRole && column == 0) {
    return QVariant::fromValue((void *)i_city);
  }
  if (role != Qt::DisplayRole) {
    return QVariant();
  }
  spec = city_report_specs+column;
  fc_snprintf(buf, sizeof(buf), "%*s", NEG_VAL(spec->width),
                spec->func(i_city, spec->data));

  return QString(buf);
}

*****
  Constructor for city model
*******/
city_model::city_model(QObject *parent): QAbstractListModel(parent)
{
  populate();
}

*****
  Destructor for city model
*******/
city_model::~city_model()
{
  qDeleteAll(city_list);
}

*****
  Notifies about changed row
*******/
void city_model::notify_city_changed(int row)
{
  emit dataChanged(index(row, 0), index(row, columnCount() - 1));
}

*****
  Returns stored data in index
*******/
QVariant city_model::data(const QModelIndex &index, int role) const
{
  if (!index.isValid()) return QVariant();
  if (index.row() >= 0 && index.row() < rowCount() && index.column() >= 0
      && index.column() < columnCount())
    return city_list[index.row()]->data(index.column(), role);
  return QVariant();
}

*****
  Sets data in model under index
*******/
bool city_model::setData(const QModelIndex &index, const QVariant &value, 
                         int role)
{
  if (!index.isValid() || role != Qt::DisplayRole) return false;
  if (index.row() >= 0 && index.row() < rowCount() && index.column() >= 0 
    && index.column() < columnCount()) {
    bool change = city_list[index.row()]->setData(index.column(), value, role);
    if (change) {
      notify_city_changed(index.row());
    }
    return change;
  }
  return false;
}

*****
  Returns header data for given section(column)
*******/
QVariant city_model::headerData(int section, Qt::Orientation orientation, 
                                int role) const
{
  char buf[64];
  struct city_report_spec *spec;

  if (orientation == Qt::Horizontal && section < NUM_CREPORT_COLS) {
    if (role == Qt::DisplayRole) {
    spec = city_report_specs + section;
    fc_snprintf(buf, sizeof(buf), "%*s\n%*s",
                NEG_VAL(spec->width), spec->title1 ? spec->title1 : "",
                NEG_VAL(spec->width), spec->title2 ? spec->title2 : "");
      return QString(buf);
    }
  }
  return QVariant();
}

*****
  Returns header information about section
*******/
QVariant city_model::menu_data(int section) const
{
  struct city_report_spec *spec;

  if (section < NUM_CREPORT_COLS) {
    spec = city_report_specs + section;
      return QString(spec->explanation);
  }
  return QVariant();
}

*****
  Hides given column if show is false
*******/
QVariant city_model::hide_data(int section) const
{
  struct city_report_spec *spec;

  if (section < NUM_CREPORT_COLS) {
    spec = city_report_specs + section;
      return spec->show;
  }
  return QVariant();
}

*****
  Creates city model
*******/
void city_model::populate()
{
  city_item *ci;

  if (client_has_player()) {
    city_list_iterate(client_player()->cities, pcity) {
      ci = new city_item(pcity);
      city_list << ci;
    } city_list_iterate_end;
  } else {
    cities_iterate(pcity) {
      ci = new city_item(pcity);
      city_list << ci;
    } cities_iterate_end;
  }
}
*****
  Notifies about changed item
*******/
void city_model::city_changed(struct city *pcity)
{
  city_item *item;

  beginResetModel();
  endResetModel();
  for (int i = 0; i < city_list.count(); i++) {
    item = city_list.at(i);
    if (pcity == item->get_city()) {
      notify_city_changed(i);
    }
  }
}

*****
  Notifies about whole model changed
*******/
void city_model::all_changed()
{
  city_list.clear();
  beginResetModel();
  populate();
  endResetModel();
  for (int i = 0; i < city_list.count(); i++) {
    notify_city_changed(i);
  }
}

*****
  Constructor for city widget
*******/
city_widget::city_widget(city_report *ctr): QTreeView()
{
  cr = ctr;
  c_i_d = new city_item_delegate(this);
  setItemDelegate(c_i_d);
  list_model = new city_model(this);
  filter_model = new QSortFilterProxyModel();
  filter_model->setDynamicSortFilter(true);
  filter_model->setSourceModel(list_model);
  filter_model->setFilterRole(Qt::DisplayRole);
  setModel(filter_model);
  setRootIsDecorated(false);
  setAllColumnsShowFocus(true);
  setSortingEnabled(true);
  setSelectionMode(QAbstractItemView::ExtendedSelection);
  setItemsExpandable(false);
  setAutoScroll(true);
  header()->setContextMenuPolicy(Qt::CustomContextMenu);
  setContextMenuPolicy(Qt::CustomContextMenu);
  hide_columns();
  connect(header(), SIGNAL(customContextMenuRequested(const QPoint &)),
          this, SLOT(display_header_menu(const QPoint &)));
  connect(selectionModel(),
          SIGNAL(selectionChanged(const QItemSelection &,
                                  const QItemSelection &)),
          SLOT(cities_selected(const QItemSelection &,
                               const QItemSelection &)));
  connect(this, SIGNAL(doubleClicked(QModelIndex)), this, 
          SLOT(city_doubleclick(QModelIndex)));
  connect(this, SIGNAL(customContextMenuRequested(const QPoint&)), 
          this, SLOT(display_list_menu(const QPoint&)));
}

*****
  Slot for double clicking row
*******/
void city_widget::city_doubleclick(const QModelIndex& index)
{
  city_view();
}

*****
  Shows first selected city
*******/
void city_widget::city_view()
{
  struct city *pcity;

  if (selected_cities.isEmpty()) {
    return;
  }
  pcity = selected_cities[0];

  Q_ASSERT(pcity != NULL);
  if (options.center_when_popup_city) {
    center_tile_mapcanvas(pcity->tile);
  }
  qtg_real_city_dialog_popup(pcity);
}

*****
  Clears worklist for selected cities
*******/
void city_widget::clear_worlist()
{
  struct worklist empty;
  worklist_init(&empty);
  struct city *pcity;

  foreach(pcity, selected_cities) {
    Q_ASSERT(pcity != NULL);
    city_set_worklist(pcity, &empty);
  }
}

*****
  Buys current item in city
*******/
void city_widget::buy()
{
  struct city *pcity;

  foreach(pcity, selected_cities){
    Q_ASSERT(pcity != NULL);
    cityrep_buy(pcity);
  }
}

*****
  Centers map on city
*******/
void city_widget::center()
{
  struct city *pcity;

  if (selected_cities.isEmpty()){
    return;
  }
  pcity= selected_cities[0];
  Q_ASSERT(pcity != NULL);
  center_tile_mapcanvas(pcity->tile);
  gui()->game_tab_widget->setCurrentIndex(0);
}

*****
  Displays right click menu on city row
*******/
void city_widget::display_list_menu(const QPoint &)
{
  QMap<QString, cid> custom_labels;
  QMap<QString, int> cma_labels;
  QMenu *some_menu;
  QMenu *tmp2_menu;
  QMenu *tmp_menu;
  QMessageBox ask(this);
  QVariant qvar, qvar2;
  bool sell_ask;
  char buf[200];
  cid cid;
  const char *imprname;
  enum menu_labels m_state;
  int sell_count;
  int sell_gold;
  int sell_ret = QMessageBox::Cancel;
  struct city *pcity;
  struct impr_type *building;
  struct universal target;
  QMenu list_menu(this);
  QAction *act;
  QAction cty_view(style()->standardIcon(QStyle::SP_CommandLink),
                   _("?verb:View"), 0);
  QAction cty_buy(_("Buy"), 0);
  QAction cty_center(style()->standardIcon(QStyle::SP_ArrowRight),
                     _("Center"), 0);
  QAction wl_clear(_("Clear"), 0);
  QAction wl_empty(_("(no worklists defined)"), 0);
  bool worklist_defined = true;

  if (!can_client_issue_orders()) {
    return;
  }
  some_menu = list_menu.addMenu(_("Production"));
  tmp_menu = some_menu->addMenu(_("Change"));
  fill_production_menus(CHANGE_PROD_NOW, custom_labels, can_city_build_now,
                        tmp_menu);
  tmp_menu = some_menu->addMenu(_("Add next"));
  fill_production_menus(CHANGE_PROD_NEXT, custom_labels, can_city_build_now,
                        tmp_menu);
  tmp_menu = some_menu->addMenu(_("Add before last"));
  fill_production_menus(CHANGE_PROD_BEF_LAST, custom_labels,
                        can_city_build_now, tmp_menu);
  tmp_menu = some_menu->addMenu(_("Add last"));
  fill_production_menus(CHANGE_PROD_LAST, custom_labels, can_city_build_now,
                        tmp_menu);

  tmp_menu = some_menu->addMenu(_("Worklist"));
  tmp_menu->addAction(&wl_clear);
  connect(&wl_clear, SIGNAL(triggered()), this, SLOT(clear_worlist()));
  tmp2_menu = tmp_menu->addMenu(_("Add"));
  gen_worklist_labels(cma_labels);
  if (cma_labels.count() == 0) {
    tmp2_menu->addAction(&wl_empty);
    worklist_defined = false;
  }
  fill_data(WORKLIST_ADD, cma_labels, tmp2_menu);
  tmp2_menu = tmp_menu->addMenu(_("Change"));
  if (cma_labels.count() == 0) {
    tmp2_menu->addAction(&wl_empty);
    worklist_defined = false;
  }
  fill_data(WORKLIST_CHANGE, cma_labels, tmp2_menu);
  some_menu = list_menu.addMenu(_("CMA"));
  gen_cma_labels(cma_labels);
  fill_data(CMA, cma_labels, some_menu);
  some_menu = list_menu.addMenu(_("Sell"));
  gen_production_labels(SELL, custom_labels, false, false,
                        can_city_sell_universal);
  fill_data(SELL, custom_labels, some_menu);
  list_menu.addAction(&cty_view);
  connect(&cty_view, SIGNAL(triggered()), this, SLOT(city_view()));
  list_menu.addAction(&cty_buy);
  connect(&cty_buy, SIGNAL(triggered()), this, SLOT(buy()));
  list_menu.addAction(&cty_center);
  connect(&cty_center, SIGNAL(triggered()), this, SLOT(center()));
  act = 0;
  sell_count = 0;
  sell_gold = 0;
  sell_ask = true;
  act = list_menu.exec(QCursor::pos());
  if (act) {
    qvar2 = act->property("FC");
    m_state = static_cast<menu_labels>(qvar2.toInt());
    qvar = act->data();
    cid = qvar.toInt();
    target = cid_decode(cid);
    foreach (pcity, selected_cities) {
      if (NULL != pcity) {
        switch (m_state) {
        case CHANGE_PROD_NOW:
          city_change_production(pcity, target);
          break;
        case CHANGE_PROD_NEXT:
          city_queue_insert(pcity, 1, target);
          break;
        case CHANGE_PROD_BEF_LAST:
          city_queue_insert(pcity, worklist_length(&pcity->worklist), 
                            target);
          break;
        case CHANGE_PROD_LAST:
          city_queue_insert(pcity, -1, target);
          break;
        case SELL:
          building = target.value.building;
          if (sell_ask) {
            imprname = improvement_name_translation(building);
            fc_snprintf(buf, sizeof(buf),
                        _("Are you sure you want to sell those %s?"),
                        imprname);
            sell_ask = false;
            ask.setText(buf);
            ask.setStandardButtons(QMessageBox::Cancel | QMessageBox::Ok);
            ask.setDefaultButton(QMessageBox::Cancel);
            ask.setIcon(QMessageBox::Question);
            ask.setWindowTitle(" ");
            sell_ret = ask.exec();
          }
          if (sell_ret == QMessageBox::Ok) {
            if (!pcity->did_sell && city_has_building(pcity, building)) {
              sell_count++;
              sell_gold += impr_sell_gold(building);
              city_sell_improvement(pcity, improvement_number(building));
            }
          }
          break;
        case CMA:
          if (NULL != pcity) {
            if (CMA_NONE == cid) {
              cma_release_city(pcity);
            } else {
              cma_put_city_under_agent(pcity,
                                       cmafec_preset_get_parameter(cid));
            }
          }

          break;
        case WORKLIST_ADD:
          if (worklist_defined) {
            city_queue_insert_worklist(pcity, -1,
              global_worklist_get(global_worklist_by_id(cid)));
          }
          break;

        case WORKLIST_CHANGE:
          if (worklist_defined) {
            city_set_queue(pcity,
                           global_worklist_get(global_worklist_by_id(cid)));
          }
          break;
        default:
          break;
        }
      }
    }
  }
}

*****
  Fills menu items that can be produced or sold
*******/
void city_widget::fill_production_menus(city_widget::menu_labels what,
                                        QMap<QString, cid> &custom_labels,
                                        TestCityFunc test_func, QMenu *menu)
{
  QMenu *m1, *m2, *m3;

  m1 = menu->addMenu(_("Buildings"));
  m2 = menu->addMenu(_("Units"));
  m3 = menu->addMenu(_("Wonders"));
  gen_production_labels(what, custom_labels, false, false, test_func);
  fill_data(what, custom_labels, m1);
  gen_production_labels(what, custom_labels, true, false, test_func);
  fill_data(what, custom_labels, m2);
  gen_production_labels(what, custom_labels, false, true, test_func);
  fill_data(what, custom_labels, m3);
}


*****
  Fills menu actions
*******/
void city_widget::fill_data(menu_labels which,
                            QMap<QString, cid> &custom_labels, QMenu *menu)
{
  QAction *action;
  QMap<QString, cid>::const_iterator map_iter;

  map_iter = custom_labels.constBegin();
  while (map_iter != custom_labels.constEnd()) {
    action = menu->addAction(map_iter.key());
    action->setData(map_iter.value());
    action->setProperty("FC", which);
    map_iter++;
  }
}

*****
  Creates menu labels and id of available cma, stored in list
*******/
void city_widget::gen_cma_labels(QMap<QString, int> &list)
{
  list.clear();
  for (int i = 0; i < cmafec_preset_num(); i++) {
    list.insert(cmafec_preset_get_descr(i), i);
  }
}

*****
  Creates menu labels and info of available worklists, stored in list
*******/
void city_widget::gen_worklist_labels(QMap<QString, int> &list)
{
  list.clear();
  global_worklists_iterate(pgwl) {
    list.insert(global_worklist_name(pgwl), global_worklist_id(pgwl));
  } global_worklists_iterate_end;
}

*****
  Creates menu labels and id about available production targets
*******/
void city_widget::gen_production_labels(city_widget::menu_labels what,
                                        QMap<QString, cid> &list,
                                        bool append_units,
                                        bool append_wonders,
                                        TestCityFunc test_func)
{

  struct universal targets[MAX_NUM_PRODUCTION_TARGETS];
  struct item items[MAX_NUM_PRODUCTION_TARGETS];
  int i, item, targets_used;
  QString str;
  char *row[4];
  char buf[4][64];
  struct city **data;
  int num_sel = selected_cities.count();
  struct city *array[num_sel];

  for (i = 0; i < num_sel; i++) {
    array[i] = selected_cities.at(i);
  }
  data = &array[0];
  targets_used
      = collect_production_targets(targets, data, num_sel, append_units,
                                   append_wonders, true, test_func);
  name_and_sort_items(targets, targets_used, items, true, NULL);
  for (i = 0; i < 4; i++) {
    row[i] = buf[i];
  }
  list.clear();
  for (item = 0; item < targets_used; item++) {
    struct universal target = items[item].item;
    char txt[256];
    str.clear();
    get_city_dialog_production_row(row, sizeof(buf[0]), target, NULL);
    fc_snprintf(txt, ARRAY_SIZE(txt), "%s ", row[0]);
    str = str + QString(txt);
    list.insert(str, cid_encode(target));
  }
}

*****
  Updates single city
*******/
void city_widget::update_city(city *pcity)
{
  list_model->city_changed(pcity);
}

*****
  Updates whole model
*******/
void city_widget::update_model()
{
  list_model->all_changed();
}

*****
  Context menu for header
*******/
void city_widget::display_header_menu(const QPoint &)
{
  struct city_report_spec *spec;
  QMenu hideshowColumn(this);
  QList<QAction *> actions;
  QAction *act;

  hideshowColumn.setTitle(_("Column visibility"));
  for (int i = 0; i < list_model->columnCount(); i++) {
    QAction *myAct = hideshowColumn.addAction(
                       list_model->menu_data(i).toString());
    myAct->setCheckable(true);
    myAct->setChecked(!isColumnHidden(i));
    actions.append(myAct);
  }
  act = hideshowColumn.exec(QCursor::pos());
  if (act) {
    int col = actions.indexOf(act);
    Q_ASSERT(col >= 0);
    setColumnHidden(col, !isColumnHidden(col));
    spec = city_report_specs + col;
    spec->show = !spec->show; 
    if (!isColumnHidden(col) && columnWidth(col) <= 5)
      setColumnWidth(col, 100);
  }
}

*****
  Hides columns for city widget, depending on stored data (bool spec->show)
*******/
void city_widget::hide_columns()
{
  for (int col = 0; col < list_model->columnCount(); col++) {
   if(!list_model->hide_data(col).toBool()){
    setColumnHidden(col, !isColumnHidden(col));
   }
  }
}

*****
  Slot for selecting items in city widget, they are stored in
  selected_cities until deselected
*******/
void city_widget::cities_selected(const QItemSelection &sl, 
                                  const QItemSelection &ds)
{
  QModelIndexList indexes = selectionModel()->selectedIndexes();
  QModelIndex i;
  QVariant qvar;
  struct city *pcity;

  selected_cities.clear();

  if (indexes.isEmpty()) {
    return;
  }
  foreach(i,indexes){
    qvar = i.data(Qt::UserRole);
    if (qvar.isNull()) {
      continue;
    }
    pcity = reinterpret_cast<city *>(qvar.value<void *>());
    selected_cities << pcity;
  }
}

*****
  Returns used model
*******/
city_model *city_widget::get_model() const
{
  return list_model;
}

*****
  Destructor for city widget
*******/
city_widget::~city_widget()
{
  delete c_i_d;
  delete list_model;
  delete filter_model;
}

*****
  Constructor for city report
*******/
city_report::city_report(): QWidget()
{
  layout = new QVBoxLayout;
  city_wdg = new city_widget(this);

  layout->addWidget(city_wdg);
  setLayout(layout);
}

*****
  Destructor for city report
*******/
city_report::~city_report()
{
  gui()->remove_repo_dlg("CTS");
}

*****
  Inits place in game tab widget
*******/
void city_report::init()
{
  gui()->gimme_place(this, _("CTS"));
  index = gui()->add_game_tab(this, _("Cities"));
  gui()->game_tab_widget->setCurrentIndex(index);
}
*****
  Updates whole report
*******/
void city_report::update_report()
{
  city_wdg->update_model();
}

*****
  Updates single city
*******/
void city_report::update_city(struct city *pcity)
{
  city_wdg->update_city(pcity);
}


  Same as can_city_sell_building(), but with universal argument.
/
static bool can_city_sell_universal(const struct city *pcity,
                                    struct universal target)
{
  return (target.kind == VUT_IMPROVEMENT
          && can_city_sell_building(pcity, target.value.building));
}


int i;
  city_report *cr;
  QWidget *w;

  if (!gui()->is_repo_dlg_open("CTS")) {
    cr = new city_report;
    cr->init();
    cr->update_report();
  } else {
    i = gui()->gimme_index_of("CTS");
    fc_assert(i != -1);
    w = gui()->game_tab_widget->widget(i);
    cr = reinterpret_cast<city_report*>(w);
    gui()->game_tab_widget->setCurrentWidget(cr);
  }
}

int i;
  city_report *cr;
  QWidget *w;

  if (gui()->is_repo_dlg_open("CTS")) {
    i = gui()->gimme_index_of("CTS");
    fc_assert(i != -1);
    w = gui()->game_tab_widget->widget(i);
    cr = reinterpret_cast<city_report *>(w);
    cr->update_report();
  }
}

int i;
  city_report *cr;
  QWidget *w;

  if (gui()->is_repo_dlg_open("CTS")) {
    i = gui()->gimme_index_of("CTS");
    fc_assert(i != -1);
    w = gui()->game_tab_widget->widget(i);
    cr = reinterpret_cast<city_report *>(w);
    cr->update_city(pcity);
  }
}

ENDREP
DELTA 24757 599 1297
SVN  ‚ìo‚ìX] •Q  ˆ•T± Rû~¬ CŠ  ÌvŸy)
{
  return game_tab_widget->addTab(widget, titl*
  Removes given tab widget from game page
ENDREP
DELTA 25465 1342 152
SVN  ‚ÈW‚Æwh„3 °&  N‚®@ ‚%±€R ´ »aµ= N‚®@ \ò
€{ W°;§ M‚•@ Ô1öF Q‚®@ %Ëf€} W°; ÇYÎy Q‚®@¥ Q¸>€ W°; |Îy ­‚›Agui()->gimme_place(this, "SCI");
  index = gui()->add_game_tab(this, _("Research")gui()->gimme_place(this, "UNI");
  index = gui()->add_game_tab(this, _("Units"));
  gui()->game_tab_widget->setCurrentIndex
  Updates all widgets in units reportsgui()->gimme_place(this, "ECO");
  index = gui()->add_game_tab(this, _("Economy"));
  gui()->game_tab_widget->setCurrentIndexInitializes place in tab for endgame /
void endgame_report::init()
{
  gui()->gimme_place(this, "END");
  index = gui()->add_game_tab(this, _("Score"));
  gui()->game_tab_widget->setCurrentIndexENDREP
id: 6il.5ck.r25931/63784
type: file
pred: 6il.5ck.r25477/58906
count: 8
text: 25931 41303 21579 29089 181ecf4f22ebb4279c82e25b6b3ebef4
cpath: /trunk/client/gui-qt/cityrep.cpp
copyroot: 15280 /trunk

id: 6jk.5ck.r25931/63983
type: file
pred: 6jk.5ck.r25477/58712
count: 12
text: 25931 2212 538 23117 eb79a08c1e02f7c01e00e1a8ec1e7294
cpath: /trunk/client/gui-qt/plrdlg.cpp
copyroot: 15280 /trunk

id: 6ld.5ck.r25931/64179
type: file
pred: 6ld.5ck.r23687/63972
count: 24
text: 25931 15407 1568 6704 6921ba5de1914f9a218703ae5bf30351
cpath: /trunk/client/gui-qt/fc_client.h
copyroot: 15280 /trunk

id: 6iu.5ck.r25931/64377
type: file
pred: 6iu.5ck.r18893/68245
count: 1
text: 25931 0 2183 3038 5156843434ba520835761828181205e3
cpath: /trunk/client/gui-qt/diplodlg.h
copyroot: 15280 /trunk

id: 6lc.5ck.r25931/64569
type: file
pred: 6lc.5ck.r24892/2166
count: 32
text: 25931 2781 12537 17631 949940bba36b703faaa2db2c10c423f8
cpath: /trunk/client/gui-qt/fc_client.cpp
copyroot: 15280 /trunk

id: 6if.5ck.r25931/64769
type: file
pred: 6if.5ck.r25193/46268
count: 21
text: 25931 15343 36 1699 98905480a54510b032aeb4d8380a604b
cpath: /trunk/client/gui-qt/Makefile.am
copyroot: 15280 /trunk

id: 6it.5ck.r25931/64965
type: file
pred: 6it.5ck.r19259/509220
count: 2
text: 25931 17005 24268 30761 b818704ab968159010e9f66348e93681
cpath: /trunk/client/gui-qt/diplodlg.cpp
copyroot: 15280 /trunk

id: 6ji.5ck.r25931/65166
type: file
pred: 6ji.5ck.r24757/3780
count: 19
text: 25931 62912 135 46680 59fda65609a0bcd6a2fe19746ee85c3c
cpath: /trunk/client/gui-qt/pages.cpp
copyroot: 15280 /trunk

id: 6js.5ck.r25931/65361
type: file
pred: 6js.5ck.r25465/77675
count: 15
text: 25931 63075 681 41847 6c6b5f7344f5b00062dd3e6eaa6b8d73
cpath: /trunk/client/gui-qt/repodlgs.cpp
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 25
file 6if.5ck.r25931/64769
K 10
canvas.cpp
V 25
file 6ig.5ck.r24696/24474
K 8
canvas.h
V 25
file 6ih.5ck.r22768/29447
K 12
chatline.cpp
V 25
file 6ii.5ck.r24999/46925
K 10
chatline.h
V 25
file 6ij.5ck.r18893/72448
K 11
citydlg.cpp
V 25
file 6ik.5ck.r25477/58519
K 9
citydlg.h
V 25
file gr2.5ck.r23687/61804
K 11
cityrep.cpp
V 25
file 6il.5ck.r25931/63784
K 9
cityrep.h
V 25
file 6im.5ck.r23004/46042
K 10
colors.cpp
V 26
file 6in.5ck.r19259/510209
K 8
colors.h
V 24
file 6io.5ck.r19190/3276
K 14
connectdlg.cpp
V 25
file 6ip.5ck.r22313/30662
K 12
connectdlg.h
V 25
file 6iq.5ck.r18893/76659
K 11
dialogs.cpp
V 26
file 6ir.5ck.r25858/116941
K 9
dialogs.h
V 24
file 6is.5ck.r24807/1321
K 12
diplodlg.cpp
V 25
file 6it.5ck.r25931/64965
K 10
diplodlg.h
V 25
file 6iu.5ck.r25931/64377
K 13
fc_client.cpp
V 25
file 6lc.5ck.r25931/64569
K 11
fc_client.h
V 25
file 6ld.5ck.r25931/64179
K 11
finddlg.cpp
V 26
file 6iv.5ck.r19259/511192
K 9
finddlg.h
V 25
file 6iw.5ck.r18893/70592
K 11
gotodlg.cpp
V 26
file 6ix.5ck.r19259/509418
K 9
gotodlg.h
V 25
file 6iy.5ck.r18893/68578
K 12
graphics.cpp
V 26
file 6iz.5ck.r23072/130258
K 10
graphics.h
V 25
file 6j0.5ck.r18893/68912
K 12
gui_main.cpp
V 25
file 6j1.5ck.r24623/59722
K 10
gui_main.h
V 24
file oxo.5ck.r22934/3048
K 11
helpdlg.cpp
V 26
file 6j2.5ck.r19259/511783
K 9
helpdlg.h
V 25
file 6j3.5ck.r18893/72117
K 12
inteldlg.cpp
V 26
file 6j4.5ck.r19259/510601
K 10
inteldlg.h
V 25
file 6j5.5ck.r18893/69584
K 14
luaconsole.cpp
V 26
file 76c.5ck.r23072/129264
K 12
luaconsole.h
V 24
file 76d.5ck.r20309/2264
K 11
mapctrl.cpp
V 25
file 6j6.5ck.r23687/62791
K 9
mapctrl.h
V 25
file 6j7.5ck.r18893/69418
K 11
mapview.cpp
V 25
file 6j8.5ck.r25063/50451
K 9
mapview.h
V 24
file 6j9.5ck.r23059/2475
K 8
menu.cpp
V 25
file 6ja.5ck.r25929/11160
K 6
menu.h
V 23
file 6jb.5ck.r25911/474
K 14
messagedlg.cpp
V 26
file 6jc.5ck.r19259/508025
K 12
messagedlg.h
V 25
file 6jd.5ck.r18893/75986
K 14
messagewin.cpp
V 25
file 6je.5ck.r23687/61605
K 12
messagewin.h
V 25
file 6jf.5ck.r18893/74646
K 13
optiondlg.cpp
V 23
file 6jg.5ck.r24217/198
K 11
optiondlg.h
V 25
file 6jh.5ck.r22593/46398
K 9
pages.cpp
V 25
file 6ji.5ck.r25931/65166
K 7
pages.h
V 25
file 6jj.5ck.r21547/73863
K 10
plrdlg.cpp
V 25
file 6jk.5ck.r25931/63983
K 8
plrdlg.h
V 26
file 6jl.5ck.r23053/177527
K 15
qtg_cxxside.cpp
V 25
file 6jo.5ck.r24999/46726
K 13
qtg_cxxside.h
V 25
file 6jp.5ck.r24999/47122
K 12
ratesdlg.cpp
V 25
file 6jq.5ck.r21586/32162
K 10
ratesdlg.h
V 25
file 6jr.5ck.r21547/72493
K 12
repodlgs.cpp
V 25
file 6js.5ck.r25931/65361
K 10
repodlgs.h
V 25
file 6jt.5ck.r23004/45260
K 16
spaceshipdlg.cpp
V 26
file 6ju.5ck.r19259/507628
K 14
spaceshipdlg.h
V 25
file 6jv.5ck.r18893/75317
K 10
sprite.cpp
V 25
file 6jw.5ck.r21547/74252
K 8
sprite.h
V 24
file 6jx.5ck.r19190/3658
K 10
themes.cpp
V 23
file 6jy.5ck.r20366/177
K 16
voteinfo_bar.cpp
V 26
file 6jz.5ck.r19259/508225
K 14
voteinfo_bar.h
V 25
file 6k0.5ck.r18893/76154
K 9
wldlg.cpp
V 26
file 6k1.5ck.r19259/507830
K 7
wldlg.h
V 25
file 6k2.5ck.r18893/75484
END
ENDREP
id: 6ie.5ck.r25931/68621
type: dir
pred: 6ie.5ck.r25929/14412
count: 148
text: 25931 65560 3048 3048 c10d46dabe76eef4a1835a3baa1455a9
props: 23744 11001 226 0 6f7d09eed101288d23bda49f3147d653
cpath: /trunk/client/gui-qt
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 24
file 5f.5ck.r25193/28836
K 6
agents
V 23
dir zf.5ck.r24916/15005
K 11
attribute.c
V 24
file xh.5ck.r25151/59391
K 11
attribute.h
V 24
file xi.5ck.r18863/23649
K 7
audio.c
V 24
file 139.5ck.r25739/2093
K 7
audio.h
V 24
file 13a.5ck.r24817/7655
K 12
audio_none.c
V 25
file 13d.5ck.r24916/15731
K 12
audio_none.h
V 25
file 13e.5ck.r18863/20841
K 11
audio_sdl.c
V 25
file 13f.5ck.r24916/15487
K 11
audio_sdl.h
V 25
file 13g.5ck.r18863/23885
K 17
chatline_common.c
V 25
file 14q.5ck.r24895/20143
K 17
chatline_common.h
V 24
file 14r.5ck.r24892/5917
K 16
citydlg_common.c
V 22
file z4.5ck.r25538/602
K 16
citydlg_common.h
V 24
file z5.5ck.r18863/18619
K 13
cityrepdata.c
V 25
file mb.5ck.r24790/282697
K 13
cityrepdata.h
V 24
file mc.5ck.r18863/19121
K 13
client_main.c
V 24
file 2f.5cp.r25768/30733
K 13
client_main.h
V 24
file hz.5cq.r24622/12216
K 8
climap.c
V 24
file 197.5ck.r20232/3008
K 8
climap.h
V 25
file 198.5ck.r18863/24126
K 9
climisc.c
V 24
file d5.5ck.r25929/10918
K 9
climisc.h
V 24
file i0.5ck.r25929/14655
K 8
clinet.c
V 25
file hc.5ck.r24790/297725
K 8
clinet.h
V 24
file i1.5ck.r18863/24866
K 15
colors_common.c
V 24
file 33a.5ck.r22855/3020
K 15
colors_common.h
V 24
file 33b.5ck.r24136/6711
K 19
connectdlg_common.c
V 23
file 2fw.5ck.r24352/536
K 19
connectdlg_common.h
V 25
file 2fx.5ck.r19154/53802
K 9
control.c
V 22
file gz.5ck.r25918/147
K 9
control.h
V 23
file i2.5ck.r24693/5723
K 7
dummy.c
V 23
file 4f9.5ck.r15641/551
K 12
dummycxx.cpp
V 23
file 6kr.5ck.r18947/939
K 8
editor.c
V 25
file 3bg.5ck.r25326/16863
K 8
editor.h
V 23
file 3bh.5ck.r23105/702
K 11
ggzclient.c
V 26
file 394.5ck.r20126/104106
K 11
ggzclient.h
V 25
file 395.5ck.r18863/21083
K 17
global_worklist.c
V 26
file 4i6.5ck.r19259/493810
K 17
global_worklist.h
V 25
file 4i7.5ck.r18863/22960
K 6
goto.c
V 24
file vu.5ck.r25467/49888
K 6
goto.h
V 24
file vv.5ck.r23027/81018
K 11
gui-gtk-2.0
V 23
dir zs.5ck.r25929/19334
K 11
gui-gtk-3.0
V 23
dir zs.5g7.r25929/10654
K 6
gui-qt
V 24
dir 6ie.5ck.r25931/68621
K 7
gui-sdl
V 25
dir 16t.5ck.r25858/146923
K 8
gui-sdl2
V 23
dir 16t.5l8.r25913/7415
K 8
gui-stub
V 24
dir mh.5ck.r25858/123662
K 7
gui-xaw
V 23
dir 9o.5ck.r25929/23158
K 14
gui_cbsetter.c
V 25
file a3c.5ck.r24999/46534
K 14
gui_cbsetter.h
V 25
file a3d.5ck.r20753/37736
K 15
gui_interface.c
V 25
file 6jm.5ir.r24999/32828
K 15
gui_interface.h
V 25
file 6jn.5is.r24999/33046
K 10
helpdata.c
V 24
file h1.5ck.r25927/35697
K 10
helpdata.h
V 24
file i3.5ck.r25494/33011
K 7
include
V 24
dir b8.5ck.r25858/134329
K 19
luaconsole_common.c
V 25
file 75z.5ck.r24895/19951
K 19
luaconsole_common.h
V 25
file 760.5ck.r20306/31022
K 9
luascript
V 23
dir 761.5ck.r24745/8494
K 16
mapctrl_common.c
V 26
file 15m.5ck.r24790/297469
K 16
mapctrl_common.h
V 25
file 15n.5ck.r19893/12504
K 16
mapview_common.c
V 24
file z2.5ck.r25151/59635
K 16
mapview_common.h
V 23
file z3.5ck.r24711/3555
K 19
messagewin_common.c
V 26
file 14s.5ck.r24790/282945
K 19
messagewin_common.h
V 25
file 14t.5ck.r18863/21579
K 7
music.c
V 23
file zmc.5ck.r25733/768
K 7
music.h
V 23
file zme.5ck.r25733/950
K 9
options.c
V 22
file dc.5ck.r25797/264
K 9
options.h
V 24
file i4.5ck.r24886/82892
K 17
overview_common.c
V 26
file 2yk.5ck.r24790/283201
K 17
overview_common.h
V 26
file 2yl.5ck.r24790/283707
K 10
packhand.c
V 23
file n.5ck.r25902/14062
K 10
packhand.h
V 24
file i5.5ck.r18863/20596
K 15
plrdlg_common.c
V 23
file 14u.5ck.r23426/823
K 15
plrdlg_common.h
V 25
file 14v.5ck.r18863/21328
K 17
repodlgs_common.c
V 25
file 11i.5ck.r22325/76263
K 17
repodlgs_common.h
V 25
file 11j.5ck.r19589/11861
K 9
reqtree.c
V 25
file 2ym.5ck.r25398/35740
K 9
reqtree.h
V 24
file 2yn.5ck.r24150/6004
K 9
servers.c
V 25
file 33x.5ck.r25113/10928
K 9
servers.h
V 25
file 33y.5ck.r20478/36372
K 6
text.c
V 25
file 2g3.5ck.r25720/22295
K 6
text.h
V 25
file 2g4.5ck.r24459/13284
K 15
themes_common.c
V 25
file 352.5ck.r19354/73121
K 15
themes_common.h
V 25
file 353.5ck.r18863/22710
K 10
tilespec.c
V 23
file hl.5ck.r25393/5766
K 10
tilespec.h
V 24
file i6.5ck.r24914/19762
K 19
unitselect_common.c
V 24
file 76v.5ck.r20397/3580
K 19
unitselect_common.h
V 25
file 76w.5ck.r25151/64474
K 14
update_queue.c
V 25
file 4jw.5ck.r25151/75674
K 14
update_queue.h
V 25
file 4jx.5ck.r18863/22078
K 10
voteinfo.c
V 26
file 4fe.5ck.r24790/281519
K 10
voteinfo.h
V 25
file 4ff.5ck.r18863/22523
END
ENDREP
id: d.5ck.r25931/73233
type: dir
pred: d.5ck.r25929/27769
count: 6143
text: 25931 68865 4355 4355 9b1edfa7f9d19f8810e94666223ad0f8
props: 23990 857 387 0 afe872b7fe8919650a535e373916e1f7
cpath: /trunk/client
copyroot: 15280 /trunk

PLAIN
K 9
ABOUT-NLS
V 24
file fu.5ck.r23462/85000
K 7
AUTHORS
V 24
file 5u.5ck.r22143/14016
K 7
COPYING
V 19
file 1h.0.r9643/400
K 9
ChangeLog
V 26
file 6l.5ck.r22811/6091752
K 7
INSTALL
V 22
file 6.5ck.r25794/3775
K 11
Makefile.am
V 24
file 59.5ck.r25866/38855
K 4
NEWS
V 24
file 6m.5ck.r25634/30702
K 6
README
V 20
file 7.0.r4421/96382
K 2
ai
V 22
dir 8.5ck.r25927/28192
K 10
autogen.sh
V 24
file 12o.5ck.r25794/4003
K 9
bootstrap
V 23
dir 2p5.5ck.r25795/2143
K 6
client
V 22
dir d.5ck.r25931/73233
K 6
common
V 22
dir p.5ck.r25929/33750
K 12
configure.ac
V 24
file 149.5ck.r25794/4238
K 4
data
V 22
dir w.5ck.r25903/65387
K 12
dependencies
V 25
dir 2yu.5ck.r25888/631324
K 11
diff_ignore
V 23
file qq.5ck.r24665/2850
K 3
doc
V 23
dir k7.5ck.r25927/30857
K 10
fc_version
V 25
file 2lo.5en.r25927/28418
K 2
m4
V 24
dir 12p.5ck.r25866/41970
K 7
scripts
V 22
dir 2yo.5ck.r24495/862
K 6
server
V 22
dir z.5ck.r25927/35465
K 5
tests
V 22
dir 2g9.5ck.r25379/673
K 5
tools
V 24
dir 4pj.5js.r25923/16580
K 12
translations
V 25
dir t0a.5ck.r25887/450720
K 7
utility
V 22
dir 1c.5ck.r25915/6423
K 3
vms
V 25
dir u9.5ck.r21528/1396085
K 5
win32
V 23
dir 2eu.5ck.r25498/1618
END
ENDREP
id: 3.5ck.r25931/74641
type: dir
pred: 3.5ck.r25929/35155
count: 17970
text: 25931 73465 1163 1163 869ed4e9e22f1a6314c3bc9bed21d07f
props: 23244 4830 282 0 e4bb46e81629a60eef613b169b23a9ea
cpath: /trunk
copyroot: 15280 /trunk

PLAIN
K 8
branches
V 20
dir 1.0.r25930/40771
K 4
tags
V 19
dir 2.0.r25885/6524
K 5
trunk
V 22
dir 3.5ck.r25931/74641
K 7
website
V 21
dir 3ge.0.r22980/2263
END
ENDREP
id: 0.0.r25931/75035
type: dir
pred: 0.0.r25930/41095
count: 25931
text: 25931 74868 154 154 36c5123415aca09037817f80c6e44cc5
cpath: /
copyroot: 0 /

6iu.5ck.t25930-1 modify true false /trunk/client/gui-qt/diplodlg.h

6jk.5ck.t25930-1 modify true false /trunk/client/gui-qt/plrdlg.cpp

6lc.5ck.t25930-1 modify true false /trunk/client/gui-qt/fc_client.cpp

6if.5ck.t25930-1 modify true false /trunk/client/gui-qt/Makefile.am

6ld.5ck.t25930-1 modify true false /trunk/client/gui-qt/fc_client.h

6it.5ck.t25930-1 modify true false /trunk/client/gui-qt/diplodlg.cpp

6il.5ck.t25930-1 modify true false /trunk/client/gui-qt/cityrep.cpp

6ji.5ck.t25930-1 modify true false /trunk/client/gui-qt/pages.cpp

6js.5ck.t25930-1 modify true false /trunk/client/gui-qt/repodlgs.cpp


75035 75185
