Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv1181/src/gui
Modified Files:
wxOptionsDlg.cpp
Log Message:
really fixed identity editing: now the pages in the identity dialog are of correct
(dynamically determined) type; in particular the field of disabled authentificators
may now be set at identity level
Index: wxOptionsDlg.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxOptionsDlg.cpp,v
retrieving revision 1.415
retrieving revision 1.416
diff -b -u -2 -r1.415 -r1.416
--- wxOptionsDlg.cpp 18 Sep 2004 18:59:45 -0000 1.415
+++ wxOptionsDlg.cpp 19 Sep 2004 15:41:16 -0000 1.416
@@ -787,7 +787,4 @@
protected:
- // handle button clicks
- void OnButton(wxCommandEvent& event);
-
enum
{
@@ -810,5 +807,4 @@
wxOptionsPageDesc *m_aPages;
- DECLARE_EVENT_TABLE()
DECLARE_NO_COPY_CLASS(wxIdentityOptionsDialog)
};
@@ -887,8 +883,4 @@
-BEGIN_EVENT_TABLE(wxIdentityOptionsDialog, wxCustomOptionsDialog)
- EVT_BUTTON(-1, wxIdentityOptionsDialog::OnButton)
-END_EVENT_TABLE()
-
// ============================================================================
// data: both of these arrays *must* be in sync with ConfigFields enum!
@@ -3233,4 +3225,20 @@
}
+wxOptionsPageStandard::wxOptionsPageStandard(wxNotebook *parent,
+ const wxChar *title,
+ Profile *profile,
+ FieldInfoArray aFields,
+ ConfigValuesArray aDefaults,
+ size_t nFields,
+ size_t nOffset,
+ int helpId,
+ int image)
+ : wxOptionsPage(aFields - nOffset,
+ aDefaults - nOffset,
+ nOffset, nOffset + nFields,
+ parent, title, profile, helpId, image)
+{
+}
+
// ----------------------------------------------------------------------------
// wxOptionsPageCompose
@@ -3250,33 +3258,25 @@
void wxOptionsPageCompose::OnButton(wxCommandEvent& event)
{
- if ( !HandleButton(m_Profile, event.GetEventObject(), this) )
- event.Skip();
-}
-
-/* static */ bool
-wxOptionsPageCompose::HandleButton(Profile *profile,
- wxObject *obj,
- wxOptionsPage *win)
-{
bool dirty = false;
- if ( win->IsControl(obj, ConfigField_ComposeHeaders) )
+ wxObject * const obj = event.GetEventObject();
+ if ( IsControl(obj, ConfigField_ComposeHeaders) )
{
// create and show the "outgoing headers" config dialog
- dirty = ConfigureComposeHeaders(profile, win);
+ dirty = ConfigureComposeHeaders(m_Profile, this);
}
- else if ( win->IsControl(obj, ConfigField_ComposeTemplates) )
+ else if ( IsControl(obj, ConfigField_ComposeTemplates) )
{
- dirty = ConfigureTemplates(profile, win);
+ dirty = ConfigureTemplates(m_Profile, this);
}
- else if ( win->IsControl(obj, ConfigField_XFaceFile) )
+ else if ( IsControl(obj, ConfigField_XFaceFile) )
{
- if ( PickXFaceDialog(profile, win) )
+ if ( PickXFaceDialog(m_Profile, this) )
{
dirty = true;
wxXFaceButton *btn = (wxXFaceButton*)obj;
- btn->SetFile(READ_CONFIG_BOOL(profile, MP_COMPOSE_USE_XFACE)
- ? READ_CONFIG(profile, MP_COMPOSE_XFACE_FILE)
+ btn->SetFile(READ_CONFIG_BOOL(m_Profile, MP_COMPOSE_USE_XFACE)
+ ? READ_CONFIG(m_Profile, MP_COMPOSE_XFACE_FILE)
: String());
}
@@ -3284,5 +3284,7 @@
else // not our button
{
- return false;
+ event.Skip();
+
+ return;
}
@@ -3291,5 +3293,5 @@
// something changed - make us dirty
wxOptionsEditDialog *
- dialog = GET_PARENT_OF_CLASS(win, wxOptionsEditDialog);
+ dialog = GET_PARENT_OF_CLASS(this, wxOptionsEditDialog);
if ( dialog )
@@ -3302,6 +3304,4 @@
}
}
-
- return true;
}
@@ -4475,15 +4475,5 @@
// the page ctor will add it to the notebook
const wxOptionsPageDesc& desc = pageDesc[n];
- wxOptionsPageDynamic *page = new wxOptionsPageDynamic(
- this,
-
wxGetTranslation(desc.title),
- profile,
- desc.aFields,
- desc.aDefaults,
- desc.nFields,
- desc.nOffset,
- desc.helpId,
- n // image index
- );
+ wxOptionsPage *page = desc.New(this, profile, n);
page->Layout();
}
@@ -4501,5 +4491,5 @@
for ( size_t n = 0; n < nPages; n++ )
{
- m_aImages[n] = pageDesc[n].image;
+ m_aImages[n] = pageDesc[n].GetImage();
}
@@ -4608,5 +4598,6 @@
wxOptionsPageStandard::ms_aConfigDefaults + nOffset,
ConfigField_NetworkLast - ConfigField_NetworkFirst,
- nOffset
+ nOffset,
+ wxOptionsPageNetwork::New
);
@@ -4621,24 +4612,9 @@
wxOptionsPageStandard::ms_aConfigDefaults + nOffset,
ConfigField_ComposeLast - ConfigField_ComposeFirst,
- nOffset
+ nOffset,
+ wxOptionsPageCompose::New
);
}
-void wxIdentityOptionsDialog::OnButton(wxCommandEvent& event)
-{
- // for now the only buttons we have in this dialog are in the compose page
- wxObject * const btn = event.GetEventObject();
- if ( !wxOptionsPageCompose::HandleButton
- (
- GetProfile(),
- btn,
- (wxOptionsPage *)m_notebook->GetPage(Page_Compose)
- ) )
- {
- // must be one of the std buttons
- event.Skip();
- }
-}
-
// ----------------------------------------------------------------------------
// wxRestoreDefaultsDialog implementation
-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates