Author: mir3x
Date: Wed Dec 14 10:30:36 2016
New Revision: 34710

URL: http://svn.gna.org/viewcvs/freeciv?rev=34710&view=rev
Log:
Qt client - added application alert

See bug #25380


Modified:
    branches/S2_6/client/gui-qt/chatline.cpp
    branches/S2_6/client/gui-qt/dialogs.cpp
    branches/S2_6/client/gui-qt/diplodlg.cpp
    branches/S2_6/client/gui-qt/fc_client.cpp
    branches/S2_6/client/gui-qt/gui_main.cpp

Modified: branches/S2_6/client/gui-qt/chatline.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/chatline.cpp?rev=34710&r1=34709&r2=34710&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/chatline.cpp    (original)
+++ branches/S2_6/client/gui-qt/chatline.cpp    Wed Dec 14 10:30:36 2016
@@ -40,6 +40,7 @@
 
 #include "chatline.h"
 
+extern QApplication *qapp;
 static bool is_plain_public_message(QString s);
 
 FC_CPP_DECLARE_LISTENER(chat_listener)
@@ -693,9 +694,14 @@
     wakeup = wakeup.arg(client.conn.username);
   }
 
+  if (str.contains(client.conn.username)) {
+    qapp->alert(gui()->central_wdg);
+  }
+
   /* Play sound if we encountered wakeup string */
   if (str.contains(wakeup) && client_state() < C_S_RUNNING
       && !wakeup.isEmpty()) {
+    qapp->alert(gui()->central_wdg);
     audio_play_sound("e_player_wake", NULL);
   }
 

Modified: branches/S2_6/client/gui-qt/dialogs.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/dialogs.cpp?rev=34710&r1=34709&r2=34710&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/dialogs.cpp     (original)
+++ branches/S2_6/client/gui-qt/dialogs.cpp     Wed Dec 14 10:30:36 2016
@@ -16,6 +16,7 @@
 #endif
 
 // Qt
+#include <QApplication>
 #include <QComboBox>
 #include <QHeaderView>
 #include <QImage>
@@ -2492,6 +2493,7 @@
   QList <choice_dialog *> cd_list;
   QList <notify_dialog *> nd_list;
 
+  QApplication::alert(gui()->central_wdg);
   cd_list = gui()->game_tab_widget->findChildren <choice_dialog *>();
   for (i = 0; i < cd_list.count(); i++) {
       cd_list[i]->close();

Modified: branches/S2_6/client/gui-qt/diplodlg.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/diplodlg.cpp?rev=34710&r1=34709&r2=34710&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/diplodlg.cpp    (original)
+++ branches/S2_6/client/gui-qt/diplodlg.cpp    Wed Dec 14 10:30:36 2016
@@ -15,9 +15,8 @@
 #include <fc_config.h>
 #endif
 
-#ifdef HAVE_CONFIG_H
-#include <fc_config.h>
-#endif
+// Qt
+#include <QApplication>
 
 // gui-qt
 #include "qtg_cxxside.h"
@@ -27,7 +26,7 @@
 
 typedef advance *p_advance;
 typedef city *p_city;
-
+extern QApplication *qapp;
 /****************************************************************************
   Constructor for diplomacy widget
 ****************************************************************************/
@@ -997,6 +996,7 @@
   diplo_dlg *dd;
   QWidget *w;
 
+  qapp->alert(gui()->central_wdg);
   if (!gui()->is_repo_dlg_open("DDI")) {
     return;
   }

Modified: branches/S2_6/client/gui-qt/fc_client.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/fc_client.cpp?rev=34710&r1=34709&r2=34710&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/fc_client.cpp   (original)
+++ branches/S2_6/client/gui-qt/fc_client.cpp   Wed Dec 14 10:30:36 2016
@@ -321,7 +321,7 @@
   if (status_bar != nullptr) {
     status_bar->setVisible(true);
   }
-
+  QApplication::alert(gui()->central_wdg);
   central_layout->setCurrentWidget(pages[new_pg]);
   page = new_page;
   i_page = new_page;

Modified: branches/S2_6/client/gui-qt/gui_main.cpp
URL: 
http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/gui_main.cpp?rev=34710&r1=34709&r2=34710&view=diff
==============================================================================
--- branches/S2_6/client/gui-qt/gui_main.cpp    (original)
+++ branches/S2_6/client/gui-qt/gui_main.cpp    Wed Dec 14 10:30:36 2016
@@ -264,6 +264,7 @@
 void qtg_sound_bell()
 {
   QApplication::beep();
+  QApplication::alert(gui()->central_wdg);
 }
 
 /**************************************************************************


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

Reply via email to