Author: cazfi
Date: Sat Aug  8 17:53:46 2015
New Revision: 29402

URL: http://svn.gna.org/viewcvs/freeciv?rev=29402&view=rev
Log:
Added missing function headers to plrdlg.c and repodlgs.c in client/gui-sdl2
directory. Also other cleanups.

See patch #2937

Modified:
    trunk/client/gui-sdl/repodlgs.c
    trunk/client/gui-sdl2/plrdlg.c
    trunk/client/gui-sdl2/repodlgs.c

Modified: trunk/client/gui-sdl/repodlgs.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl/repodlgs.c?rev=29402&r1=29401&r2=29402&view=diff
==============================================================================
--- trunk/client/gui-sdl/repodlgs.c     (original)
+++ trunk/client/gui-sdl/repodlgs.c     Sat Aug  8 17:53:46 2015
@@ -125,7 +125,7 @@
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     int ut1 = MAX_ID - pWidget->ID;
     
-    /* popdown sell dlg */
+    /* popdown upgrade dlg */
     popdown_window_group_dialog(pUnits_Upg_Dlg->pBeginWidgetList,
                                 pUnits_Upg_Dlg->pEndWidgetList);
     FC_FREE(pUnits_Upg_Dlg);

Modified: trunk/client/gui-sdl2/plrdlg.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/plrdlg.c?rev=29402&r1=29401&r2=29402&view=diff
==============================================================================
--- trunk/client/gui-sdl2/plrdlg.c      (original)
+++ trunk/client/gui-sdl2/plrdlg.c      Sat Aug  8 17:53:46 2015
@@ -21,8 +21,6 @@
 /* utility */
 #include "astring.h"
 #include "fcintl.h"
-
-/* common */
 
 /* client */
 #include "client_main.h"
@@ -52,6 +50,9 @@
 
 static struct SMALL_DLG  *pPlayers_Dlg = NULL;
 
+/**************************************************************************
+  User interacted with player dialog close button.
+**************************************************************************/
 static int exit_players_dlg_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -62,6 +63,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with player widget.
+**************************************************************************/
 static int player_callback(struct widget *pWidget)
 {
   struct player *pPlayer = pWidget->data.player;
@@ -92,6 +96,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with player dialog window.
+**************************************************************************/
 static int players_window_dlg_callback(struct widget *pWindow)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -108,6 +115,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with 'draw war status' toggle.
+**************************************************************************/
 static int toggle_draw_war_status_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -126,6 +136,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with 'draw cease-fire status' toggle.
+**************************************************************************/
 static int toggle_draw_ceasefire_status_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -144,7 +157,10 @@
   return -1;
 }
 
-static int toggle_draw_pease_status_callback(struct widget *pWidget)
+/**************************************************************************
+  User interacted with 'draw peace status' toggle.
+**************************************************************************/
+static int toggle_draw_peace_status_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     /* exit button -> neutral -> war -> casefire -> peace -> alliance */
@@ -162,6 +178,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with 'draw alliance status' toggle.
+**************************************************************************/
 static int toggle_draw_alliance_status_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -180,6 +199,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with 'draw neutral status' toggle.
+**************************************************************************/
 static int toggle_draw_neutral_status_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -198,7 +220,9 @@
   return -1;
 }
 
-
+/**************************************************************************
+  Does the attached player have embassy-level information about the player.
+**************************************************************************/
 static bool have_diplomat_info_about(struct player *pPlayer)
 {
   return (pPlayer == client.conn.playing
@@ -404,7 +428,7 @@
        pBuf = create_checkbox(pWindow->dst,
                                (SDL_Client_Flags & 
CF_DRAW_PLAYERS_PEACE_STATUS),
                                WF_RESTORE_BACKGROUND);
-       pBuf->action = toggle_draw_pease_status_callback;
+       pBuf->action = toggle_draw_peace_status_callback;
        pBuf->key = SDLK_p;
       break;
       case DS_ALLIANCE:
@@ -571,11 +595,17 @@
 /* ============================== SHORT =============================== */
 static struct ADVANCED_DLG  *pShort_Players_Dlg = NULL;
 
+/**************************************************************************
+  User interacted with nations window.
+**************************************************************************/
 static int players_nations_window_dlg_callback(struct widget *pWindow)
 {
   return -1;
 }
 
+/**************************************************************************
+  User interacted with nations window close button.
+**************************************************************************/
 static int exit_players_nations_dlg_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -586,6 +616,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with widget of a single nation/player.
+**************************************************************************/
 static int player_nation_callback(struct widget *pWidget)
 {
   struct player *pPlayer = pWidget->data.player;

Modified: trunk/client/gui-sdl2/repodlgs.c
URL: 
http://svn.gna.org/viewcvs/freeciv/trunk/client/gui-sdl2/repodlgs.c?rev=29402&r1=29401&r2=29402&view=diff
==============================================================================
--- trunk/client/gui-sdl2/repodlgs.c    (original)
+++ trunk/client/gui-sdl2/repodlgs.c    Sat Aug  8 17:53:46 2015
@@ -68,7 +68,9 @@
   int soonest_completions;
 };
 
-
+/**************************************************************************
+  Fill unit types specific report data + totals.
+**************************************************************************/
 static void get_units_report_data(struct units_entry *entries,
                                   struct units_entry *total)
 {
@@ -112,7 +114,9 @@
   } city_list_iterate_end;
 }
 
-
+/**************************************************************************
+  User interacted with Units Report button.
+**************************************************************************/
 static int units_dialog_callback(struct widget *pWindow)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -123,12 +127,16 @@
 }
 
 /* --------------------------------------------------------------- */
+
+/**************************************************************************
+  User interacted with accept button of the unit upgrade dialog.
+**************************************************************************/
 static int ok_upgrade_unit_window_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     int ut1 = MAX_ID - pWidget->ID;
 
-    /* popdown sell dlg */
+    /* popdown upgrade dlg */
     popdown_window_group_dialog(pUnits_Upg_Dlg->pBeginWidgetList,
                                 pUnits_Upg_Dlg->pEndWidgetList);
     FC_FREE(pUnits_Upg_Dlg);
@@ -139,6 +147,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with Upgrade Obsolete button of the unit upgrade dialog.
+**************************************************************************/
 static int upgrade_unit_window_callback(struct widget *pWindow)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -148,6 +159,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with Cancel button of the unit upgrade dialog.
+**************************************************************************/
 static int cancel_upgrade_unit_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -162,6 +176,9 @@
   return -1;
 }
 
+/**************************************************************************
+  Open dialog for upgrading units.
+**************************************************************************/
 static int popup_upgrade_unit_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -307,6 +324,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with units dialog Close Dialog button.
+**************************************************************************/
 static int exit_units_dlg_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -326,7 +346,6 @@
 
   return -1;
 }
-
 
 /**************************************************************************
   Rebuild the units report.
@@ -1087,6 +1106,9 @@
   struct widget *pLabel_Src, *pLabel_Dst;
 };
 
+/**************************************************************************
+  User interacted with Economy Report window.
+**************************************************************************/
 static int economy_dialog_callback(struct widget *pWindow)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -1096,6 +1118,9 @@
   return -1;
 }
 
+/**************************************************************************
+  User interacted with Economy dialog Close Dialog button.
+**************************************************************************/
 static int exit_economy_dialog_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -1120,7 +1145,7 @@
 }
 
 /**************************************************************************
-  ...
+  Toggle Rates dialog locking checkbox.
 **************************************************************************/
 static int toggle_block_callback(struct widget *pCheckBox)
 {
@@ -1143,7 +1168,7 @@
 }
 
 /**************************************************************************
-  ...
+  User released mouse button while adjusting rates.
 **************************************************************************/
 static Uint16 report_scroll_mouse_button_up(SDL_MouseButtonEvent *pButtonEvent,
                                             void *pData)
@@ -1152,7 +1177,7 @@
 }
 
 /**************************************************************************
-  ...
+  User moved a mouse while adjusting rates.
 **************************************************************************/
 static Uint16 report_scroll_mouse_motion_handler(SDL_MouseMotionEvent 
*pMotionEvent,
                                                  void *pData)
@@ -1269,7 +1294,7 @@
 
 
 /**************************************************************************
-  ...
+  Handle Rates sliders.
 **************************************************************************/
 static int horiz_taxrate_callback(struct widget *pHoriz_Src)
 {
@@ -1357,7 +1382,7 @@
 }
 
 /**************************************************************************
-  ...
+  User interacted with Update button of the Rates.
 **************************************************************************/
 static int apply_taxrates_callback(struct widget *pButton)
 {
@@ -1393,6 +1418,9 @@
   return -1;
 }
 
+/**************************************************************************
+  Set economy dialog widgets enabled.
+**************************************************************************/
 static void enable_economy_dlg(void)
 {
   /* lux lock */
@@ -1429,6 +1457,9 @@
   }
 }
 
+/**************************************************************************
+  Set economy dialog widgets disabled.
+**************************************************************************/
 static void disable_economy_dlg(void)
 {
   /* lux lock */
@@ -1466,7 +1497,11 @@
 }
 
 /* --------------------------------------------------------------- */
-static int ok_sell_impv_callback(struct widget *pWidget)
+
+/**************************************************************************
+  User interacted with Yes button of the improvement selling dialog.
+**************************************************************************/
+static int ok_sell_impr_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     int imp, total_count, count = 0;
@@ -1498,7 +1533,10 @@
   return -1;
 }
 
-static int sell_impv_window_callback(struct widget *pWindow)
+/**************************************************************************
+  User interacted with the improvement selling window.
+**************************************************************************/
+static int sell_impr_window_callback(struct widget *pWindow)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     move_window_group(pEconomy_Sell_Dlg->pBeginWidgetList, pWindow);
@@ -1507,7 +1545,10 @@
   return -1;
 }
 
-static int cancel_sell_impv_callback(struct widget *pWidget)
+/**************************************************************************
+  User interacted with Cancel button of the improvement selling dialog.
+**************************************************************************/
+static int cancel_sell_impr_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     if (pEconomy_Sell_Dlg) {
@@ -1522,8 +1563,10 @@
   return -1;
 }
 
-
-static int popup_sell_impv_callback(struct widget *pWidget)
+/**************************************************************************
+  Open improvement selling dialog.
+**************************************************************************/
+static int popup_sell_impr_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
     int imp, total_count ,count = 0, gold = 0;
@@ -1575,7 +1618,7 @@
 
     pWindow = create_window_skeleton(NULL, pstr, 0);
 
-    pWindow->action = sell_impv_window_callback;
+    pWindow->action = sell_impr_window_callback;
     set_wstate(pWindow, FC_WS_NORMAL);
 
     pEconomy_Sell_Dlg->pEndWidgetList = pWindow;
@@ -1602,7 +1645,7 @@
                                               pWindow->dst, _("No"),
                                               adj_font(12), 0);
 
-    pBuf->action = cancel_sell_impv_callback;
+    pBuf->action = cancel_sell_impr_callback;
     set_wstate(pBuf, FC_WS_NORMAL);
 
     area.h += (pBuf->size.h + adj_size(20));
@@ -1613,7 +1656,7 @@
       pBuf = create_themeicon_button_from_chars(pTheme->OK_Icon, pWindow->dst,
                                                 _("Sell"), adj_font(12), 0);
 
-      pBuf->action = ok_sell_impv_callback;
+      pBuf->action = ok_sell_impr_callback;
       set_wstate(pBuf, FC_WS_NORMAL);
       pBuf->data.ptr = (void *)pWidget;
 
@@ -2116,7 +2159,7 @@
       pBuf->data.cont = fc_calloc(1, sizeof(struct CONTAINER));
       pBuf->data.cont->id0 = improvement_number(p->type);
       pBuf->data.cont->id1 = p->count;
-      pBuf->action = popup_sell_impv_callback;
+      pBuf->action = popup_sell_impr_callback;
 
       add_to_gui_list(MAX_ID - i, pBuf);
 
@@ -2344,6 +2387,9 @@
 
 static struct ADVANCED_DLG *pChangeTechDlg = NULL;
 
+/**************************************************************************
+  Create icon surface for a tech.
+**************************************************************************/
 SDL_Surface *create_select_tech_icon(utf8_str *pstr, Tech_type_id tech_id,
                                      enum tech_info_mode mode)
 {
@@ -2788,7 +2834,7 @@
 }
 
 /**************************************************************************
-  ...
+  Close science report dialog.
 **************************************************************************/
 static void science_report_dialog_popdown(void)
 {
@@ -2804,7 +2850,7 @@
 }
 
 /**************************************************************************
-  ...
+  Close research target changing dialog.
 **************************************************************************/
 static int exit_change_tech_dlg_callback(struct widget *pWidget)
 {
@@ -2825,7 +2871,7 @@
 }
 
 /**************************************************************************
-  ...
+  User interacted with button of specific Tech.
 **************************************************************************/
 static int change_research_callback(struct widget *pWidget)
 {
@@ -3020,7 +3066,7 @@
 }
 
 /**************************************************************************
-  ...
+  User chose spesic tech as research goal.
 **************************************************************************/
 static int change_research_goal_callback(struct widget *pWidget)
 {
@@ -3232,6 +3278,9 @@
   return -1;
 }
 
+/**************************************************************************
+  Open research target changing dialog.
+**************************************************************************/
 static int popup_change_research_dialog_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -3245,6 +3294,9 @@
   return -1;
 }
 
+/**************************************************************************
+  Open research goal changing dialog.
+**************************************************************************/
 static int popup_change_research_goal_dialog_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {
@@ -3258,6 +3310,9 @@
   return -1;
 }
 
+/**************************************************************************
+  Close science dialog.
+**************************************************************************/
 static int popdown_science_dialog_callback(struct widget *pWidget)
 {
   if (Main.event.button.button == SDL_BUTTON_LEFT) {


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

Reply via email to