Patch #2114 2007-07-29 19:40

yop

Default keyword and keyword case support for help plugin
Download
2114-Default_keywor.patch (23.7 KB)
Category
Plugin::FeatureAdd
Status
Accepted
Close date
2007-12-12 14:16
Assigned to
ceniza
Index: src/plugins/contrib/help_plugin/HelpConfigDialog.cpp
===================================================================
--- src/plugins/contrib/help_plugin/HelpConfigDialog.cpp    (revision 4649)
+++ src/plugins/contrib/help_plugin/HelpConfigDialog.cpp    (working copy)
@@ -34,6 +34,9 @@
   EVT_CHECKBOX(XRCID("chkDefault"), HelpConfigDialog::OnCheckbox)
   EVT_CHECKBOX(XRCID("chkExecute"), HelpConfigDialog::OnCheckboxExecute)
   EVT_CHECKBOX(XRCID("chkEmbeddedViewer"), HelpConfigDialog::OnCheckboxEmbeddedViewer)
+  // Patch by Yorgos Pagles: Add new gui elements' events for setting the new attributes
+  EVT_CHOICE(XRCID("chkCase"), HelpConfigDialog::OnCaseChoice)
+  EVT_TEXT(XRCID("textDefaultKeyword"), HelpConfigDialog::OnDefaultKeywordEntry)
 END_EVENT_TABLE()
 
 
@@ -61,6 +64,9 @@
     XRCCTRL(*this, "chkExecute", wxCheckBox)->SetValue(m_Vector[0].second.isExecutable);
     XRCCTRL(*this, "chkEmbeddedViewer", wxCheckBox)->SetValue(m_Vector[0].second.openEmbeddedViewer);
     XRCCTRL(*this, "chkDefault", wxCheckBox)->SetValue(HelpCommon::getDefaultHelpIndex() == 0);
+    // Patch by Yorgos Pagles: Show the new attributes
+    XRCCTRL(*this, "chkCase", wxChoice)->SetSelection(m_Vector[0].second.keywordCase);
+    XRCCTRL(*this, "textDefaultKeyword", wxTextCtrl)->SetValue(m_Vector[0].second.defaultKeyword);
   }
 }
 
@@ -83,6 +89,9 @@
       m_Vector[index].second.name = XRCCTRL(*this, "txtHelp", wxTextCtrl)->GetValue();
       m_Vector[index].second.isExecutable = XRCCTRL(*this, "chkExecute", wxCheckBox)->IsChecked();
       m_Vector[index].second.openEmbeddedViewer = XRCCTRL(*this, "chkEmbeddedViewer", wxCheckBox)->IsChecked();
+    // Patch by Yorgos Pagles: Write the new attributes
+    m_Vector[lst->GetSelection()].second.keywordCase = static_cast<HelpCommon::StringCase>(XRCCTRL(*this, "chkCase", wxChoice)->GetSelection());
+    m_Vector[lst->GetSelection()].second.defaultKeyword = XRCCTRL(*this, "textDefaultKeyword", wxTextCtrl)->GetValue();
   }
   else
   {
@@ -90,6 +99,9 @@
     hfa.name = XRCCTRL(*this, "txtHelp", wxTextCtrl)->GetValue();
     hfa.isExecutable = XRCCTRL(*this, "chkExecute", wxCheckBox)->IsChecked();
     hfa.openEmbeddedViewer = XRCCTRL(*this, "chkEmbeddedViewer", wxCheckBox)->IsChecked();
+      // Patch by Yorgos Pagles: Write the new attributes
+    hfa.keywordCase = static_cast<HelpCommon::StringCase>(XRCCTRL(*this, "chkCase", wxChoice)->GetSelection());
+    hfa.defaultKeyword = XRCCTRL(*this, "textDefaultKeyword", wxTextCtrl)->GetValue();
       m_Vector.push_back(make_pair(lst->GetString(index), hfa));
   }
 }
@@ -133,12 +145,18 @@
     XRCCTRL(*this, "chkExecute", wxCheckBox)->SetValue(m_Vector[lst->GetSelection()].second.isExecutable);
     XRCCTRL(*this, "chkEmbeddedViewer", wxCheckBox)->SetValue(m_Vector[lst->GetSelection()].second.openEmbeddedViewer);
     XRCCTRL(*this, "chkDefault", wxCheckBox)->SetValue(HelpCommon::getDefaultHelpIndex() == lst->GetSelection());
+    // Patch by Yorgos Pagles: Show the new attributes
+    XRCCTRL(*this, "chkCase", wxChoice)->SetSelection(m_Vector[lst->GetSelection()].second.keywordCase);
+    XRCCTRL(*this, "textDefaultKeyword", wxTextCtrl)->SetValue(m_Vector[lst->GetSelection()].second.defaultKeyword);
   }
   else
   {
       XRCCTRL(*this, "chkDefault", wxCheckBox)->SetValue(false);
       XRCCTRL(*this, "chkExecute", wxCheckBox)->SetValue(false);
       XRCCTRL(*this, "chkEmbeddedViewer", wxCheckBox)->SetValue(false);
+    // Patch by Yorgos Pagles: Show the new attributes
+    XRCCTRL(*this, "chkCase", wxChoice)->SetSelection(0);
+    XRCCTRL(*this, "textDefaultKeyword", wxTextCtrl)->SetValue(_T(""));
   }
 }
 
@@ -175,6 +193,9 @@
     XRCCTRL(*this, "chkExecute", wxCheckBox)->SetValue(false);
     XRCCTRL(*this, "chkEmbeddedViewer", wxCheckBox)->SetValue(false);
     XRCCTRL(*this, "txtHelp", wxTextCtrl)->SetValue(_T(""));
+    // Patch by Yorgos Pagles: Show the new attributes
+    XRCCTRL(*this, "chkCase", wxChoice)->SetSelection(0);
+    XRCCTRL(*this, "textDefaultKeyword", wxTextCtrl)->SetValue(_T(""));
 
     if (cbMessageBox(_("Would you like to browse for the help file?\n(Check \"Help->Plugins->Help plugin\" for a reason you would like to choose No)"), _("Browse"), wxICON_QUESTION | wxYES_NO) == wxID_YES)
     {
@@ -235,6 +256,9 @@
     XRCCTRL(*this, "txtHelp", wxTextCtrl)->SetValue(m_Vector[lst->GetSelection()].first);
     XRCCTRL(*this, "chkExecute", wxCheckBox)->SetValue(m_Vector[lst->GetSelection()].second.isExecutable);
     XRCCTRL(*this, "chkEmbeddedViewer", wxCheckBox)->SetValue(m_Vector[lst->GetSelection()].second.openEmbeddedViewer);
+    // Patch by Yorgos Pagles: Show the new attributes
+    XRCCTRL(*this, "chkCase", wxChoice)->SetSelection(m_Vector[lst->GetSelection()].second.keywordCase);
+    XRCCTRL(*this, "textDefaultKeyword", wxTextCtrl)->SetValue(m_Vector[lst->GetSelection()].second.defaultKeyword);
   }
   else
   {
@@ -242,6 +266,9 @@
     XRCCTRL(*this, "chkExecute", wxCheckBox)->SetValue(
download for full patch...
yop 2007-07-29 19:55
mandrav 2007-11-15 12:47

With the latest changes in the help plugin, this patch doesn't apply.

Could you please sync it?

yop 2007-11-20 21:09

Done against rev 4649. I only had time for some testing, the original submission was far more tested but the changes don't seem to affect the patch.

mandrav 2007-12-12 14:16

Applied, thanks :).