Author: mir3x
Date: Thu Dec 24 09:36:08 2015
New Revision: 31181

URL: http://svn.gna.org/viewcvs/freeciv?rev=31181&view=rev
Log:
Added possibility to request meeting with other players by 
right clicking on them in player report.

See patch #6700


Modified:
    trunk/client/gui-qt/plrdlg.cpp
    trunk/client/gui-qt/plrdlg.h

Modified: trunk/client/gui-qt/plrdlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/plrdlg.cpp?rev=31181&r1=31180&r2=31181&view=diff
==============================================================================
--- trunk/client/gui-qt/plrdlg.cpp      (original)
+++ trunk/client/gui-qt/plrdlg.cpp      Thu Dec 24 09:36:08 2015
@@ -611,6 +611,17 @@
   gui()->game_tab_widget->setCurrentIndex(index);
 }
 
+
+/**************************************************************************
+  Public function to call meeting
+**************************************************************************/
+void plr_report::call_meeting()
+{
+  if (meet_but->isEnabled() == true) {
+    req_meeeting();
+  }
+}
+
 /**************************************************************************
   Slot for canceling threaty (name changed to cheat autoconnect, and
   doubled execution)
@@ -639,6 +650,19 @@
   dsend_packet_diplomacy_cancel_pact(&client.conn, 
                                      player_number(other_player),
                                      CLAUSE_VISION);
+}
+
+/**************************************************************************
+  Handle mouse click
+**************************************************************************/
+void plr_widget::mousePressEvent(QMouseEvent *event)
+{
+  QModelIndex index =  this->indexAt(event->pos());
+  if (index.isValid() &&  event->button() == Qt::RightButton
+      && can_client_issue_orders()) {
+     plr->call_meeting();
+  }
+  QTreeView::mousePressEvent(event);
 }
 
 /**************************************************************************

Modified: trunk/client/gui-qt/plrdlg.h
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-qt/plrdlg.h?rev=31181&r1=31180&r2=31181&view=diff
==============================================================================
--- trunk/client/gui-qt/plrdlg.h        (original)
+++ trunk/client/gui-qt/plrdlg.h        Thu Dec 24 09:36:08 2015
@@ -128,6 +128,7 @@
   void display_header_menu(const QPoint &);
   void nation_selected(const QItemSelection &sl, const QItemSelection &ds);
 private:
+  void mousePressEvent(QMouseEvent *event);
   void hide_columns();
 };
 
@@ -153,6 +154,7 @@
   ~plr_report();
   void update_report(bool update_selection = true);
   void init();
+  void call_meeting();
 private:
   struct player *other_player;
   int index;


_______________________________________________
Freeciv-commits mailing list
Freeciv-commits@gna.org
https://mail.gna.org/listinfo/freeciv-commits

Reply via email to