Author: jtn Date: Tue Dec 29 01:54:32 2015 New Revision: 31255 URL: http://svn.gna.org/viewcvs/freeciv?rev=31255&view=rev Log: In Qt client, add tooltip and right-click help to the research report for government types.
See gna patch #6738. Modified: branches/S2_6/client/gui-qt/repodlgs.cpp branches/S2_6/client/gui-qt/repodlgs.h Modified: branches/S2_6/client/gui-qt/repodlgs.cpp URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/repodlgs.cpp?rev=31255&r1=31254&r2=31255&view=diff ============================================================================== --- branches/S2_6/client/gui-qt/repodlgs.cpp (original) +++ branches/S2_6/client/gui-qt/repodlgs.cpp Tue Dec 29 01:54:32 2015 @@ -202,7 +202,7 @@ rttp->rect = QRect(icon_startx, starty + text_h + 4 + (height - text_h - 4 - sheight) / 2, swidth, sheight); - rttp->tech_id = node->tech; + rttp->tgov = gov; tt_help.append(rttp); icon_startx += swidth + 2; } @@ -279,6 +279,9 @@ } else if (rttp->tunit != nullptr) { popup_help_dialog_typed(utype_name_translation(rttp->tunit), HELP_UNIT); + } else if (rttp->tgov != nullptr) { + popup_help_dialog_typed(government_name_translation(rttp->tgov), + HELP_GOVERNMENT); } else { return; } @@ -320,6 +323,13 @@ tt_text += helptext_unit(buffer, sizeof(buffer), client.conn.playing, buf2, rttp->tunit); tt_text = cut_helptext(tt_text); + } else if (rttp->tgov != nullptr) { + helptext_government(buffer, sizeof(buffer), client.conn.playing, + buf2, rttp->tgov); + tt_text = QString(buffer); + tt_text = cut_helptext(tt_text); + def_str = "<p style='white-space:pre'><b>" + + QString(government_name_translation(rttp->tgov)) + "</b>\n"; } else { return; } @@ -1700,4 +1710,5 @@ units_rep = reinterpret_cast<units_report*>(w); units_rep->deleteLater(); } -} + +} Modified: branches/S2_6/client/gui-qt/repodlgs.h URL: http://svn.gna.org/viewcvs/freeciv/branches/S2_6/client/gui-qt/repodlgs.h?rev=31255&r1=31254&r2=31255&view=diff ============================================================================== --- branches/S2_6/client/gui-qt/repodlgs.h (original) +++ branches/S2_6/client/gui-qt/repodlgs.h Tue Dec 29 01:54:32 2015 @@ -61,6 +61,7 @@ Tech_type_id tech_id; struct unit_type *tunit; struct impr_type *timpr; + struct government *tgov; }; /**************************************************************************** Custom widget representing research diagram in science_report _______________________________________________ Freeciv-commits mailing list Freeciv-commits@gna.org https://mail.gna.org/listinfo/freeciv-commits