lmi-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[lmi-commits] [lmi] master 2c3b7b1 5/5: Flatten oddball census menu


From: Greg Chicares
Subject: [lmi-commits] [lmi] master 2c3b7b1 5/5: Flatten oddball census menu
Date: Thu, 8 Mar 2018 18:02:14 -0500 (EST)

branch: master
commit 2c3b7b14aed1156d942552b2cf3420c2412977bb
Author: Gregory W. Chicares <address@hidden>
Commit: Gregory W. Chicares <address@hidden>

    Flatten oddball census menu
---
 census_view.cpp       | 44 +++++++++++---------------------------------
 census_view.hpp       |  1 +
 gpt_view.cpp          |  1 +
 illustration_view.cpp |  1 +
 mec_view.cpp          |  1 +
 menus.xrc             |  7 ++++++-
 skeleton.cpp          |  1 +
 toolbar.xrc           |  5 +++++
 8 files changed, 27 insertions(+), 34 deletions(-)

diff --git a/census_view.cpp b/census_view.cpp
index 24b58e4..6e20a43 100644
--- a/census_view.cpp
+++ b/census_view.cpp
@@ -42,7 +42,6 @@
 #include "path_utility.hpp"             // unique_filepath()
 #include "rtti_lmi.hpp"                 // lmi::TypeInfo
 #include "safely_dereference_as.hpp"
-#include "single_choice_popup_menu.hpp"
 #include "timer.hpp"
 #include "value_cast.hpp"
 #include "wx_new.hpp"
@@ -854,6 +853,7 @@ BEGIN_EVENT_TABLE(CensusView, ViewEx)
     EVT_MENU(XRCID("print_case_to_disk"        
),CensusView::UponPrintCaseToDisk        )
     EVT_MENU(XRCID("print_spreadsheet"         
),CensusView::UponRunCaseToSpreadsheet   )
     EVT_MENU(XRCID("print_group_roster"        
),CensusView::UponRunCaseToGroupRoster   )
+    EVT_MENU(XRCID("print_group_quote"         
),CensusView::UponRunCaseToGroupQuote    )
     EVT_MENU(XRCID("paste_census"              ),CensusView::UponPasteCensus   
         )
     EVT_MENU(XRCID("add_cell"                  ),CensusView::UponAddCell       
         )
     EVT_MENU(XRCID("delete_cells"              ),CensusView::UponDeleteCells   
         )
@@ -869,6 +869,7 @@ BEGIN_EVENT_TABLE(CensusView, ViewEx)
     EVT_UPDATE_UI(XRCID("print_case_to_disk"   
),CensusView::UponUpdateAlwaysEnabled    )
     EVT_UPDATE_UI(XRCID("print_spreadsheet"    
),CensusView::UponUpdateAlwaysEnabled    )
     EVT_UPDATE_UI(XRCID("print_group_roster"   
),CensusView::UponUpdateAlwaysEnabled    )
+    EVT_UPDATE_UI(XRCID("print_group_quote"    
),CensusView::UponUpdateAlwaysEnabled    )
     EVT_UPDATE_UI(XRCID("paste_census"         
),CensusView::UponUpdateAlwaysEnabled    )
     EVT_UPDATE_UI(XRCID("add_cell"             
),CensusView::UponUpdateAlwaysEnabled    )
     EVT_UPDATE_UI(XRCID("delete_cells"         
),CensusView::UponUpdateNonemptySelection)
@@ -1623,41 +1624,18 @@ void 
CensusView::UponRunCaseToSpreadsheet(wxCommandEvent&)
     DoAllCells(mce_emit_spreadsheet);
 }
 
-/// Print group roster in an interactively-chosen format.
+/// Print group roster to a "spreadsheet" (TSV) file.
 
 void CensusView::UponRunCaseToGroupRoster(wxCommandEvent&)
 {
-    wxArrayString strings;
-    // Make sure ampersands don't look like references, e.g., in a
-    // string such as "premium quote" with an ampersand preceding 'q',
-    // which 'make check_concinnity' rejects.
-    strings.Add("Print r&oster to spreadsheet");
-    strings.Add("Print group premium ""&quote to PDF");
-    int const selection = SingleChoicePopupMenu(strings).Choose();
-    switch(selection)
-        {
-        case -1:
-            {
-            // No selection: do nothing; let the popup just vanish.
-            }
-            break;
-        case 0:
-            {
-            // Print tab-delimited roster to file loadable in spreadsheet 
programs.
-            DoAllCells(mce_emit_group_roster);
-            }
-            break;
-        case 1:
-            {
-            // Print group quote to a PDF file.
-            DoAllCells(mce_emit_group_quote);
-            }
-            break;
-        default:
-            {
-            alarum() << "Case " << selection << " not found." << LMI_FLUSH;
-            }
-        }
+    DoAllCells(mce_emit_group_roster);
+}
+
+/// Print group premium quote to a PDF file.
+
+void CensusView::UponRunCaseToGroupQuote(wxCommandEvent&)
+{
+    DoAllCells(mce_emit_group_quote);
 }
 
 /// Paste a census from the clipboard.
diff --git a/census_view.hpp b/census_view.hpp
index 9981815..6f53d32 100644
--- a/census_view.hpp
+++ b/census_view.hpp
@@ -82,6 +82,7 @@ class CensusView final
     void UponRunCase                (wxCommandEvent&);
     void UponRunCaseToSpreadsheet   (wxCommandEvent&);
     void UponRunCaseToGroupRoster   (wxCommandEvent&);
+    void UponRunCaseToGroupQuote    (wxCommandEvent&);
     void UponUpdateAlwaysDisabled   (wxUpdateUIEvent&);
     void UponUpdateAlwaysEnabled    (wxUpdateUIEvent&);
     void UponUpdateSingleSelection  (wxUpdateUIEvent&);
diff --git a/gpt_view.cpp b/gpt_view.cpp
index 8493d1d..80fdbdd 100644
--- a/gpt_view.cpp
+++ b/gpt_view.cpp
@@ -69,6 +69,7 @@ BEGIN_EVENT_TABLE(gpt_view, ViewEx)
     EVT_UPDATE_UI(XRCID("print_case_to_disk"   
),gpt_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("print_spreadsheet"    
),gpt_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("print_group_roster"   
),gpt_view::UponUpdateInapplicable)
+    EVT_UPDATE_UI(XRCID("print_group_quote"    
),gpt_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("paste_census"         
),gpt_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("add_cell"             
),gpt_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("delete_cells"         
),gpt_view::UponUpdateInapplicable)
diff --git a/illustration_view.cpp b/illustration_view.cpp
index 47186fd..8167d47 100644
--- a/illustration_view.cpp
+++ b/illustration_view.cpp
@@ -89,6 +89,7 @@ BEGIN_EVENT_TABLE(IllustrationView, ViewEx)
     EVT_UPDATE_UI(XRCID("print_case_to_disk"   
),IllustrationView::UponUpdateInapplicable )
     EVT_UPDATE_UI(XRCID("print_spreadsheet"    
),IllustrationView::UponUpdateInapplicable )
     EVT_UPDATE_UI(XRCID("print_group_roster"   
),IllustrationView::UponUpdateInapplicable )
+    EVT_UPDATE_UI(XRCID("print_group_quote"    
),IllustrationView::UponUpdateInapplicable )
     EVT_UPDATE_UI(XRCID("paste_census"         
),IllustrationView::UponUpdateInapplicable )
     EVT_UPDATE_UI(XRCID("add_cell"             
),IllustrationView::UponUpdateInapplicable )
     EVT_UPDATE_UI(XRCID("delete_cells"         
),IllustrationView::UponUpdateInapplicable )
diff --git a/mec_view.cpp b/mec_view.cpp
index a937461..f4d8721 100644
--- a/mec_view.cpp
+++ b/mec_view.cpp
@@ -69,6 +69,7 @@ BEGIN_EVENT_TABLE(mec_view, ViewEx)
     EVT_UPDATE_UI(XRCID("print_case_to_disk"   
),mec_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("print_spreadsheet"    
),mec_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("print_group_roster"   
),mec_view::UponUpdateInapplicable)
+    EVT_UPDATE_UI(XRCID("print_group_quote"    
),mec_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("paste_census"         
),mec_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("add_cell"             
),mec_view::UponUpdateInapplicable)
     EVT_UPDATE_UI(XRCID("delete_cells"         
),mec_view::UponUpdateInapplicable)
diff --git a/menus.xrc b/menus.xrc
index 299e9c4..2ef6127 100644
--- a/menus.xrc
+++ b/menus.xrc
@@ -360,10 +360,15 @@
         <help>Run and print all cells to a spreadsheet file</help>
     </object>
     <object class="wxMenuItem" name="print_group_roster">
-        <label>Print group r_oster...\tCtrl-Shift-O</label>
+        <label>Print group r_oster to spreadsheet\tCtrl-Shift-O</label>
         <bitmap platform="win" stock_id="roster"/>
         <help>Run and print all cells to a group roster</help>
     </object>
+    <object class="wxMenuItem" name="print_group_quote">
+        <label>Print group premium _quote to PDF\tCtrl-Shift-Q</label>
+    <bitmap platform="win" stock_id="quote"/>
+        <help>Run and print all cells to a group premium quote</help>
+    </object>
     <object class="separator"/>
     <object class="wxMenuItem" name="paste_census">
         <label>Pa_ste census\tCtrl-Shift-S</label>
diff --git a/skeleton.cpp b/skeleton.cpp
index 3f48de4..dc3ca46 100644
--- a/skeleton.cpp
+++ b/skeleton.cpp
@@ -169,6 +169,7 @@ BEGIN_EVENT_TABLE(Skeleton, wxApp)
     EVT_UPDATE_UI(XRCID("print_case_to_disk"         
),Skeleton::UponUpdateInapplicable           )
     EVT_UPDATE_UI(XRCID("print_spreadsheet"          
),Skeleton::UponUpdateInapplicable           )
     EVT_UPDATE_UI(XRCID("print_group_roster"         
),Skeleton::UponUpdateInapplicable           )
+    EVT_UPDATE_UI(XRCID("print_group_quote"          
),Skeleton::UponUpdateInapplicable           )
     EVT_UPDATE_UI(XRCID("paste_census"               
),Skeleton::UponUpdateInapplicable           )
     EVT_UPDATE_UI(XRCID("add_cell"                   
),Skeleton::UponUpdateInapplicable           )
     EVT_UPDATE_UI(XRCID("delete_cells"               
),Skeleton::UponUpdateInapplicable           )
diff --git a/toolbar.xrc b/toolbar.xrc
index 0a15494..4fe337d 100644
--- a/toolbar.xrc
+++ b/toolbar.xrc
@@ -118,6 +118,11 @@
         <bitmap stock_id="roster"/>
         <longhelp>Run and print all cells to a group roster</longhelp>
     </object>
+    <object class="tool" name="print_group_quote">
+        <tooltip>Print group quote</tooltip>
+        <bitmap stock_id="quote"/>
+        <longhelp>Run and print all cells to a group premium quote</longhelp>
+    </object>
     <object class="separator"/>
     <object class="tool" name="paste_census">
         <tooltip>Paste census</tooltip>



reply via email to

[Prev in Thread] Current Thread [Next in Thread]