DELTA 18893 10662 886
SVN  Œ_‘m"…M G  …Hµ ‚T…s§ G  2‰² G  5‹€„?fc_config.h>
#endif

// gui-qt
#include "fc_client.h"  qDebug("Messwin dialog popup\n");
}

qDebug("Messwin open check\n");
  return TRUE;
}

qDebug("Messwin update\n");
  int  i, num;
  const struct message *pmsg;

  gui()->messages_window->clearContents();
  gui()->messages_window->setRowCount(0);

  num = meswin_get_num_messages();

  for (i = 0; i < num; i++) {
    QTableWidgetItem *item;
    item = new QTableWidgetItem();
    pmsg = meswin_get_message(i);
    gui()->messages_window->insertRow(i);
    item->setText(QString::fromUtf8(pmsg->descr));
    gui()->messages_window->setItem(i, 0, item);
  }

  gui()->messages_window->resizeColumnToContents(0);
  gui()->messages_window->resizeRowsToContents();
}
ENDREP
DELTA 18893 27858 1157
SVN  $¤4’? G  …H€‚* G  „U‡ € G  ƒxŒ, G ¥ D†@€Šc G ¤ D†@€ƒJfc_config.h>
#endif

// std
#include <stdlib.h>

// Qt
#include <QKeyEvent>
#include <QPushButton>
#include <QMouseEvent>

// client
#include "mapctrl.h"
#include "client_main.h"
#include "unit.h"
#include "control.h"
#include "tile.h"

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



if (state) {
    gui()->game_info_label->end_turn_button->setEnabled(true);
  } else {
    gui()->game_info_label->end_turn_button->setDisabled(true);
  }
}


****
  Keyboard handler for map_view
******/
void map_view::keyPressEvent(QKeyEvent * event)
{
  Qt::KeyboardModifiers key_mod = QApplication::keyboardModifiers();
  bool is_shift = key_mod.testFlag(Qt::ShiftModifier);

  if (C_S_RUNNING == client_state()) {
    if (is_shift) {
      switch (event->key()) {
      case Qt::Key_Return:
      case Qt::Key_Enter:
        key_end_turn();
        return;
      default:
        break;
      }
    }

    switch (event->key()) {
    case Qt::Key_Up:
    case Qt::Key_8:
      key_unit_move(DIR8_NORTH);
      qDebug("NBORTH");
      return;
    case Qt::Key_Left:
    case Qt::Key_4:
      key_unit_move(DIR8_WEST);
      return;
    case Qt::Key_Right:
    case Qt::Key_6:
      key_unit_move(DIR8_EAST);
      return;
    case Qt::Key_Down:
    case Qt::Key_2:
      key_unit_move(DIR8_SOUTH);
      return;
    case Qt::Key_PageUp:
    case Qt::Key_9:
      key_unit_move(DIR8_NORTHEAST);
      return;
    case Qt::Key_PageDown:
    case Qt::Key_3:
      key_unit_move(DIR8_SOUTHEAST);
      return;
    case Qt::Key_Home:
    case Qt::Key_7:
      key_unit_move(DIR8_NORTHWEST);
      return;
    case Qt::Key_End:
    case Qt::Key_1:
      key_unit_move(DIR8_SOUTHWEST);
      return;
    case Qt::Key_5:
      key_recall_previous_focus_unit();
      return;
    case Qt::Key_Escape:
      key_cancel_action();
      return;
    default:
      break;
    }
  }
}

****
 * Mouse Handler for map_view
 *****/
void map_view::mousePressEvent(QMouseEvent *event)
{
  struct tile* ptile;
  int i;

  if (event->button() == Qt::RightButton) {
    recenter_button_pressed(event->x(), event->y());
  }

  i = 0;

  if (event->button() == Qt::LeftButton) {
    ptile = canvas_pos_to_tile(event->x(), event->y());
    unit_list_iterate(ptile->units, punit) {
      i++;

      if (i == 1) {
        unit_focus_set(punit);
      }
    }
    unit_list_iterate_end;
  }
}
ENDREP
DELTA 18893 12181 805
SVN  Š|¯<~™J G  …H€‚> G  „†h G   K‰€Ž6 G ­ L‰~€‚ A – B‰€@ A – B‰º A œ B‰€D A – B‰¹ A “ B‰¾ A ’ B‰½ A — B‰€G A • B‰€D A Ÿ B‰·fc_config.h>
#endif

// Qt
#include <QMenuBar>

// common
#include "game.h"
#include "government.h"
#include "road.h"
#include "unit.h"

// client
#include "control.h"

// gui-qt
#include "qtg_cxxside.h"
#include "fc_client.h"
#include "chatline.h"
#include "ratesdlg.h"

#include "menu.h"

extern QApplication *qapp;

******
  Initializes menu system**/
void mr_menu::setup_menus()
{
  QMenu *menu;
  QAction *act;

  /* View Menu */
  menu = this->addMenu(_("View"));
  act = menu->addAction(_("Center View"));
  act->setShortcut(QKeySequence(tr("c")));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_center_view()));

  /* Unit Menu */
  menu = this->addMenu(_("Unit"));
  act = menu->addAction(_("Sentry"));
  act->setShortcut(QKeySequence(tr("s")));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_unit_sentry()));

  /* Combat Menu */
  menu = this->addMenu(_("Combat"));
  act = menu->addAction(_("Fortify"));
  act->setShortcut(QKeySequence(tr("f")));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_unit_fortify()));

  /* Work Menu */
  menu = this->addMenu(_("Work"));
  act = menu->addAction(_("Build city"));
  act->setShortcut(QKeySequence(tr("b")));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_build_city()));

  act = menu->addAction(_("Build road"));
  act->setShortcut(QKeySequence(tr("r")));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_build_road()));

  act = menu->addAction(_("Build irrigation"));
  act->setShortcut(QKeySequence(tr("i")));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_build_irrigation()));

  act = menu->addAction(_("Build mine"));
  act->setShortcut(QKeySequence(tr("m")));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_build_mine()));

  /* Help Menu */
  menu = this->addMenu(_("Civilization"));
  act = menu->addAction(_("Tax rates"));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_popup_tax_rates()));

  /* Help Menu */
  menu = this->addMenu(_("Help"));
  act = menu->addAction(_("Copying"));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_menu_copying()));

  act = menu->addAction(_("About Qt"));
  connect(act, SIGNAL(triggered()), this, SLOT(slot_about_qt()));

  this->setVisible(false);
}

******
  Copying item selected from Help menu**/
void mr_menu::slot_menu_copying()
{
  real_output_window_append(_("Freeciv is covered by the GPL."), NULL, -1);
  real_output_window_append(_("See file COPYING distributed with "
                              "freeciv for full license text."), NULL, -1);
}


  Action "BUILD_CITY"/
void mr_menu::slot_build_city()
{
  key_unit_build_city();
}


  Action "BUILD_ROAD"/
void mr_menu::slot_build_road()
{
  key_unit_road();
}


  Action "BUILD_IRRIGATION"/
void mr_menu::slot_build_irrigation()
{
  key_unit_irrigate();
}


  Action "BUILD_MINE"/
void mr_menu::slot_build_mine()
{
  key_unit_mine();
}

  Action "FORTIFY"/
void mr_menu::slot_unit_fortify()
{
  key_unit_fortify();
}

  Action "SENTRY"/
void mr_menu::slot_unit_sentry()
{
  key_unit_sentry();
}


  Action "CENTER VIEW"/
void mr_menu::slot_center_view()
{
  request_center_focus_unit();
}


  Action "TAX RATES"/
void mr_menu::slot_popup_tax_rates()
{
  popup_rates_dialog();
}


  Information about Qt version/
void mr_menu::slot_about_qt()
{
  qapp->aboutQt();
}
ENDREP
DELTA 18893 29028 576
SVN  †ˆ+‚ G  …2H€‚…x// Qt
#include <QMenuBar>
#include <QtGui>
#include <QSizePolicy>

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

struct player;
struct connection;
struct server_scan;

void create_conn_menu (player*, connection*);
void server_scan_error (server_scan*, const char*);ENDREP
DELTA 18893 56095 737
SVN  ˆ2ÁIN³C G  …Hµ  …s€r M‡4€ŸV G €J S‡3€†# G ¸ S‡3€‡r G €A Q‡5€C G €P Q‡5€ G  7†l€Sfc_config.h>
#endif

// gui-qt
#include "fc_client.h"Dialog constructor for changing rates with sliders.
  Automatic destructor will clean qobjects, so there is no onetax_rates_dialog::tax_rates_dialog(QWidget *parent)
  : QDialog (parent)
{
  QString str;
  int max;

  some_label = new QLabel;
  tax_label = new QLabel;
  sci_label = new QLabel;
  lux_label = new QLabel;
  tax_checkbox = new QCheckBox;
  sci_checkbox = new QCheckBox;
  lux_checkbox = new QCheckBox;
  tax_slider = new QSlider;
  sci_slider = new QSlider;
  lux_slider = new QSlider;
  button_box = new QDialogButtonBox;
  cancel_button = new QPushButton;
  ok_button = new QPushButton;

  tax = client.conn.playing->economic.tax / 10;
  lux = client.conn.playing->economic.luxury / 10;
  sci = client.conn.playing->economic.science / 10;

  if (NULL != client.conn.playing) {
    max = get_player_bonus(client.conn.playing, EFT_MAX_RATES);
  } else {
    max = 100;
  }

  setWindowTitle(_("Select tax, luxury and science rates"));
  QVBoxLayout *main_layout = new QVBoxLayout;

  // FIXME: Translations support.
  str = QString::fromUtf8
        (government_name_for_player(client.conn.playing)) + " "
        + "max rate: " + QString::number(max) + "%";

  some_label->setText(str);
  main_layout->addWidget(some_label);
  main_layout->addSpacing(20);

  // tax
  QGroupBox* group_box = new QGroupBox("Tax");
  QHBoxLayout *group_box_layout = new QHBoxLayout;
  QHBoxLayout *some_layout = new QHBoxLayout;
  tax_slider->setMaximum(max / 10);
  tax_slider->setMinimum(0);
  tax_slider->setValue(tax);
  tax_slider->setOrientation(Qt::Horizontal);
  connect(tax_slider, SIGNAL(valueChanged(int)),
          SLOT(slot_set_value(int)));
  group_box_layout->addWidget(tax_slider);
  str = QString::number(tax_slider->value() * 10) + "%"; // FIXME: Translations
  tax_label->setText(str);
  group_box_layout->addWidget(tax_label);
  group_box_layout->addSpacing(20);
  str = _("Lock");
  some_label = new QLabel;
  some_label->setText(str);
  group_box_layout->addWidget(some_label);
  group_box_layout->addWidget(tax_checkbox);
  group_box->setLayout(group_box_layout);
  main_layout->addWidget(group_box);

  // sci
  group_box = new QGroupBox("Science");
  group_box_layout = new QHBoxLayout;
  some_layout = new QHBoxLayout;
  sci_slider->setMaximum(max / 10);
  sci_slider->setMinimum(0);
  sci_slider->setValue(sci);
  sci_slider->setOrientation(Qt::Horizontal);
  connect(sci_slider, SIGNAL(valueChanged (int)),
          SLOT(slot_set_value (int)));
  group_box_layout->addWidget(sci_slider);
  str = QString::number(sci_slider->value() * 10) + "%";
  sci_label->setText(str);
  group_box_layout->addWidget(sci_label);
  group_box_layout->addSpacing(20);
  str = _("Lock");
  some_label = new QLabel;
  some_label->setText(str);
  group_box_layout->addWidget(some_label);
  group_box_layout->addWidget(sci_checkbox);
  group_box->setLayout(group_box_layout);
  main_layout->addWidget(group_box);

  // lux
  group_box = new QGroupBox("Luxury");
  group_box_layout = new QHBoxLayout;
  some_layout = new QHBoxLayout;
  lux_slider->setMaximum(max / 10);
  lux_slider->setMinimum(0);
  lux_slider->setValue(lux);
  lux_slider->setOrientation(Qt::Horizontal);
  connect(lux_slider, SIGNAL(valueChanged(int)),
          SLOT(slot_set_value(int)));
  group_box_layout->addWidget(lux_slider);
  str = QString::number(lux_slider->value() * 10) + "%";
  lux_label->setText(str);
  group_box_layout->addWidget(lux_label);
  group_box_layout->addSpacing(20);
  str = _("Lock");
  some_label = new QLabel;
  some_label->setText(str);
  group_box_layout->addWidget(some_label);
  group_box_layout->addWidget(lux_checkbox);
  group_box->setLayout(group_box_layout);
  main_layout->addWidget(group_box);

  some_layout = new QHBoxLayout;
  cancel_button->setText(_("Cancel"));
  ok_button->setText(_("Ok"));
  connect(cancel_button, SIGNAL(pressed()),
          SLOT(slot_cancel_button_pressed()));
  connect(ok_button, SIGNAL(pressed()),
          SLOT(slot_ok_button_pressed()));
  some_layout->addWidget(cancel_button);
  some_layout->addWidget(ok_button);

  main_layout->addSpacing(20);
  main_layout->addLayout(some_layout);
  setLayout(main_layout);

}

****
  Slot in dialog executed by qt-signal setValue() when moving sliderstax_rates_dialog::slot_set_value(int i)
{
  QSlider* qo;
  QString str;
  qo = (QSlider*) QObject::sender();
  QString sender;

  if (qo == tax_slider) {
    tax = i;
    tax_label->setText(QString::number(10 * tax) + "%");
    sender = "TAX";
  }

  if (qo == sci_slider) {
    sci = i;
    sci_label->setText(QString::number(10 * tax) + "%");
    sender = "SCI";
  }

  if (qo == lux_slider) {
    lux = i;
    lux_label->setText(QString::number(10 * tax) + "%");
    sender = "LUX";
  }

  if (sci + tax + lux != 10) {
    check(sender);
  }

  str = QString::number(lux_slider->value() * 10) + "%";
  lux_label->setText (str);
  str = QString::number(tax_slider->value() * 10) + "%";
  tax_label->setText(str);
  str = QString::number(sci_slider->value() * 10) + "%";
  sci_label->setText(str);

}

****
  Checks if rates are correct and moves other ratestax_rates_dialog::check(QString qo)
{
  int maxrate;
  bool tax_lock;
  bool sci_lock;
  bool lux_lock;

  if (NULL != client.conn.playing) {
    maxrate = get_player_bonus(client.conn.playing, EFT_MAX_RATES) / 10;
  } else {
    maxrate = 10;
  }

  tax_lock = tax_checkbox->isChecked();
  sci_lock = sci_checkbox->isChecked();
  lux_lock = lux_checkbox->isChecked();

  if (qo == "TAX") {
    if (!lux_lock) {
      lux = MIN(MAX(10 - tax - sci, 0), maxrate);
    }

    if (!sci_lock) {
      sci = MIN(MAX(10 - tax - lux, 0), maxrate);
    }
  } else if (qo == "LUX") {

    if (!tax_lock) {
      tax = MIN(MAX(10 - lux - sci, 0), maxrate);
    }

    if (!sci_lock) {
      sci = MIN (MAX (10 - lux - tax, 0), maxrate);
    }
  } else if (qo == "SCI") {
    if (!lux_lock) {
      lux = MIN(MAX(10 - tax - sci, 0), maxrate);
    }

    if (!tax_lock) {
      tax = MIN(MAX(10 - lux - sci, 0), maxrate);
    }
  }

  tax_slider->setValue(tax);
  lux_slider->setValue(lux);
  sci_slider->setValue(sci);
}

*****
  When cancel in qtpushbutton pressed selfdestruction :D.
*tax_rates_dialog::slot_cancel_button_pressed()
{
  delete this;
}

*****
  When ok in qpushbutton pressed send info to server and selfdestroy :D.
*tax_rates_dialog::slot_ok_button_pressed()
{
  dsend_packet_player_rates(&client.conn, 10 * tax, 10 * lux, 10 * sci);
  delete this;
}

tax_rates_dialog* trd = new tax_rates_dialog(gui()->central_wdg);
  trd->show();
}
ENDREP
DELTA 18893 56845 1937
SVN  œ!¥%GŒ` G  …H€ G  ‚k†‚ ƒ$‰k€ G  ‡iŽ€† G ¬ E†@€ G  	šg€C G €E E†@€hfc_config.h>
#endif

#include <stdlib.h>

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

#include "sprite.h"

  qtg_load_gfxfile(const char *filename)
{
  sprite *entire = new sprite;

  entire->pm = new QPixmap(filename);

  return entire;
}

qtg_crop_sprite(struct sprite *source,
                               int x, int y, int width, int height,
                               struct sprite *mask,
                               int mask_offset_x, int mask_offset_y)
{

  if (!width || !height) {
    return NULL;
  }

  sprite *cropped = new sprite;

  cropped->pm = new QPixmap(width, height);
  cropped->pm->fill(Qt::transparent);
  QRectF source_rect(x,y,width, height);
  QRectF dest_rect(0,0,width, height);

  QPainter p;
  p.begin(cropped->pm);
  p.drawPixmap(dest_rect, *source->pm,source_rect);
  p.end();


  if(mask) {
    p.begin(cropped->pm);
    p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
    p.drawPixmap(mask_offset_x-x,mask_offset_y-y,*mask->pm);
    p.end();
  }

  return cropped;
}

******
  Find the dimensions of the sprite.
*******/
void qtg_get_sprite_dimensions(struct sprite *sprite, int *width, int *height)
{
  *width = sprite->pm->width();
  *height = sprite->pm->height();
}

qtg_free_sprite(struct sprite *s)
{
  delete s->pm;
  delete s;
}

******
  Create a new sprite with the given height, width and color.
*******/
struct sprite *qtg_create_sprite(int width, int height, struct color *pcolor)
{
  struct sprite *created = new sprite;

  created->pm = new QPixmap(width, height);

  created->pm->fill(pcolor->qcolor);

  return created;
}
ENDREP
DELTA 18893 59519 3623
SVN  Çk‹k‚mº] G  …H€‚@ M®@¡ K¨ €: O®>€E K¨ €9 O®>¥ K¨ €M O®>– K¨ €M O®>ž K¨ €b O®>– K¨ €( O®>¤ K¨ €† O®>¦ K¨ €J O®>¦ K¨ €K O®>© K¨ €H O®>¬ Iž@€e T®> ‚ˆ9€C T®> ‰;$€[ T®> ƒ
™z€ O®>š K¨ €
 O®>€J K¨ €…M Q”  ‚#Ÿ€d T®>« P§ ‚h£?€‚ T®> F§5€` T®> -ª T®> ‚¬ ƒ®? S®? …f²-€D O®> K¨ € c³r£ U§€{ S®>Ž U¨  †»l€E T®> ‚>Âj¢ ^³r hÆ R®@­ P§€F R®@ U§° T®>› U§€<fc_config.h>
#endif

// utility
#include "support.h"

// common
#include "game.h"

// client
#include "climisc.h"
#include "mapctrl_common.h"
#include "sprite.h"
#include "text.h"

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

const char*get_timeout_label_text();
static int mapview_frozen_level = 0;
extern struct canvas *canvas;
  Constructor for idle callbacks/
mr_idle::mr_idle()
{
  connect(&timer, SIGNAL(timeout()), this, SLOT(idling()));
  /*if there would be messages in
   *that queue is big we may want to decrease it*/
  timer.start(50);
  slot used to execute 1 callback from callabcks stored in idle list/
void mr_idle::idling()
{
  call_me_back* cb = new call_me_back;

  if (!callback_list.isEmpty()) {
    cb = callback_list.dequeue();
    (cb->callback) (cb->data);
    delete cb;
  }

  Adds one callback to execute later/
void mr_idle::add_callback(call_me_back* cb)
{
  callback_list.enqueue(cb);
  Constructor for map/
map_view::map_view() : QWidget()
{
  background = QBrush(QColor (0, 0, 0));
  slot inherited from QPixamp/
void map_view::paintEvent(QPaintEvent *event)
{
  QPainter painter;
  painter.begin(this);

  // painter.setRenderHint(QPainter::Antialiasing);
  painter.setBackground(background);
  paint(&painter, event);

  painter.end();
  Redraws visible map/
void map_view::paint(QPainter *painter, QPaintEvent *event)
{
  QSize s;

  s = size();
  painter->drawPixmap(0, 0, s.width(), s.height(), mapview.store->map_pixmap);
  Constructor for information label/
info_label::info_label() : QLabel()
{
  layout = new QHBoxLayout;
  turn_info = new QLabel;
  time_label = new QLabel;
  eco_info = new QLabel;
  rates_label =  new QLabel;
  indicator_icons = new QLabel;
  turn_info->setText(_("TURN"));
  end_turn_button = new QPushButton;
  layout->addWidget(turn_info);
  layout->addStretch();
  layout->addWidget(eco_info);
  layout->addStretch();
  layout->addWidget(indicator_icons);
  layout->addStretch();
  layout->addWidget(rates_label);
  layout->addStretch();
  layout->addWidget(time_label);
  layout->addStretch();
  layout->addWidget(end_turn_button);

  end_turn_button->setText(_("End Turn"));
  QObject::connect(end_turn_button , SIGNAL(clicked()), this,
                   SLOT(slot_end_turn_done_button()));
  setLayout(layout);
  Sets information about current turn/
void info_label::set_turn_info(QString str)
{
  turn_info->setText(str);
  Sets information about current time/
void info_label::set_time_info(QString str)
{
  time_label->setText(str);
  Sets information about current economy/
void info_label::set_eco_info(QString str)
{
  eco_info->setText(str);
 * sets minimal size of information label
 /
QSize info_label::sizeHint() const
{
  QSize s;

  s.setWidth(200);
  s.setHeight(32);

  return s;QString eco_info;
  int d;
  struct sprite *sprite = get_tax_sprite(tileset, O_LUXURY);
  int w = sprite->pm->width();
  int h = sprite->pm->height();
  QPixmap final(10 * w, h);
  QPainter p;
  QRect source_rect(0, 0, w, h);
  QRect dest_rect(0, 0, w, h);
  final.fill (Qt::black);

  if (client.conn.playing != NULL) {
    gui()->game_info_label->set_turn_info (
      QString::fromLatin1(textyear(game.info.year)));

    eco_info = "<font color='purple'>G:"
               + QString::number(client.conn.playing->economic.gold)
               + "</font>" + "<font color='blue'>|R:"
               + QString::number(client.conn.playing->bulbs_last_turn)
               + "</font>";
    gui()->game_info_label->set_eco_info(eco_info);
    set_indicator_icons(client_research_sprite(),
                        client_warming_sprite(),
                        client_cooling_sprite(),
                        client_government_sprite());
    d = 0;

    for (; d < client.conn.playing->economic.luxury / 10; d++) {
      dest_rect.moveTo(d * w, 0);
      p.begin(&final);
      p.drawPixmap(dest_rect, *sprite->pm, source_rect);
      p.end();
    }

    sprite = get_tax_sprite(tileset, O_SCIENCE);

    for (; d < (client.conn.playing->economic.science
                + client.conn.playing->economic.luxury) / 10; d++) {
      dest_rect.moveTo(d * w, 0);
      p.begin(&final);
      p.drawPixmap(dest_rect, *sprite->pm, source_rect);
      p.end();
    }

    sprite = get_tax_sprite(tileset, O_GOLD);

    for (; d < 10; d++) {
      dest_rect.moveTo(d * w, 0);
      p.begin(&final);
      p.drawPixmap(dest_rect, *sprite->pm, source_rect);

      p.end();
    }

    gui()->game_info_label->rates_label->setPixmap(final);
  }
gui()->game_info_label->set_time_info (
    QString::fromLatin1(get_timeout_label_text()));
  if (!get_turn_done_button_state()) {
    return;
  }

  if (do_restore) {
    gui()->game_info_label->end_turn_button->setEnabled(true);
  }

  Clicked end turn button/
void info_label::slot_end_turn_done_button()
{
  key_end_turn();
  end_turn_button->setDisabled(true);
  gui()->mapview_wdg->setFocus();
  Sets icons in information label
  I assume all icons have the same size/
void info_label::set_indicator_icons(QPixmap* bulb, QPixmap* sol,
                                     QPixmap* flake, QPixmap* gov)
{
  QPixmap final(4 * bulb->width(), bulb->height()) ;
  final.fill(Qt::black);

  QPainter p;
  QRect source_rect(0, 0, bulb->width(), bulb->height());
  QRect dest_rect(0, 0, bulb->width(), bulb->height());

  p.begin(&final);
  p.drawPixmap(dest_rect, *bulb, source_rect);
  dest_rect.setLeft(bulb->width());
  p.drawPixmap(dest_rect, *sol, source_rect);
  dest_rect.setLeft(2 * bulb->width());
  p.drawPixmap(dest_rect, *flake, source_rect);
  dest_rect.setLeft(3 * bulb->width());
  p.drawPixmap(dest_rect, *gov, source_rect);
  p.end();

  indicator_icons->setPixmap(final);
}                         struct sprite *flake, struct sprite *gov)
{
  qDebug("set indi icons");
  gui()->game_info_label->set_indicator_icons(bulb->pm, sol->pm, flake->pm,
                                              gov->pm);Return a canvas that is the overview window                     int pixel_width, int pixel_height)
{
  qDebug("flush_mapcanvas\n");
  gui()->mapview_wdg->update(canvas_x - pixel_width,
                             canvas_y - pixel_height,
                             3 * pixel_width, 3 * pixel_height);                int pixel_width, int pixel_height)
{
  gui()->mapview_wdg->update(canvas_x - pixel_width,
                             canvas_y - pixel_height, 3 * pixel_width,
                             3 * pixel_height);gui()->mapview_wdg->update();qDebug("update_city_descriptions\n");
  update_map_canvas_visible();
  Put overlay tile to pixmap/
void pixmap_put_overlay_tile(int canvas_x, int  canvas_y,
                              struct sprite *ssprite)
{
  if (!ssprite) {
    return;
  }
Draw a cross-hair overlay on a tileput_cross_overlay_tile(struct tile *ptile)
{
  int canvas_x, canvas_y;

  if (tile_to_canvas_pos(&canvas_x, &canvas_y, ptile)) {
    pixmap_put_overlay_tile(canvas_x, canvas_y,
                            get_attention_crosshair_sprite(tileset));
  }
Area SelectionqDebug("get_overview_area_dimension\n");
  *width = 0;
  *height = 0;qDebug("overview_size_changed\n");Return whether the map should be drawn or notbool mapview_is_frozen(void)
{
  return (0 < mapview_frozen_level);
}
Freeze the drawing of the mapmapview_freeze(void)
{
  mapview_frozen_level++;Thaw the drawing of the mapmapview_thaw(void)
{
  if (1 < mapview_frozen_level) {
    mapview_frozen_level--;
  } else {
    fc_assert(0 < mapview_frozen_level);
    mapview_frozen_level = 0;
    dirty_all();
  }
}
ENDREP
DELTA 18893 30241 599
SVN  †Šf„b † €„b// Qt
#include <QMenuBar>
#include <QObject>

class mr_menu : public QMenuBar
{
  Q_OBJECT
public:
  mr_menu() {};
  void setup_menus();
private slots:
  /* help menu */
  void slot_menu_copying();
  void slot_about_qt();

  /*used by work menu*/
  void slot_build_city();
  void slot_build_road();
  void slot_build_irrigation();
  void slot_build_mine();

  /*used by unit menu */
  void slot_unit_sentry();

  /*used by combat menu*/
  void slot_unit_fortify();

  /*used by view menu*/
  void slot_center_view();

  /*used by civilization menu */
  void slot_popup_tax_rates();
};

#endif /* FC__MENU_H */
ENDREP
DELTA 18893 48443 579
SVN  †‘Š] …Y €… G €…W† // In this case we have to include fc_config.h from header file.
// Some other headers we include demand that fc_config.h must be
// included also. Usually all source files include fc_config.h, but
// there's moc generated meta_ratesdlg.cpp file which does not.
#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// Qt
#include <QLabel>
#include <QCheckBox>
#include <QSlider>
#include <QDialog>
#include <QPushButton>
#include <QDialogButtonBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QString>
#include <QGroupBox>

// common
#include "government.h"

// client
#include "client_main.h"

extern "C" {
#include "ratesdlg_g.h"
}

****
 * Dialog used to change tax rates
 *************************************************************************/
class tax_rates_dialog: public  QDialog
{
Q_OBJECT

  public:
  tax_rates_dialog(QWidget *parent = 0);
  int tax;
  int sci;
  int lux;

private:
  QLabel *some_label;
  QLabel *tax_label;
  QLabel *sci_label;
  QLabel *lux_label;
  QCheckBox *tax_checkbox;
  QCheckBox *sci_checkbox;
  QCheckBox *lux_checkbox;
  QSlider *tax_slider;
  QSlider *sci_slider;
  QSlider *lux_slider;
  QDialogButtonBox *button_box;
  QPushButton *cancel_button;
  QPushButton *ok_button;
  void check(QString);
private slots:
  void slot_set_value(int i);
  void slot_ok_button_pressed();
  void slot_cancel_button_pressed();
};
 ENDREP
DELTA 19259 34285 2183
SVN  ´MÉ!›] G  …0H€X R›  S‡,« „^ˆ|€‚u Y¨ – u¨{ [!€ [¨  ‚” €( [¨  ƒ—d€‚ [¨  ‚R›Y€N T¨  ¢> 8 &€ T¨ ¬ `œ   £V€+ q¨  x¨x L©w€„^ ƒ.¨ €„: T¨  ‚=¬€‚V Y¨  ƒh°V€‚c<QFontMetrics>

// qt-client
#include "canvas.h"
#include "sprite.h"
#include "colors.h"store->map_pixmap = QPixmap(width, height);                     int src_x, int src_y, int dest_x, int dest_y, int width,
                     int height)
{

  QRectF source_rect(src_x, src_y, width, height);
  QRectF dest_rect(dest_x, dest_y, width, height);
  QPainter p;

  if (!width || !height) {
    return;
  }

  p.begin(&dest->map_pixmap);
  p.drawPixmap(dest_rect, src->map_pixmap, source_rect);
  p.end();
some or all of a spritPainter p;

  p.begin(&pcanvas->map_pixmap);
  p.drawPixmap(canvas_x, canvas_y, *sprite->pm, offset_x, offset_y, width, height);
  p.end();int width, height;

  get_sprite_dimensions(sprite, &width, &height);
  canvas_put_sprite(pcanvas, canvas_x, canvas_y, sprite,
                    0, 0, width, height);QPainter p;

  /* no idea where its drawn so lets keep CompositionMode_Multiply
   * to see where it is really used */
  p.begin(&pcanvas->map_pixmap);
  p.setCompositionMode(QPainter::CompositionMode_Multiply);
  p.drawPixmap(canvas_x, canvas_y, *psprite->pm);
  p.end();
  QBrush brush(pcolor->qcolor);
  QPen pen(pcolor->qcolor);
  QPainter p;

  p.begin(&pcanvas->map_pixmap);
  p.setPen(pen);
  p.setBrush(brush);
  p.drawRect(canvas_x, canvas_y, width, height);
  p.end();int width, height;

  get_sprite_dimensions(psprite, &width, &height);
  qtg_canvas_put_rectangle(pcanvas, pcolor, canvas_x, canvas_y, width, height);Fill the area covered by the sprite with fogQPainter p;

  p.begin(&pcanvas->map_pixmap);
  p.setCompositionMode(QPainter::CompositionMode_DestinationIn);
  p.drawPixmap(canvas_x, canvas_y, *psprite->pm);
  p.end();enum line_type ltype, int start_x, int start_y,
                         int dx, int dy)
{
  QPen pen;
  QPainter p;

  pen.setColor(pcolor->qcolor);

  switch (ltype) {
  case LINE_NORMAL:
    pen.setWidth(1);
    break;
  case LINE_BORDER:
    pen.setStyle(Qt::DashLine);
    pen.setDashOffset(4);
    pen.setWidth(2);
    break;
  case LINE_TILE_FRAME:
    pen.setWidth(2);
    break;
  case LINE_GOTO:
    pen.setWidth(2);
    break;
  default:
    pen.setWidth(1);
    break;
  }

  p.begin(&pcanvas->map_pixmap);
  p.setPen(pen);
  p.drawLine(start_x, start_y, start_x + dx, start_y + dy);
  p.end();QPen pen;
  pen.setColor(pcolor->qcolor);
  QPainter p;

  switch (ltype) {
  case LINE_NORMAL:
    pen.setWidth(1);
    break;
  case LINE_BORDER:
    pen.setStyle(Qt::DashLine);
    pen.setDashOffset(4);
    pen.setWidth(2);
    break;
  case LINE_TILE_FRAME:
    pen.setWidth(2);
    break;
  case LINE_GOTO:
    pen.setWidth(2);
    break;
  default:
    pen.setWidth(1);
    break;
  }

  p.begin(&pcanvas->map_pixmap);
  p.setPen(pen);
  // what curve ?
  //p.drawArc(start_x,start_y,dx,dy); ?
  p.drawLine(start_x, start_y, start_x + dx, start_y + dy);
  p.end(); (int *width, int *height,
                        enum client_font font, const char *text)
{
  /* FIXME -> add font handling */
  QFont afont;
  int fontheight = 12;
  afont.setPixelSize(fontheight);
  QFontMetrics fm(afont);

  if (width) {
    *width = fm.width(QString::fromUtf8(text));
  }

  if (height) {
    *height = fm.height();
  }QPainter p;
  QPen pen;
  QFont afont;
  int fontheight = 12;
  QColor color(pcolor->qcolor);

  pen.setColor(color);
  afont.setPixelSize(fontheight);

  p.begin(&pcanvas->map_pixmap);
  p.setPen(pen);
  p.setFont(afont);
  p.drawText(canvas_x, canvas_y + fontheight, QString::fromUtf8(text));
  p.end();
  /* FIXME */ /*ADD DIFFERENT FONT HANDLING */
}
ENDREP
DELTA 18893 15743 605
SVN  †(š"’ G  …H€ƒq G €Z G €‚> G €ƒ6 G €†S// In this case we have to include fc_config.h from header file.
// Some other headers we include demand that fc_config.h must be
// included also. Usually all source files include fc_config.h, but
// there's moc generated meta_mapview.cpp file which does not.
#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

extern "C" {
#include "mapview_g.h"
}

// Qt
#include <QQueue>
#include <QObject>
#include <QTimer>
#include <QWidget>
#include <QPushButton>
#include <QHBoxLayout>
#include <QLabel>

****
  Struct used for idle callback to execute some callbacks later
**************************************************************************/
struct call_me_back {
  void (*callback) (void *data);
  void *data;
};

****
  Class to handle idle callbacks
**************************************************************************/
class mr_idle : public QObject
{
  Q_OBJECT
public:
  mr_idle();
  void add_callback(call_me_back* cb);
  QQueue<call_me_back*> callback_list;
private slots:
  void idling();
private:
  QTimer timer;
};

****
  QWidget used for displaying map
**************************************************************************/
class map_view : public QWidget
{
public:
  map_view();
  void paint(QPainter *painter, QPaintEvent *event);

protected:
  void paintEvent(QPaintEvent *event);
  void keyPressEvent(QKeyEvent * event);
  void resizeEvent(QResizeEvent * event);
  void mousePressEvent(QMouseEvent *event);

private:
  QBrush background;

};

****
  Information label about civilization, turn, time etc
**************************************************************************/
class info_label : public QLabel
{
  Q_OBJECT
  QHBoxLayout* layout;

  QLabel* turn_info;
  QLabel* time_label;
  QLabel* indicator_icons;
  QLabel* eco_info;

public:
  info_label();
  void set_turn_info(QString);
  void set_time_info(QString);
  void set_eco_info(QString);
  void set_indicator_icons(QPixmap*, QPixmap*, QPixmap*, QPixmap*);
  QPushButton* end_turn_button;
  QSize sizeHint() const;
  QLabel* rates_label;

private:

private slots:
  void slot_end_turn_done_button();
};


void mapview_freeze(void);
void mapview_thaw(void);
bool mapview_is_frozen(void);
void pixmap_put_overlay_tile(int canvas_x, int  canvas_y,
                             struct sprite *ssprite);

#endif /* FC__MAPVIEW_H */
ENDREP
DELTA 18893 16361 603
SVN  †$‡E
< G  …BH€<// Qt
#include <QPixmap>

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

struct canvas {
  QPixmap map_pixmap;
};

struct canvas *qtg_canvas_create(int width, int height);

#endif /* FC__CANVAS_H */
ENDREP
DELTA 21126 1285 273
SVN  Â!Â;
 …p • ¼6…kQt
#include <QDialog>ENDREP
DELTA 18984 0 832
SVN  Œ#ÝLo¼ G  …H€I G • K† €Q ƒ`ˆ1€„8 G ¥ K† €_ G » K† € G ± K† €†z G ¥ K† €C G § K† €N G ¤ K† €J G £ K† €1 G ž K† €‚( G ’ K† ¯ G ¥ K† €{ G £ K† €z G § K† € G ¤ K† €~ G £ K† €s G ¦ K† €‚C G ¸ K† €0 G ³ K† €6 G ª K† €D G ® K† €ƒ# G ¯ K† €?fc_config.h>
#endif

#include "fc_client.h"

extern QApplication *qapp;

******
  Constructor
*/
fc_client::fc_client() : QObject()
{
  main_window = new QMainWindow;
  central_wdg = new QWidget;
  central_layout = new QGridLayout;

  // General part not related to any single page
  observer_mode =  false;
  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(tr(_("Welcome to Freeciv")));

  // 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();
  map_canvas_resized (MAPVIEW_WIDTH, MAPVIEW_HEIGHT);
  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]);
  dock_widget[ (int) MESSAGE_DOCK_WIDGET]->hide(
  qRegisterMetaType<QTextCursor> ("QTextCursor");

  real_output_window_append(_("This is Qt-client for Freeciv."), NULL, -1);
  chat_welcome_message();

  real_output_window_append(_("In this early Qt-client development phase "
                              "the only way to connect server is via"
                              "commandline autoconnect parameter \"-a\""),
                            NULL, -1);

  set_client_state(C_S_DISCONNECTED);

  startTimer(TIMER_INTERVAL);
  qapp->exec();

  free_mapcanvas_and_overview();
  tileset_free_tiles(tileset);
}

******
  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.
*/
void fc_client::switch_page(enum client_pages new_page)
{
  bool chat_old_act;
  bool chat_new_act;

  main_window->menuBar()->setVisible(false);
  chat_old_act = chat_active_on_page(page);
  chat_new_act = chat_active_on_page(new_page);

  if (chat_new_act && !chat_old_act) {
    chat_line->setReadOnly(false);
  }

  if (!chat_new_act && chat_old_act) {
    chat_line->setReadOnly(true);
  }

  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;

  if (page == PAGE_START) {
    show_dock_widget( (int) OUTPUT_DOCK_WIDGET);
  }

  if (page == PAGE_GAME) {
    main_window->menuBar()->setVisible(true);
    show_dock_widget( (int) MESSAGE_DOCK_WIDGET);
    show_dock_widget( (int) OUTPUT_DOCK_WIDGET);
    mapview_wdg->setFocus();
  }
}

******
  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();
}

******
 * Switchs page to PAGE_MAIN
 /
void fc_client::slot_switch_to_main_page()
{
  switch_page(PAGE_MAIN);
  show_dock_widget( (int) OUTPUT_DOCK_WIDGET);
}

******
  Switchs page to PAGE_LOAD
*/
void fc_client::slot_switch_to_load_page()
{
  update_load_page();
  switch_page(PAGE_LOAD);
  hide_dock_widgets();
}

******
  Switchs page to PAGE_SCENARIO
*/
void fc_client::slot_switch_to_scenario_page()
{
  update_scenarios_page();
  switch_page(PAGE_SCENARIO);
  hide_dock_widgets();
}

******
  Switchs page to PAGE_START
*/
void fc_client::slot_switch_to_start_page()
{
  switch_page(PAGE_START);
  show_dock_widget( (int) OUTPUT_DOCK_WIDGET);
}

******
  Switchs page to PAGE_GAME
*/
void fc_client::slot_switch_to_game_page()
{
  switch_page(PAGE_GAME);
  show_dock_widget( (int) OUTPUT_DOCK_WIDGET);
  show_dock_widget( (int) MESSAGE_DOCK_WIDGET);
  main_window->menuBar()->setVisible(true);
  mapview_wdg->setFocus();
}

******
  Switchs page to PAGE_NETWORK
*/
void fc_client::slot_switch_to_network_page()
{
  char buf[256];

  switch_page(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);
}

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

  switch_page(PAGE_MAIN);
  show_dock_widget( (int) OUTPUT_DOCK_WIDGET);
}

******
  User clicked Observe button in START_PAGE
*/
void fc_client::slot_pregame_observe()
{
  if (observer_mode == false) {
    send_chat("/observe");
  } else {
    send_chat("/take -");
  }

  observer_mode = !observer_mode;
}

******
  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);
      }
    }
  }
}

******
  Called when map view has been resized
*/
void map_view::resizeEvent(QResizeEvent* event)
{
  QSize size;

  size = event->size();

  if (C_S_RUNNING == client_state()) {
    map_canvas_resized(size.width(), size.height());
  }
}
ENDREP
DELTA 18893 5419 1067
SVN  0! G  …Hƒ l…XŒ ‚S†9· `‰;€Q G  „-‹fc_fc_client.h"qtg_real_output_window_append(const char *astring,
        int conn_id)
{
  gui()->append_output_window(QString::fromUtf8(astring));
}

ENDREP
DELTA 20572 48 1161
SVN  ËÔ6i‰4 G  †H” †G€ 
ˆS€h Mš? ˆjŠ(Ÿ Q–= ‚”€‚ ¡–%€ V–= x¼>“ S–@ x¼>‹ S–@ ŽT¼> Nš@€@ U¬=  Wœ?€H N¬?€#include <QScrollBar#include "tilespec.h"
#include "sprite.h"

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


static QApplication *qapp;
static fc_client *freeciv_qt;static QPixmap *unit_pixmap;

void reset_unit_table(void);
static void populate_unit_pixmap_table(void);  return client_main(argc, argvQPixmap *qpm = new QPixmap;
  tileset_init(tileset);
  tileset_load_tiles(tileset);
  populate_unit_pixmap_table();
  qpm = get_icon_sprite(tileset, ICON_FREECIV)->pm;
  QIcon app_icon;
  app_icon = ::QIcon(*qpm);
  qapp->setWindowIcon(app_icon);
  freeciv_qt = new fc_client();call_me_back *cb= new call_me_back; /* removed in mr_idler:idling() */
  cb->callback = callback;
  cb->data = data;
  gui()->mr_idler.add_callback(cbtileset_changed()
{refresh()
{ Called when the tileset is changed to reset the unit pixmap tabreset_unit_table(void)
{
 /* FIXCalled to build the unit_below pixmap table.  This is the table on the
  left of the screen that shows all of the inactive units in the current
  tile.

  It may be called again if the tileset changesstatic void populate_unit_pixmap_table(void)
{
  unit_pixmap = new QPixmap(tileset_unit_width(tileset), tileset_unit_height(tileset));
}ENDREP
DELTA 21274 892 128
SVN  ŠZ‹
6 ƒ ¶ ‡Wƒ	\
	meta_ratesdlg.cpp	\
	meta_mapview.cpp	\
	meta_menuENDREP
DELTA 19289 1082 808
SVN  ŒA¨* V G  …%H€„ o†4€œR x‹IŒ@In this case we have to include fc_config.h from header file.
// Some other headers we include demand that fc_config.h must be
// included also. Usually all source files include fc_config.h, but
// there's moc generated meta_fc_client.cpp file which does not.
#ifdef HAVE_CONFIG_H
#include <fc_config.h>
#endif

// client
#include "chatline_common.h"
#include "client_main.h"
#include "clinet.h"
#include "mapview_common.h"
#include "tilespec.h"

// Qt
#include <QApplication>
#include <QLineEdit>
#include <QDialog#include <QTableWidget>
#include <QLabel>
#include <QTimer>

// common
#include "packets.h"

// client
#include "chatline_common.h"
#include "client_main.h"
#include "clinet.h"
#include "mapview_common.h"
#include "servers.h"
#include "tilespec.h"

// gui-qt
#include "pages.h"
#include "mapview.h"
#include "menu.h"
#include "canvas.h"
#include "ratesdlg.h"
#include "chatline.h"

// Layout
const int MAPVIEW_X = 0;
const int MAPVIEW_Y = 0;
const int TOTAL_WIDTH = 500;
const int MAPVIEW_WIDTH = TOTAL_WIDTH;
const int MAPVIEW_HEIGHT = 600;

enum connection_state {
  LOGIN_TYPE,
  NEW_PASSWORD_TYPE,
  ENTER_PASSWORD_TYPE,
  WAITING_TYPE
};


enum DOCK_WIDGETS {
  OUTPUT_DOCK_WIDGET = 0,
  MESSAGE_DOCK_WIDGET,
  /* ADD NEXT DOCK WIDGETS HERE */
  LAST_WIDGET
};

class MainWindow;

class fc_client : public QObject
{
  Q_OBJECT

  QMainWindow *main_window;
  QWidget *main_wdg;
  QWidget *pages[ (int) PAGE_GGZ + 1];
  QWidget *connect_lan;
  QWidget *connect_metaserver;

  QGridLayout *central_layout;
  QGridLayout *pages_layout[PAGE_GGZ + 1];

  QTextEdit *output_window;
  QTextEdit *scenarios_view;

  QLineEdit *connect_host_edit;
  QLineEdit *connect_port_edit;
  QLineEdit *connect_login_edit;
  QLineEdit *connect_password_edit;
  QLineEdit *connect_confirm_password_edit;

  QPushButton *button;

  QDialogButtonBox* button_box;

  QSocketNotifier *server_notifier;

  QLineEdit *chat_line;

  QTabWidget *connect_tab_widget;

  QTableWidget* lan_widget;
  QTableWidget* wan_widget;
  QTableWidget* info_widget;
  QTableWidget* saves_load;
  QTableWidget* scenarios_load;
  QTableWidget* start_players;

  QTimer* meta_scan_timer;
  QTimer* lan_scan_timer;

  QDockWidget *dock_widget[ (int) LAST_WIDGET ];
  QStatusBar *status_bar;
  QLabel *status_bar_label;

  mr_menu* menu_bar;

public:
  fc_client();
  ~fc_client();

  void main(QApplication *);
  map_view* mapview_wdg;
  void add_server_source(int);

  void switch_page(enum client_pages);
  enum client_pages current_page();

  void append_output_window(const QString &);
  void set_status_bar(QString);

  mr_idle mr_idler;
  QTableWidget *messages_window;
  info_label *game_info_label;
  QWidget *central_wdg;

private slots:

  void server_input(int sock);
  void chat();
  void quit();
  void slot_switch_to_main_page();
  void slot_switch_to_network_page();
  void slot_switch_to_load_page();
  void slot_switch_to_scenario_page();
  void slot_switch_to_start_page();
  void slot_switch_to_game_page();
  void slot_lan_scan();
  void slot_meta_scan();
  void slot_connect();
  void slot_disconnect();
  void slot_pregame_observe();
  void slot_pregame_start();
  void update_network_lists();

protected slots:

  void slot_selection_changed(const QItemSelection&, const QItemSelection&);

private:

  void create_main_page();
  void create_network_page();
  void create_load_page();
  void create_scenario_page();
  void create_start_page();
  void create_game_page();
  bool chat_active_on_page(enum client_pages);
  void show_children(const QLayout*, bool);
  void destroy_server_scans (void);
  void update_server_list(enum server_scan_type,
                           const struct server_list *);
  bool check_server_scan (server_scan*);
  void create_dock_widgets();
  void hide_dock_widgets();
  void show_dock_widget(int);
  void update_load_page(void);
  void update_scenarios_page(void);
  void set_connection_state(enum connection_state state);
  void handle_authentication_req(
    enum authentication_type type, const char *message);


  enum client_pages page;
  bool observer_mode;

protected:
  void timerEvent(QTimerEvent *);


signals:
  void keyCaught(QKeyEvent *e);

ENDREP
DELTA 18893 39258 998
SVN  .ì‚5Äa G  …H€l G  †]€R G  „ˆ€C G ž Eˆ@¸ G ³ Eˆ@€9 G ­ Eˆ@€‡ G ¶ Eˆ@€¨8 G ¤ Eˆ@€d G €F Eˆ@€‚  G ³ Eˆ@€ŠJ G ¹ Eˆ@€‹ G ´ Eˆ@€‹\ G ³ Eˆ@€„W G €F Eˆ@€Œ} G €G Eˆ@€ƒ' G ž Eˆ@€ƒ G ½ Eˆ@€ƒ G €A Eˆ@€…( G ¢ Eˆ@€L G © Eˆ@€O G ¹ Eˆ@€… G œ Eˆ@€s G Ÿ Eˆ@€ G ž Eˆ@€4 G €D Eˆ@€…Q G €K Eˆ@€„i G €e Eˆ@€‡ G €. Eˆ@€‹kfc_config.h>
#endif

#include "pages.h"

Q_DECLARE_METATYPE (QDockWidget::DockWidgetFeatures)
static struct server_scan *meta_scan, *lan_scan;
static bool holding_srv_list_mutex = false;
static enum connection_state connection_status;

qtg_real_set_client_page(enum client_pages page)
{
  gui()->switch_page(page);
}

qtg_get_current_client_page()
{
  return gui()->current_page();
}

****
  update the start page.
*****/
void update_start_page(void)
{
  /* PORTME */
}

****
  Creates buttons and layouts for start page.
*****/
void fc_client::create_main_page(void)
{

  QPixmap main_graphics(tileset_main_intro_filename(tileset));
  QLabel* free_main_pic = new QLabel;
  pages_layout[PAGE_MAIN] = new QGridLayout;
  QStringList buttons_names;
  int buttons_nr;

  free_main_pic->setPixmap(main_graphics);
  pages_layout[PAGE_MAIN]->addWidget(free_main_pic,
                                     0, 0, 1, 2, Qt::AlignCenter);
  buttons_names << tr(_("Start new game")) << tr(_("Start scenario game"))
                << tr(_("Load saved game")) << tr(_("Connect to network game"))
                << tr(_("Options")) << tr(_("Quit"));

  buttons_nr = buttons_names.count();

  for (int iter = 0; iter < buttons_nr; iter++) {
    button = new QPushButton(buttons_names[iter]);

    switch (iter) {
    case 0:
      pages_layout[PAGE_MAIN]->addWidget(button, 1, 0);
      break;
    case 1:
      pages_layout[PAGE_MAIN]->addWidget(button, 2, 0);
      QObject::connect(button, SIGNAL(clicked()), this,
                       SLOT(slot_switch_to_scenario_page()));
      break;
    case 2:
      pages_layout[PAGE_MAIN]->addWidget(button, 3, 0);
      QObject::connect(button, SIGNAL(clicked()), this,
                       SLOT(slot_switch_to_load_page()));
      break;
    case 3:
      pages_layout[PAGE_MAIN]->addWidget(button, 1, 1);
      QObject::connect(button, SIGNAL(clicked()), this,
                       SLOT(slot_switch_to_network_page()));
      break;
    case 4:
      pages_layout[PAGE_MAIN]->addWidget(button, 2, 1);
      break;
    case 5:
      pages_layout[PAGE_MAIN]->addWidget(button, 3, 1);
      QObject::connect(button, SIGNAL(clicked()), this, SLOT(quit()));
      break;
    default:
      break;
    }
  }
}

****
  Update network page connection state.
*****/
void fc_client::set_connection_state(enum connection_state state)
{
  switch (state) {
  case LOGIN_TYPE:
    set_status_bar("");
    connect_password_edit->setText("");
    connect_confirm_password_edit->setText("");
    connect_confirm_password_edit->setReadOnly(true);
    break;
  case NEW_PASSWORD_TYPE:
    connect_password_edit->setText("");
    connect_confirm_password_edit->setText("");
    connect_confirm_password_edit->setReadOnly(false);
    connect_password_edit->setFocus(Qt::OtherFocusReason);
    break;
  case ENTER_PASSWORD_TYPE:
    connect_password_edit->setText("");
    connect_confirm_password_edit->setText("");
    connect_confirm_password_edit->setReadOnly(true);
    connect_password_edit->setFocus(Qt::OtherFocusReason);


    break;
  case WAITING_TYPE:
    set_status_bar("");
    connect_confirm_password_edit->setReadOnly(true);

    break;
  }

  connection_status = state;
}

*****
  Creates buttons and layouts for network page.
******/
void fc_client::create_network_page(void)
{
  pages_layout[PAGE_NETWORK] = new QGridLayout;
  QVBoxLayout *page_network_layout = new QVBoxLayout;
  QGridLayout *page_network_grid_layout = new QGridLayout;
  QHBoxLayout *page_network_lan_layout = new QHBoxLayout;
  QHBoxLayout *page_network_wan_layout = new QHBoxLayout;


  connect_host_edit = new QLineEdit;
  connect_port_edit = new QLineEdit;
  connect_login_edit = new QLineEdit;
  connect_password_edit = new QLineEdit;
  connect_confirm_password_edit = new QLineEdit;

  connect_password_edit->setEchoMode(QLineEdit::Password);
  connect_confirm_password_edit->setEchoMode(QLineEdit::Password);

  connect_password_edit->setPlaceholderText("*****");
  connect_confirm_password_edit->setPlaceholderText("*****");
  connect_confirm_password_edit->setReadOnly (true);
  connect_tab_widget = new QTabWidget;
  connect_lan = new QWidget;
  connect_metaserver = new QWidget;
  lan_widget = new QTableWidget;
  wan_widget = new QTableWidget;
  info_widget = new QTableWidget;

  QStringList servers_list;
  servers_list << _("Server Name") << _("Port") << _("Version")
               << _("Status") << _("Players") << _("Comment");
  QStringList server_info;
  server_info << _("Name") << _("Type") << _("Host") << _("Nation");

  lan_widget->setRowCount(0);
  lan_widget->setColumnCount(servers_list.count());
  lan_widget->verticalHeader()->setVisible(false);

  wan_widget->setRowCount(0);
  wan_widget->setColumnCount(servers_list.count());
  wan_widget->verticalHeader()->setVisible(false);

  info_widget->setRowCount(0);
  info_widget->setColumnCount(server_info.count());
  info_widget->verticalHeader()->setVisible(false);

  lan_widget->setHorizontalHeaderLabels(servers_list);
  lan_widget->setProperty("showGrid", "false");
  lan_widget->setProperty("selectionBehavior", "SelectRows");
  lan_widget->setEditTriggers(QAbstractItemView::NoEditTriggers);

  connect(lan_widget->selectionModel(),
          SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this,
          SLOT(slot_selection_changed(const QItemSelection &, const QItemSelection &)));

  wan_widget->setHorizontalHeaderLabels(servers_list);
  wan_widget->setProperty("showGrid", "false");
  wan_widget->setProperty("selectionBehavior", "SelectRows");
  wan_widget->setEditTriggers(QAbstractItemView::NoEditTriggers);

  connect(wan_widget->selectionModel(),
          SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this,
          SLOT(slot_selection_changed(const QItemSelection &, const QItemSelection &)));

  info_widget->setHorizontalHeaderLabels(server_info);
  info_widget->setProperty("selectionBehavior", "SelectRows");
  info_widget->setEditTriggers(QAbstractItemView::NoEditTriggers);

  QHeaderView *header;
  header = lan_widget->horizontalHeader();
  header->resizeSections(QHeaderView::Stretch);
  header = wan_widget->horizontalHeader();
  header->resizeSections(QHeaderView::Stretch);

  QLabel *connect_msg;
  QStringList label_names;
  label_names << tr(_("Connect")) << tr(_("Port")) << tr(_("Login"))
              << tr(_("Password")) << tr(_("Confirm Password"));
  connect_msg = new QLabel;

  for (int i = 0; i < label_names.count(); i++) {
    connect_msg = new QLabel;
    connect_msg->setText(label_names[i]);
    page_network_grid_layout->addWidget(connect_msg, i, 0, Qt::AlignHCenter);
  }

  page_network_grid_layout->addWidget(connect_host_edit, 0, 1);
  page_network_grid_layout->addWidget(connect_port_edit, 1, 1);
  page_network_grid_layout->addWidget(connect_login_edit, 2, 1);
  page_network_grid_layout->addWidget(connect_password_edit, 3, 1);
  page_network_grid_layout->addWidget(connect_confirm_password_edit, 4, 1);

  page_network_grid_layout->addWidget(info_widget, 0, 2, 5, 4);

  QPushButton *network_button = new QPushButton;
  network_button->setText(tr(_("&Refresh")));
  QObject::connect(network_button, SIGNAL(clicked()), this,
                   SLOT(update_network_lists()));
  page_network_grid_layout->addWidget(network_button, 5, 0);

  network_button = new QPushButton;
  network_button->setText(tr(_("&Cancel")));
  QObject::connect(network_button, SIGNAL(clicked()), this,
                   SLOT(slot_switch_to_main_page()));
  page_network_grid_layout->addWidget(network_button, 5, 2, 1, 1);

  network_button = new QPushButton;
  network_button->setText(tr(_("&Connect")));
  page_network_grid_layout->addWidget(network_button, 5, 5, 1, 1);
  QObject::connect(network_button, SIGNAL(clicked()), this,
                   SLOT(slot_connect()));

  connect_lan->setLayout(page_network_lan_layout);
  connect_metaserver->setLayout(page_network_wan_layout);
  page_network_lan_layout->addWidget(lan_widget, 1);
  page_network_wan_layout->addWidget(wan_widget, 1);
  page_network_layout->addWidget(connect_tab_widget, 1);
  connect_tab_widget->addTab(connect_lan, _("LAN"));
  connect_tab_widget->addTab(connect_metaserver, _("NETWORK"));
  page_network_grid_layout->setColumnStretch(3, 4);
  pages_layout[PAGE_NETWORK]->addLayout(page_network_layout, 1, 1);
  pages_layout[PAGE_NETWORK]->addLayout(page_network_grid_layout, 2, 1);

}

*****
  Sets application status bar
******/
void fc_client::set_status_bar(QString message)
{
  status_bar_label->setText (message);
}

*****
  Creates context menu in TableView when clicked on some player
******/
void create_conn_menu(struct player *pplayer, struct connection *pconn)
{
  /* FIXME */
  char buf[128];
  fc_snprintf(buf, sizeof(buf), _("%s info"),
              pconn ? pconn->username : player_name(pplayer));

  if (NULL != pplayer) {

  }
}

*****
  Creates buttons and layouts for load page.
******/
void fc_client::create_load_page()
{
  pages_layout[PAGE_LOAD] = new QGridLayout;
  QPushButton *but;

  saves_load = new QTableWidget;

  QStringList sav;
  sav << tr(_("Choose Saved Game to Load")) << tr(_("Time"));

  saves_load->setRowCount (0);
  saves_load->setColumnCount (sav.count());
  saves_load->setHorizontalHeaderLabels (sav);

  saves_load->setProperty("showGrid", "false");
  saves_load->setProperty("selectionBehavior", "SelectRows");
  saves_load->setEditTriggers(QAbstractItemView::NoEditTriggers);

  connect(saves_load->selectionModel(),
          SIGNAL(selectionChanged(const QItemSelection &, const QItemSelection &)), this,
          SLOT(slot_selection_changed(const QItemSelection &, const QItemSelection &)));

  QHeaderView *header;
  header = saves_load->horizontalHeader();
  header->resizeSections(QHeaderView::Stretch);

  pages_layout[PAGE_LOAD]->addWidget(saves_load, 0, 0, 1, 4);

  but = new QPushButton;
  but->setText(tr(_("Browse")));
  pages_layout[PAGE_LOAD]->addWidget (but, 1, 0);

  but = new QPushButton;
  but->setText(tr(_("Cancel")));
  QObject::connect(but, SIGNAL(clicked()), this,
                   SLOT(slot_switch_to_main_page()));
  pages_layout[PAGE_LOAD]->addWidget(but, 1, 2);

  but = new QPushButton;
  but->setText(tr(_("Load")));
  pages_layout[PAGE_LOAD]->addWidget(but, 1, 3);

}

*****
 * Creates buttons and layouts for scenario page.
 *****/
void fc_client::create_scenario_page()
{
  pages_layout[PAGE_SCENARIO] = new QGridLayout;
  QPushButton *but;

  scenarios_load = new QTableWidget;
  scenarios_view = new QTextEdit;
  QStringList sav;
  QSpacerItem *free_space = new QSpacerItem(50, 100);
  sav << tr(_("Choose a Scenario"));
  scenarios_load->setRowCount(0);
  scenarios_load->setColumnCount(sav.count());
  scenarios_load->setHorizontalHeaderLabels(sav);
  scenarios_load->setProperty("showGrid", "false");
  scenarios_load->setProperty("selectionBehavior", "SelectRows");
  scenarios_load->setEditTriggers(QAbstractItemView::NoEditTriggers);
  pages_layout[PAGE_SCENARIO]->addWidget(scenarios_load, 0, 0, 1, 2);
  pages_layout[PAGE_SCENARIO]->addWidget(scenarios_view, 0, 3, 1, 2);
  pages_layout[PAGE_SCENARIO]->addItem(free_space, 1, 0);
  scenarios_view->setReadOnly(true);

  QHeaderView *header;
  header = scenarios_load->horizontalHeader();
  header->resizeSections(QHeaderView::ResizeToContents);

  but = new QPushButton;
  but->setText(tr(_("Browse")));
  pages_layout[PAGE_SCENARIO]->addWidget (but, 2, 0);

  but = new QPushButton;
  but->setText(tr(_("Cancel")));
  QObject::connect(but, SIGNAL(clicked()), this,
                   SLOT(slot_switch_to_main_page()));
  pages_layout[PAGE_SCENARIO]->addWidget(but, 2, 3);

  but = new QPushButton;
  but->setText(tr(_("Load")));
  pages_layout[PAGE_SCENARIO]->addWidget(but, 2, 4);
}

*****
  Creates buttons and layouts for start page.
******/
void fc_client::create_start_page()
{
  pages_layout[PAGE_START] = new QGridLayout;
  start_players = new QTableWidget;
  QStringList player_widget_list;

  player_widget_list << tr(_("Name")) << tr(_("Ready")) << tr(_("Leader"))
                     << tr(_("Flag")) << tr(_("Nation"));
  start_players->setRowCount(0);
  start_players->setColumnCount(player_widget_list.count());
  start_players->setHorizontalHeaderLabels(player_widget_list);
  QHeaderView *header;
  header = start_players->horizontalHeader();
  header->resizeSections(QHeaderView::ResizeToContents);
  QPushButton *but;
  but = new QPushButton;
  but->setText(tr(_("More Game Options")));
  pages_layout[PAGE_START]->addWidget(but, 6, 0);
  pages_layout[PAGE_START]->addWidget(start_players, 0, 0, 5, 4);
  but = new QPushButton;
  but->setText(tr(_("Disconnect")));
  QObject::connect(but, SIGNAL(clicked()), this, SLOT(slot_disconnect()));
  pages_layout[PAGE_START]->addWidget(but, 7, 0);
  but = new QPushButton;
  but->setText(tr(_("Pick Nation")));
  pages_layout[PAGE_START]->addWidget(but, 7, 1);
  but = new QPushButton;
  but->setText(tr(_("Observe")));
  pages_layout[PAGE_START]->addWidget(but, 7, 2);
  QObject::connect(but, SIGNAL(clicked()), this,
                   SLOT(slot_pregame_observe()));
  but = new QPushButton;
  but->setText(tr(_("Start")));
  pages_layout[PAGE_START]->addWidget(but, 7, 3);
  QObject::connect(but, SIGNAL(clicked()), this,
                   SLOT(slot_pregame_start()));
}

*****
  Creates buttons and layouts for game page.
******/
void fc_client::create_game_page()
{
  pages_layout[PAGE_GAME] = new QGridLayout;

  mapview_wdg = new map_view();
  mapview_wdg->setFocusPolicy(Qt::WheelFocus);

  game_info_label = new info_label;
  QSizePolicy game_info_label_policy;
  game_info_label_policy.setHorizontalPolicy(QSizePolicy::Expanding);
  game_info_label_policy.setVerticalPolicy(QSizePolicy::Fixed);
  game_info_label->setSizePolicy(game_info_label_policy);
  mapview_wdg->setMinimumSize(600, 400);
  pages_layout[PAGE_GAME]->addWidget(mapview_wdg, 1, 0);
  pages_layout[PAGE_GAME]->addWidget(game_info_label, 2, 0);
}

*****
  Updates list of servers in network page in proper QTableViews
******/
void fc_client::update_server_list(enum server_scan_type sstype,
                                   const struct server_list *list)
{
  QTableWidget* sel = NULL;
  QString host, portstr;
  int port;

  switch (sstype) {
  case SERVER_SCAN_LOCAL:
    sel = lan_widget;
    break;
  case SERVER_SCAN_GLOBAL:
    sel = wan_widget;
    break;
  default:
    break;
  }

  if (!sel) {
    return;
  }

  if (!list) {
    return;
  }

  host = connect_host_edit->text();
  portstr = connect_port_edit->text();
  port = portstr.toInt();
  sel->clearContents();
  sel->setRowCount(0);
  int row = 0;
  server_list_iterate(list, pserver) {
    char buf[20];
    sel->insertRow(row);

    if (pserver->humans >= 0) {
      fc_snprintf(buf, sizeof(buf), "%d", pserver->humans);
    } else {
      strncpy(buf, _("Unknown"), sizeof(buf));
    }

    int tmp = pserver->port;
    QString tstring = QString::number(tmp);

    for (int col = 0; col < 6; col++) {
      QTableWidgetItem *item;
      item = new QTableWidgetItem();

      switch (col) {
      case 0:
        item->setText(pserver->host);
        break;
      case 1:
        item->setText(tstring);
        break;
      case 2:
        item->setText(pserver->version);
        break;
      case 3:
        item->setText(_(pserver->state));
        break;
      case 4:
        item->setText(buf);
        break;
      case 5:
        item->setText(pserver->message);
        break;
      default:
        break;
      }

      sel->setItem(row, col, item);
    }

    if (host == pserver->host && port == pserver->port) {
      sel->selectRow(row);
    }

    row++;
  }
  server_list_iterate_end;
}


****
  Callback function for when there's an error in the server scan.
*****/
void server_scan_error(struct server_scan *scan, const char *message)
{
  output_window_append(ftc_client, message);
  log_error("%s", message);

  switch (server_scan_get_type(scan)) {
  case SERVER_SCAN_LOCAL:
    server_scan_finish(lan_scan);
    lan_scan = NULL;
    break;
  case SERVER_SCAN_GLOBAL:
    server_scan_finish(meta_scan);
    meta_scan = NULL;
    break;
  case SERVER_SCAN_LAST:
    break;
  }
}

****
  Free the server scans.
*****/
void fc_client::destroy_server_scans(void)
{
  if (meta_scan) {
    server_scan_finish (meta_scan);
    meta_scan = NULL;
  }

  if (meta_scan_timer != 0) {
    meta_scan_timer->stop();
    meta_scan_timer = NULL;
  }

  if (lan_scan) {
    server_scan_finish(lan_scan);
    lan_scan = NULL;
  }

  if (lan_scan_timer != 0) {
    lan_scan_timer->stop();
    lan_scan_timer = NULL;
  }
}

****
  Stop and restart the metaserver and lan server scans.
*****/
void fc_client::update_network_lists(void)
{
  destroy_server_scans();

  lan_scan_timer = new QTimer(this);
  lan_scan = server_scan_begin(SERVER_SCAN_LOCAL, server_scan_error);
  connect(lan_scan_timer, SIGNAL(timeout()), this, SLOT(slot_lan_scan()));
  lan_scan_timer->start(500);

  meta_scan = server_scan_begin(SERVER_SCAN_GLOBAL, server_scan_error);
  meta_scan_timer = new QTimer(this);

}

****
  This function updates the list of servers every so often.
*****/
bool fc_client::check_server_scan(server_scan* data)
{
  struct server_scan *scan = data;
  enum server_scan_status stat;

  if (!scan) {
    return false;
  }

  stat = server_scan_poll(scan);

  if (stat >= SCAN_STATUS_PARTIAL) {
    enum server_scan_type type;
    struct srv_list *srvrs;

    type = server_scan_get_type(scan);
    srvrs = server_scan_get_list(scan);
    fc_allocate_mutex(&srvrs->mutex);
    holding_srv_list_mutex = true;
    update_server_list(type, srvrs->servers);
    holding_srv_list_mutex = false;
    fc_release_mutex(&srvrs->mutex);
  }

  if (stat == SCAN_STATUS_ERROR || stat == SCAN_STATUS_DONE) {
    return false;
  }

  return true;
}

*****
  Executes lan scan network
******/
void fc_client::slot_lan_scan()
{
  check_server_scan(lan_scan);
}

*****
  Executes metaserver scan network
******/
void fc_client::slot_meta_scan()
{
  check_server_scan (meta_scan);
}

*****
  Selection chnaged in some tableview on some page
******/
void fc_client::slot_selection_changed(const QItemSelection &selected,
                                       const QItemSelection &deselected)
{

  QModelIndexList indexes = selected.indexes();
  client_pages i = current_page();

  if (indexes.isEmpty()) {
    return;
  }

  QModelIndex index ;

  switch (i) {
  case PAGE_NETWORK:
    index = indexes.at(0);
    connect_host_edit->setText(index.data().toString());
    index = indexes.at(1);
    connect_port_edit->setText(index.data().toString());
    break;
  case PAGE_SCENARIO:
    index = indexes.at(0);
    scenarios_view->setText(index.data().toString());
    break;
  default:
    break;
  }

}
*****
  Create dock_widgets
******/
void fc_client::create_dock_widgets()
{
  int i;
  QVBoxLayout *h_box = new QVBoxLayout;
  QWidget *wi;

  output_window = new QTextEdit(central_wdg);
  chat_line = new QLineEdit(central_wdg);
  messages_window = new QTableWidget(central_wdg);
  messages_window->setRowCount(0);
  messages_window->setColumnCount(1);
  messages_window->setProperty("showGrid", "false");
  messages_window->setProperty("selectionBehavior", "SelectRows");
  messages_window->setEditTriggers(QAbstractItemView::NoEditTriggers);
  messages_window->verticalHeader()->setVisible(false);
  messages_window->horizontalHeader()->setVisible(false);
  QHeaderView *header;
  header = messages_window->horizontalHeader();
  header->resizeSections(QHeaderView::Interactive);
  output_window->setReadOnly(true);
  output_window->setVisible(true);
  chat_line->setVisible(true);
  connect(chat_line, SIGNAL(returnPressed()), this, SLOT(chat()));
  chat_line->setReadOnly(false);

  for (i = OUTPUT_DOCK_WIDGET ; i <  LAST_WIDGET; i++) {
    wi = new QWidget;
    dock_widget[i] = new QDockWidget;

    switch (i) {
    case 0: //CHAT WIDGET
      h_box->addWidget(output_window);
      h_box->addWidget(chat_line);
      wi->setLayout(h_box);
      dock_widget[i]->setWidget(wi);
      dock_widget[i]->setFeatures(QDockWidget::DockWidgetMovable
                                  | QDockWidget::DockWidgetFloatable);
      dock_widget[i]->setWindowTitle(_("Chat"));
      break;
    case 1: //MESSAGE_DOCK_WIDGET
      dock_widget[i]->setWidget(messages_window);
      dock_widget[i]->setFeatures(QDockWidget::DockWidgetMovable
                                  | QDockWidget::DockWidgetFloatable);
      dock_widget[i]->setWindowTitle(_("Messages"));
      break;
    default:
      break;
    }
  }
}

*****
  Hides ALL dock widgets
******/
void fc_client::hide_dock_widgets()
{
  int i;

  for (i = OUTPUT_DOCK_WIDGET ; i <  LAST_WIDGET; i++) {
    dock_widget[i]->hide();
  }
}

*****
  Shows one widget = dw
******/
void fc_client::show_dock_widget(int dw)
{
  int i;

  for (i = OUTPUT_DOCK_WIDGET ; i <  LAST_WIDGET; i++) {
    if (i == dw) {
      dock_widget[i]->show();
    }
  }
}

*****
  Updates saves to load and updates in tableview = saves_load
******/
void fc_client::update_load_page(void)
{
  struct fileinfo_list *files = fileinfolist_infix(get_save_dirs(),
                                                   ".sav", false);
  int row = 0;
  saves_load->clearContents();
  saves_load->setRowCount(0);
  fileinfo_list_iterate(files, pfile) {
    QTableWidgetItem *item;
    item = new QTableWidgetItem();
    saves_load->insertRow(row);
    item->setText(pfile->name);
    saves_load->setItem(row, 0, item);
    item = new QTableWidgetItem();
    QDateTime dt = QDateTime::fromTime_t(pfile->mtime);
    item->setText(dt.toString(Qt::TextDate));
    saves_load->setItem(row, 1, item);
    row++;
  }
  fileinfo_list_iterate_end;
  fileinfo_list_destroy(files);
}

*****
  Gets scenarios list and updates it in TableWidget = scenarios_load
******/
void fc_client::update_scenarios_page(void)
{
  struct fileinfo_list *files = fileinfolist_infix(get_scenario_dirs(),
                                                   ".sav", false);
  int row = 0;
  scenarios_load->clearContents();
  scenarios_load->setRowCount(0);
  fileinfo_list_iterate(files, pfile) {
    QTableWidgetItem *item;

    item = new QTableWidgetItem();
    scenarios_load->insertRow(row);
    item->setText(pfile->name);
    scenarios_load->setItem(row, 0, item);
    scenarios_view->setText(pfile->fullname);
    row++;
  }
  fileinfo_list_iterate_end;
  fileinfo_list_destroy(files);
}

****
  configure the dialog depending on what type of authentication request the
  server is making.
*****/
void fc_client::handle_authentication_req(enum authentication_type type,
                                          const char *message)
{
  set_status_bar(QString::fromUtf8(message));

  switch (type) {
  case AUTH_NEWUSER_FIRST:
  case AUTH_NEWUSER_RETRY:
    set_connection_state(NEW_PASSWORD_TYPE);
    return;
  case AUTH_LOGIN_FIRST:

    /* if we magically have a password already present in 'password'
     * then, use that and skip the password entry dialog */
    if (password[0] != '\0') {
      struct packet_authentication_reply reply;

      sz_strlcpy(reply.password, password);
      send_packet_authentication_reply(&client.conn, &reply);
      return;
    } else {
      set_connection_state(ENTER_PASSWORD_TYPE);
    }

    return;
  case AUTH_LOGIN_RETRY:
    set_connection_state(ENTER_PASSWORD_TYPE);
    return;
  }

  log_error("Unsupported authentication type %d: %s.", type, message);
}

****
  if on the network page, switch page to the login page (with new server
  and port). if on the login page, send connect and/or authentication
  requests to the server.
*****/
void fc_client::slot_connect()
{
  char errbuf [512];
  struct packet_authentication_reply reply;

  switch (connection_status) {
  case LOGIN_TYPE:
    sz_strlcpy(user_name, connect_login_edit->text().toLatin1().data());
    sz_strlcpy(server_host, connect_host_edit->text().toLatin1().data());
    server_port = atoi(connect_port_edit->text().toLatin1().data());

    if (connect_to_server(user_name, server_host, server_port,
                          errbuf, sizeof(errbuf)) != -1) {
    } else {
      set_status_bar(QString::fromUtf8(errbuf));
      output_window_append(ftc_client, errbuf);
    }

    return;
  case NEW_PASSWORD_TYPE:
    sz_strlcpy(password, connect_password_edit->text().toLatin1().data());
    sz_strlcpy(reply.password,
               connect_confirm_password_edit->text().toLatin1().data());

    if (strncmp(reply.password, password, MAX_LEN_NAME) == 0) {
      password[0] = '\0';
      send_packet_authentication_reply(&client.conn, &reply);
      set_connection_state(WAITING_TYPE);
    } else {
      set_status_bar(_("Passwords don't match, enter password."));
      set_connection_state(NEW_PASSWORD_TYPE);
    }

    return;
  case ENTER_PASSWORD_TYPE:
    sz_strlcpy(reply.password,
               connect_password_edit->text().toLatin1().data());
    send_packet_authentication_reply(&client.conn, &reply);
    set_connection_state(WAITING_TYPE);
    return;
  case WAITING_TYPE:
    return;
  }

  log_error("Unsupported connection status: %d", connection_status);
}
ENDREP
DELTA 18893 22758 913
SVN  ’a– ƒ/ G  …Hƒ k…X€ƒ G Ž ‰r Š.ˆ3fc_// client
#include "options.h"


#define SPECLIST_TAG option_dialog
#define SPECLIST_TYPE struct option_dialog
#include "speclist.h"
#define option_dialogs_iterate(pdialog) \
  TYPED_LIST_ITERATE(struct option_dialog, option_dialogs, pdialog)
#define option_dialogs_iterate_end  LIST_ITERATE_END

enum {
  RESPONSE_CANCEL,
  RESPONSE_OK,
  RESPONSE_APPLY,
  RESPONSE_RESET,
  RESPONSE_REFRESH,
  RESPONSE_SAVE
};

******
  PopupENDREP
id: 6ji.5ck.r21547/71907
type: file
pred: 6ji.5ck.r19313/4549
count: 4
text: 21547 45868 25509 30212 991e1011a8695ddc2dfa1f9e081f9b5e
cpath: /trunk/client/gui-qt/pages.cpp
copyroot: 15280 /trunk

id: 6je.5ck.r21547/72103
type: file
pred: 6je.5ck.r19259/507034
count: 2
text: 21547 0 763 2285 af27fb886226e6cd7467b90d63697930
cpath: /trunk/client/gui-qt/messagewin.cpp
copyroot: 15280 /trunk

id: 6ja.5ck.r21547/72299
type: file
pred: 6ja.5ck.r19259/507434
count: 2
text: 21547 3253 3412 6076 553c3e878f03c5ef90373dfc7153b12e
cpath: /trunk/client/gui-qt/menu.cpp
copyroot: 15280 /trunk

id: 6jr.5ck.r21547/72493
type: file
pred: 6jr.5ck.r18893/70088
count: 1
text: 21547 24069 1401 2202 ed30ec32536ddb343493376fb50f3036
cpath: /trunk/client/gui-qt/ratesdlg.h
copyroot: 15280 /trunk

id: 6j9.5ck.r21547/72689
type: file
pred: 6j9.5ck.r18893/70932
count: 1
text: 21547 29252 2368 3347 69f76230a08619e3b369a5e5d20adae0
cpath: /trunk/client/gui-qt/mapview.h
copyroot: 15280 /trunk

id: 6ih.5ck.r21547/72884
type: file
pred: 6ih.5ck.r19216/12554
count: 2
text: 21547 31649 210 965 c1bc804ca3cdebbf72569e70b5fe126c
cpath: /trunk/client/gui-qt/canvas.h
copyroot: 15280 /trunk

id: 6ir.5ck.r21547/73076
type: file
pred: 6ir.5ck.r21126/39580
count: 7
text: 21547 31888 42 8507 71aaa632483785a1453c2d71acd772a9
cpath: /trunk/client/gui-qt/dialogs.cpp
copyroot: 15280 /trunk

id: 6ld.5ck.r21547/73271
type: file
pred: 6ld.5ck.r19313/5326
count: 10
text: 21547 41621 4219 5162 742a539629a0ca40237cdba2545ed381
cpath: /trunk/client/gui-qt/fc_client.h
copyroot: 15280 /trunk

id: 6jg.5ck.r21547/73468
type: file
pred: 6jg.5ck.r19259/509812
count: 2
text: 21547 71406 472 2816 f17a9925359c4bdd8d9f831846efb911
cpath: /trunk/client/gui-qt/optiondlg.cpp
copyroot: 15280 /trunk

id: 6j6.5ck.r21547/73667
type: file
pred: 6j6.5ck.r19259/510405
count: 2
text: 21547 792 2431 4615 59b11281af7cbfa6c7fe8f62282c8512
cpath: /trunk/client/gui-qt/mapctrl.cpp
copyroot: 15280 /trunk

id: 6jj.5ck.r21547/73863
type: file
pred: 6jj.5ck.r18893/73974
count: 1
text: 21547 6694 303 1067 dadc916aeae67534a83ad7611fb01261
cpath: /trunk/client/gui-qt/pages.h
copyroot: 15280 /trunk

id: 6jq.5ck.r21547/74054
type: file
pred: 6jq.5ck.r19259/510799
count: 2
text: 21547 7026 6685 8393 c86dacd5363c98a50cdc41b51f11d54f
cpath: /trunk/client/gui-qt/ratesdlg.cpp
copyroot: 15280 /trunk

id: 6jw.5ck.r21547/74252
type: file
pred: 6jw.5ck.r19259/510997
count: 4
text: 21547 13740 1715 4773 f8c55c785654def51a7e384f44d31d57
cpath: /trunk/client/gui-qt/sprite.cpp
copyroot: 15280 /trunk

id: 6j8.5ck.r21547/74449
type: file
pred: 6j8.5ck.r19259/511389
count: 4
text: 21547 15485 7896 17899 0bb2ca22bae4b1b30a2c79ae12226176
cpath: /trunk/client/gui-qt/mapview.cpp
copyroot: 15280 /trunk

id: 6jb.5ck.r21547/74648
type: file
pred: 6jb.5ck.r18893/74985
count: 1
text: 21547 23411 629 1382 695e1622401bc8771785ddfff2074fcb
cpath: /trunk/client/gui-qt/menu.h
copyroot: 15280 /trunk

id: 6ig.5ck.r21547/74839
type: file
pred: 6ig.5ck.r19259/511586
count: 3
text: 21547 25499 3723 9369 096be62e641864edfb33585fbf1d6303
cpath: /trunk/client/gui-qt/canvas.cpp
copyroot: 15280 /trunk

id: 6lc.5ck.r21547/75036
type: file
pred: 6lc.5ck.r19984/75
count: 16
text: 21547 31958 7963 11980 01aa740239aa0e9655138255a01fbf16
cpath: /trunk/client/gui-qt/fc_client.cpp
copyroot: 15280 /trunk

id: 6ii.5ck.r21547/75234
type: file
pred: 6ii.5ck.r19259/512767
count: 4
text: 21547 39946 196 2049 590213bf9986737eacfa9f9333785033
cpath: /trunk/client/gui-qt/chatline.cpp
copyroot: 15280 /trunk

id: 6j1.5ck.r21547/75432
type: file
pred: 6j1.5ck.r20572/5663
count: 9
text: 21547 40171 1321 10806 45d1e9e0505d1a9d258981608404f3a9
cpath: /trunk/client/gui-qt/gui_main.cpp
copyroot: 15280 /trunk

id: 6if.5ck.r21547/75630
type: file
pred: 6if.5ck.r21274/3376
count: 7
text: 21547 41519 75 1428 72074b4d9dc035b18bda85fdccf18acc
cpath: /trunk/client/gui-qt/Makefile.am
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 25
file 6if.5ck.r21547/75630
K 10
canvas.cpp
V 25
file 6ig.5ck.r21547/74839
K 8
canvas.h
V 25
file 6ih.5ck.r21547/72884
K 12
chatline.cpp
V 25
file 6ii.5ck.r21547/75234
K 10
chatline.h
V 25
file 6ij.5ck.r18893/72448
K 11
citydlg.cpp
V 26
file 6ik.5ck.r19259/509615
K 11
cityrep.cpp
V 26
file 6il.5ck.r19259/508427
K 9
cityrep.h
V 25
file 6im.5ck.r18893/76325
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 27
file 6ip.5ck.r21528/1399541
K 12
connectdlg.h
V 25
file 6iq.5ck.r18893/76659
K 11
dialogs.cpp
V 25
file 6ir.5ck.r21547/73076
K 9
dialogs.h
V 25
file 6is.5ck.r18893/77166
K 12
diplodlg.cpp
V 26
file 6it.5ck.r19259/509220
K 10
diplodlg.h
V 25
file 6iu.5ck.r18893/68245
K 13
fc_client.cpp
V 25
file 6lc.5ck.r21547/75036
K 11
fc_client.h
V 25
file 6ld.5ck.r21547/73271
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.r19259/510011
K 10
graphics.h
V 25
file 6j0.5ck.r18893/68912
K 12
gui_main.cpp
V 25
file 6j1.5ck.r21547/75432
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 24
file 76c.5ck.r20309/2096
K 12
luaconsole.h
V 24
file 76d.5ck.r20309/2264
K 11
mapctrl.cpp
V 25
file 6j6.5ck.r21547/73667
K 9
mapctrl.h
V 25
file 6j7.5ck.r18893/69418
K 11
mapview.cpp
V 25
file 6j8.5ck.r21547/74449
K 9
mapview.h
V 25
file 6j9.5ck.r21547/72689
K 8
menu.cpp
V 25
file 6ja.5ck.r21547/72299
K 6
menu.h
V 25
file 6jb.5ck.r21547/74648
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.r21547/72103
K 12
messagewin.h
V 25
file 6jf.5ck.r18893/74646
K 13
optiondlg.cpp
V 25
file 6jg.5ck.r21547/73468
K 11
optiondlg.h
V 25
file 6jh.5ck.r18893/68744
K 9
pages.cpp
V 25
file 6ji.5ck.r21547/71907
K 7
pages.h
V 25
file 6jj.5ck.r21547/73863
K 10
plrdlg.cpp
V 26
file 6jk.5ck.r19259/512178
K 8
plrdlg.h
V 25
file 6jl.5ck.r18893/72283
K 15
qtg_cxxside.cpp
V 24
file 6jo.5ck.r20572/5080
K 13
qtg_cxxside.h
V 24
file 6jp.5ck.r20572/5279
K 12
ratesdlg.cpp
V 25
file 6jq.5ck.r21547/74054
K 10
ratesdlg.h
V 25
file 6jr.5ck.r21547/72493
K 12
repodlgs.cpp
V 25
file 6js.5ck.r20844/45788
K 10
repodlgs.h
V 25
file 6jt.5ck.r18893/71950
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.r21547/78800
type: dir
pred: 6ie.5ck.r21528/1402716
count: 39
text: 21547 75824 2963 2963 24808f7ac226c6765faf711ae31806e3
props: 19234 0 72 0 33e6d17e258682e48f787b5a39cf23f3
cpath: /trunk/client/gui-qt
copyroot: 15280 /trunk

PLAIN
K 11
Makefile.am
V 22
file 5f.5ck.r21128/759
K 6
agents
V 22
dir zf.5ck.r19466/4004
K 11
attribute.c
V 24
file xh.5ck.r19354/73372
K 11
attribute.h
V 24
file xi.5ck.r18863/23649
K 7
audio.c
V 27
file 139.5ck.r21487/1510548
K 7
audio.h
V 25
file 13a.5ck.r18863/23408
K 12
audio_none.c
V 26
file 13d.5ck.r19259/462511
K 12
audio_none.h
V 25
file 13e.5ck.r18863/20841
K 11
audio_sdl.c
V 25
file 13f.5ck.r19354/73618
K 11
audio_sdl.h
V 25
file 13g.5ck.r18863/23885
K 17
chatline_common.c
V 26
file 14q.5ck.r19259/494007
K 17
chatline_common.h
V 25
file 14r.5ck.r18863/23155
K 16
citydlg_common.c
V 24
file z4.5ck.r20946/32049
K 16
citydlg_common.h
V 24
file z5.5ck.r18863/18619
K 13
cityrepdata.c
V 24
file mb.5ck.r20946/32300
K 13
cityrepdata.h
V 24
file mc.5ck.r18863/19121
K 13
client_main.c
V 24
file 2f.5cp.r21302/11898
K 13
client_main.h
V 24
file hz.5cq.r18863/25358
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 25
file d5.5ck.r21517/131107
K 9
climisc.h
V 24
file i0.5ck.r20865/60492
K 8
clinet.c
V 24
file hc.5ck.r20327/24570
K 8
clinet.h
V 24
file i1.5ck.r18863/24866
K 15
colors_common.c
V 26
file 33a.5ck.r19259/421115
K 15
colors_common.h
V 25
file 33b.5ck.r19135/48891
K 19
connectdlg_common.c
V 24
file 2fw.5ck.r20335/9882
K 19
connectdlg_common.h
V 25
file 2fx.5ck.r19154/53802
K 9
control.c
V 25
file gz.5ck.r21517/107325
K 9
control.h
V 24
file i2.5ck.r20963/41940
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.r21363/34475
K 8
editor.h
V 25
file 3bh.5ck.r21141/62583
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 25
file vu.5ck.r21517/118238
K 6
goto.h
V 24
file vv.5ck.r20865/49000
K 11
gui-gtk-2.0
V 24
dir zs.5ck.r21517/112903
K 11
gui-gtk-3.0
V 24
dir zs.5g7.r21517/130341
K 6
gui-qt
V 24
dir 6ie.5ck.r21547/78800
K 7
gui-sdl
V 25
dir 16t.5ck.r21517/124366
K 8
gui-stub
V 25
dir mh.5ck.r21528/1399294
K 9
gui-win32
V 23
dir np.5ck.r20393/61195
K 7
gui-xaw
V 24
dir 9o.5ck.r21517/117992
K 14
gui_cbsetter.c
V 25
file a3c.5ck.r20753/37570
K 14
gui_cbsetter.h
V 25
file a3d.5ck.r20753/37736
K 15
gui_interface.c
V 24
file 6jm.5ir.r20572/4643
K 15
gui_interface.h
V 25
file 6jn.5is.r20753/26820
K 10
helpdata.c
V 25
file h1.5ck.r21517/124613
K 10
helpdata.h
V 24
file i3.5ck.r18863/21834
K 7
include
V 23
dir b8.5ck.r21126/25145
K 19
luaconsole_common.c
V 22
file 75z.5ck.r20372/58
K 19
luaconsole_common.h
V 25
file 760.5ck.r20306/31022
K 9
luascript
V 22
dir 761.5ck.r20323/104
K 16
mapctrl_common.c
V 25
file 15m.5ck.r20865/59741
K 16
mapctrl_common.h
V 25
file 15n.5ck.r19893/12504
K 16
mapview_common.c
V 23
file z2.5ck.r21536/1428
K 16
mapview_common.h
V 24
file z3.5ck.r20392/39510
K 19
messagewin_common.c
V 25
file 14s.5ck.r19354/71979
K 19
messagewin_common.h
V 25
file 14t.5ck.r18863/21579
K 9
options.c
V 24
file dc.5ck.r21446/11669
K 9
options.h
V 23
file i4.5ck.r21446/1226
K 17
overview_common.c
V 24
file 2yk.5ck.r20232/2517
K 17
overview_common.h
V 24
file 2yl.5ck.r19511/5441
K 10
packhand.c
V 21
file n.5ck.r21545/153
K 10
packhand.h
V 24
file i5.5ck.r18863/20596
K 15
plrdlg_common.c
V 25
file 14u.5ck.r19354/71728
K 15
plrdlg_common.h
V 25
file 14v.5ck.r18863/21328
K 17
repodlgs_common.c
V 26
file 11i.5ck.r21517/113397
K 17
repodlgs_common.h
V 25
file 11j.5ck.r19589/11861
K 9
reqtree.c
V 25
file 2ym.5ck.r20886/25374
K 9
reqtree.h
V 24
file 2yn.5ck.r19057/3837
K 9
servers.c
V 24
file 33x.5ck.r20942/6400
K 9
servers.h
V 25
file 33y.5ck.r20478/36372
K 6
text.c
V 26
file 2g3.5ck.r21517/113151
K 6
text.h
V 25
file 2g4.5ck.r20963/42181
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 24
file hl.5ck.r21527/20119
K 10
tilespec.h
V 24
file i6.5ck.r21141/62091
K 19
unitselect_common.c
V 24
file 76v.5ck.r20397/3580
K 19
unitselect_common.h
V 24
file 76w.5ck.r20397/3746
K 14
update_queue.c
V 25
file 4jw.5ck.r20393/70780
K 14
update_queue.h
V 25
file 4jx.5ck.r18863/22078
K 10
voteinfo.c
V 25
file 4fe.5ck.r19354/72931
K 10
voteinfo.h
V 25
file 4ff.5ck.r18863/22523
END
ENDREP
id: d.5ck.r21547/83337
type: dir
pred: d.5ck.r21545/4692
count: 5444
text: 21547 79040 4284 4284 38583f66d3afe7806d82cdd0b8d1a1d4
props: 20641 0 184 0 7e44dc5a5223e43acf7a5285ba8bedd0
cpath: /trunk/client
copyroot: 15280 /trunk

PLAIN
K 9
ABOUT-NLS
V 22
file fu.0.r13215/85704
K 7
AUTHORS
V 19
file 5u.0.r12982/94
K 7
COPYING
V 19
file 1h.0.r9643/400
K 9
ChangeLog
V 26
file 6l.5ck.r20415/4358289
K 7
INSTALL
V 22
file 6.5ck.r21468/8473
K 11
Makefile.am
V 23
file 59.5ck.r21464/2926
K 4
NEWS
V 23
file 6m.5ck.r20417/3239
K 6
README
V 20
file 7.0.r4421/96382
K 2
ai
V 22
dir 8.5ck.r21517/98586
K 10
autogen.sh
V 23
file 12o.5ck.r21323/726
K 9
bootstrap
V 22
dir 2p5.5ck.r21310/820
K 6
client
V 22
dir d.5ck.r21547/83337
K 6
common
V 21
dir p.5ck.r21546/5549
K 12
config.mac.h
V 20
file hb.0.r6045/5982
K 12
configure.ac
V 24
file 149.5ck.r21534/1303
K 4
data
V 21
dir w.5ck.r21539/7715
K 6
debian
V 24
dir 5w.5ck.r21460/324392
K 12
dependencies
V 23
dir 2yu.5ck.r21120/5452
K 11
diff_ignore
V 24
file qq.5ck.r21039/26581
K 3
doc
V 25
dir k7.5ck.r21528/1395107
K 10
fc_version
V 24
file 2lo.5en.r21538/4823
K 2
m4
V 23
dir 12p.5ck.r21515/3100
K 2
po
V 25
dir fs.5ck.r21528/1409799
K 7
scripts
V 23
dir 2yo.5ck.r21255/8971
K 6
server
V 21
dir z.5ck.r21540/6855
K 10
stamp-h.in
V 19
file 80.0.r1125/241
K 5
tests
V 23
dir 2g9.5ck.r20384/1173
K 5
tools
V 22
dir 4pj.5js.r21472/121
K 7
utility
V 22
dir 1c.5ck.r21526/3724
K 3
vms
V 25
dir u9.5ck.r21528/1396085
K 5
win32
V 23
dir 2eu.5ck.r21481/1011
END
ENDREP
id: 3.5ck.r21547/84842
type: dir
pred: 3.5ck.r21546/7053
count: 15591
text: 21547 83566 1263 1263 9d35c9d71268795428a5389f7a244af5
props: 20140 3888 282 0 e4bb46e81629a60eef613b169b23a9ea
cpath: /trunk
copyroot: 15280 /trunk

PLAIN
K 8
branches
V 19
dir 1.0.r21544/6953
K 4
tags
V 19
dir 2.0.r21087/5782
K 5
trunk
V 22
dir 3.5ck.r21547/84842
K 7
website
V 18
dir 3ge.0.r12388/0
END
ENDREP
id: 0.0.r21547/85231
type: dir
pred: 0.0.r21546/7439
count: 21547
text: 21547 85068 150 150 a38368b95a1aeb83ccf971532671f8ce
cpath: /
copyroot: 0 /

6j1.5ck.t21546-1 modify true false /trunk/client/gui-qt/gui_main.cpp

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

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

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

6jg.5ck.t21546-1 modify true false /trunk/client/gui-qt/optiondlg.cpp

6j6.5ck.t21546-1 modify true false /trunk/client/gui-qt/mapctrl.cpp

6je.5ck.t21546-1 modify true false /trunk/client/gui-qt/messagewin.cpp

6jj.5ck.t21546-1 modify true false /trunk/client/gui-qt/pages.h

6ja.5ck.t21546-1 modify true false /trunk/client/gui-qt/menu.cpp

6jq.5ck.t21546-1 modify true false /trunk/client/gui-qt/ratesdlg.cpp

6jw.5ck.t21546-1 modify true false /trunk/client/gui-qt/sprite.cpp

6j8.5ck.t21546-1 modify true false /trunk/client/gui-qt/mapview.cpp

6jb.5ck.t21546-1 modify true false /trunk/client/gui-qt/menu.h

6jr.5ck.t21546-1 modify true false /trunk/client/gui-qt/ratesdlg.h

6ig.5ck.t21546-1 modify true false /trunk/client/gui-qt/canvas.cpp

6j9.5ck.t21546-1 modify true false /trunk/client/gui-qt/mapview.h

6ih.5ck.t21546-1 modify true false /trunk/client/gui-qt/canvas.h

6ir.5ck.t21546-1 modify true false /trunk/client/gui-qt/dialogs.cpp

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

6ii.5ck.t21546-1 modify true false /trunk/client/gui-qt/chatline.cpp


85231 85380
