Update of /cvsroot/mahogany/M/src/gui
In directory usw-pr-cvs1:/tmp/cvs-serv22197/src/gui
Modified Files:
wxFolderView.cpp wxMDialogs.cpp wxMainFrame.cpp wxMenuDefs.cpp
Added Files:
wxSearchDialog.cpp
Log Message:
started changing the search dialog to work with multiple folders (but for now it's
completely broken)
***** Error reading new file: [Errno 2] No such file or directory: 'wxSearchDialog.cpp'
Index: wxFolderView.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxFolderView.cpp,v
retrieving revision 1.598
retrieving revision 1.599
diff -b -u -2 -r1.598 -r1.599
--- wxFolderView.cpp 21 Jul 2002 19:28:08 -0000 1.598
+++ wxFolderView.cpp 22 Jul 2002 00:02:30 -0000 1.599
@@ -64,5 +64,4 @@
#include "MFolder.h"
#include "MFCache.h"
-#include "MSearch.h"
#include "FolderMonitor.h" // for case WXK_F5
@@ -3944,16 +3943,4 @@
}
-void
-wxFolderView::SearchMessages(void)
-{
- SearchCriterium criterium;
-
- if ( ConfigureSearchMessages(&criterium,GetProfile(),NULL) )
- {
- Ticket t = m_ASMailFolder->SearchMessages(&criterium, this);
- m_TicketList->Add(t);
- }
-}
-
void wxFolderView::ExpungeMessages()
{
@@ -4293,8 +4280,4 @@
switch ( cmd )
{
- case WXMENU_MSG_SEARCH:
- SearchMessages();
- break;
-
case WXMENU_MSG_EXPUNGE:
ExpungeMessages();
Index: wxMDialogs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMDialogs.cpp,v
retrieving revision 1.376
retrieving revision 1.377
diff -b -u -2 -r1.376 -r1.377
--- wxMDialogs.cpp 17 Jul 2002 00:06:29 -0000 1.376
+++ wxMDialogs.cpp 22 Jul 2002 00:02:31 -0000 1.377
@@ -106,6 +106,4 @@
extern const MOption MP_HEIGHT;
extern const MOption MP_LASTTIP;
-extern const MOption MP_MSGS_SEARCH_ARG;
-extern const MOption MP_MSGS_SEARCH_CRIT;
extern const MOption MP_NNTPHOST_LOGIN;
extern const MOption MP_SHOWTIPS;
@@ -1593,171 +1591,4 @@
if ( configPath )
wxMFrame::SavePosition(configPath, &dlg);
-}
-
-
-
-#include "gui/wxDialogLayout.h"
-
-//-----------------------------------------------------------------------------
-
-static wxString searchCriteria[] =
-{
- gettext_noop("Full Message"),
- gettext_noop("Message Content"),
- gettext_noop("Message Header"),
- gettext_noop("Subject Field"),
- gettext_noop("To Field"),
- gettext_noop("From Field"),
- gettext_noop("CC Field"),
-};
-
-#define SEARCH_CRIT_INVERT_FLAG 0x1000
-#define SEARCH_CRIT_MASK 0x0FFF
-
-// defining it like this makes it much more difficult to forget to update it
-static const size_t NUM_SEARCHCRITERIA = WXSIZEOF(searchCriteria);
-
-class wxMessageSearchDialog : public wxOptionsPageSubdialog
-{
-public:
- wxMessageSearchDialog(SearchCriterium *crit,
- Profile *profile, wxWindow *parent);
-
- // reset the selected options to their default values
- virtual bool TransferDataFromWindow();
- virtual bool TransferDataToWindow();
- bool WasChanged(void)
- {
- return m_Criterium != m_OldCriterium ||
- m_Arg != m_OldArg;
- };
-
-protected:
-
- void UpdateCritStruct(void)
- {
- m_CritStruct->m_What = (SearchCriterium::Type)
- m_Choices->GetSelection();
- m_CritStruct->m_Invert = m_Invert->GetValue();
- m_CritStruct->m_Key = m_Keyword->GetValue();
- }
- SearchCriterium *m_CritStruct;
- wxChoice *m_Choices;
- wxCheckBox *m_Invert;
- wxPTextEntry *m_Keyword;
- int m_OldCriterium;
- int m_Criterium;
- String m_Arg,
- m_OldArg;
-};
-
-wxMessageSearchDialog::wxMessageSearchDialog(SearchCriterium *crit,
- Profile *profile,
- wxWindow *parent)
- : wxOptionsPageSubdialog(profile,parent,
- _("Search folder for messages"),
- "MessageSearchDialog")
-{
- ASSERT(crit);
- m_CritStruct = crit;
- wxStaticBox *box = CreateStdButtonsAndBox(
- _("Message search criteria"), FALSE, MH_DIALOG_SEARCHMSGS);
-
- wxClientDC dc(this);
- dc.SetFont(wxSystemSettings::GetSystemFont(wxSYS_DEFAULT_GUI_FONT));
-
- wxLayoutConstraints *c;
-
- wxStaticText *critlabel = new wxStaticText(this, -1, _("&Search for text in"));
- c = new wxLayoutConstraints;
- c->left.SameAs(box, wxLeft, 2*LAYOUT_X_MARGIN);
- c->width.AsIs();
- c->top.SameAs(box, wxTop, 5*LAYOUT_Y_MARGIN);
- c->height.AsIs();
- critlabel->SetConstraints(c);
-
- m_Choices = new wxPChoice("SearchWhere", this, -1, wxDefaultPosition,
- wxDefaultSize, NUM_SEARCHCRITERIA,
- searchCriteria);
- c = new wxLayoutConstraints;
- c->left.RightOf(critlabel, 2*LAYOUT_X_MARGIN);
- c->right.SameAs(box, wxRight, 2*LAYOUT_X_MARGIN);
- c->centreY.SameAs(critlabel, wxCentreY);
- c->height.AsIs();
- m_Choices->SetConstraints(c);
-
- wxStaticText *keylabel = new wxStaticText(this, -1, _("Search &for:"));
- c = new wxLayoutConstraints;
- c->left.SameAs(box, wxLeft, 2*LAYOUT_X_MARGIN);
- c->width.AsIs();
- c->top.Below(m_Choices, 3*LAYOUT_Y_MARGIN);
- c->height.AsIs();
- keylabel->SetConstraints(c);
-
- m_Keyword = new wxPTextEntry("SearchFor", this, -1);
- c = new wxLayoutConstraints;
- c->left.RightOf(keylabel, 2*LAYOUT_X_MARGIN);
- c->right.SameAs(box, wxRight, 2*LAYOUT_X_MARGIN);
- c->centreY.SameAs(keylabel, wxCentreY);
- c->height.AsIs();
- m_Keyword->SetConstraints(c);
-
- m_Invert = new wxCheckBox(this, -1, _("&Invert selection"));
- c = new wxLayoutConstraints;
- c->left.SameAs(box, wxLeft, 2*LAYOUT_X_MARGIN);
- c->right.SameAs(box, wxRight, 2*LAYOUT_X_MARGIN);
- c->top.Below(keylabel, 3*LAYOUT_Y_MARGIN);
- c->height.AsIs();
- m_Invert->SetConstraints(c);
-
- SetDefaultSize(380, 310);
-
- TransferDataToWindow();
- m_OldCriterium = m_Criterium;
- m_OldArg = m_Arg;
-}
-
-
-bool wxMessageSearchDialog::TransferDataFromWindow()
-{
- m_Criterium = m_Choices->GetSelection();
- if(m_Invert->GetValue() != 0)
- m_Criterium |= SEARCH_CRIT_INVERT_FLAG;
-
- m_Arg = m_Keyword->GetValue();
- GetProfile()->writeEntry(MP_MSGS_SEARCH_CRIT, m_Criterium);
- GetProfile()->writeEntry(MP_MSGS_SEARCH_ARG, m_Arg);
-
- UpdateCritStruct();
- return TRUE;
-}
-
-bool wxMessageSearchDialog::TransferDataToWindow()
-{
- m_Criterium = READ_CONFIG(GetProfile(), MP_MSGS_SEARCH_CRIT);
- m_Arg = READ_CONFIG_TEXT(GetProfile(), MP_MSGS_SEARCH_ARG);
-
- if ( m_Criterium & SEARCH_CRIT_MASK )
- m_Choices->SetSelection(m_Criterium & SEARCH_CRIT_MASK);
-
- m_Invert->SetValue((m_Criterium & SEARCH_CRIT_INVERT_FLAG) != 0);
-
- if ( !m_Arg.empty() )
- m_Keyword->SetValue(m_Arg);
-
- UpdateCritStruct();
-
- m_Choices->SetFocus();
-
- return TRUE;
-}
-
-/* Configuration dialog for searching messages. */
-extern
-bool ConfigureSearchMessages(SearchCriterium *crit,
- Profile *profile, wxWindow *parent)
-{
- wxMessageSearchDialog dlg(crit, profile, parent);
- return dlg.ShowModal() == wxID_OK;
}
Index: wxMainFrame.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMainFrame.cpp,v
retrieving revision 1.150
retrieving revision 1.151
diff -b -u -2 -r1.150 -r1.151
--- wxMainFrame.cpp 17 Jul 2002 19:22:52 -0000 1.150
+++ wxMainFrame.cpp 22 Jul 2002 00:02:31 -0000 1.151
@@ -43,4 +43,6 @@
#include "MFolder.h"
+#include "MSearch.h"
+
#include "gui/wxMainFrame.h"
#include "gui/wxMApp.h"
@@ -562,4 +564,17 @@
}
SafeDecRef(newfolder);
+ }
+ break;
+
+ case WXMENU_FOLDER_SEARCH:
+ {
+ SearchCriterium crit;
+
+ Profile_obj profile = GetFolderProfile();
+ if ( ConfigureSearchMessages(&crit, profile, this) )
+ {
+ //Ticket t = m_ASMailFolder->SearchMessages(&crit, this);
+ //m_TicketList->Add(t);
+ }
}
break;
Index: wxMenuDefs.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxMenuDefs.cpp,v
retrieving revision 1.188
retrieving revision 1.189
diff -b -u -2 -r1.188 -r1.189
--- wxMenuDefs.cpp 17 Jul 2002 00:06:29 -0000 1.188
+++ wxMenuDefs.cpp 22 Jul 2002 00:02:31 -0000 1.189
@@ -273,5 +273,5 @@
// folder
- // available accels: DGHJKMQTVWXYZ
+ // available accels: DGHJKMQVWXYZ
{ WXMENU_FOLDER_OPEN, gettext_noop("&Open...\tCtrl-O"), gettext_noop("Open
an existing message folder") , wxITEM_NORMAL },
{ WXMENU_FOLDER_OPEN_RO, gettext_noop("Open read-onl&y..."), gettext_noop("Open
a folder in read only mode") , wxITEM_NORMAL },
@@ -285,5 +285,5 @@
{ WXMENU_SEPARATOR, "", "" ,
wxITEM_NORMAL },
{ WXMENU_FOLDER_UPDATE, gettext_noop("&Update"), gettext_noop("Update the shown
status of this folder"), wxITEM_NORMAL },
- { WXMENU_FOLDER_UPDATEALL, gettext_noop("Update &subtree..."),
gettext_noop("Update the status of all folders under the currently selected one in the
folder tree"), wxITEM_NORMAL },
+ { WXMENU_FOLDER_UPDATEALL, gettext_noop("Update sub&tree..."),
+gettext_noop("Update the status of all folders under the currently selected one in
+the folder tree"), wxITEM_NORMAL },
{ WXMENU_SEPARATOR, "", "" ,
wxITEM_NORMAL },
{ WXMENU_FOLDER_IMPORTTREE,gettext_noop("&Import file folders..."),
@@ -291,6 +291,7 @@
{ WXMENU_FOLDER_BROWSESUB, gettext_noop("&Browse..."), gettext_noop("Show
subfolders of the current folder") , wxITEM_NORMAL },
{ WXMENU_SEPARATOR, "", "" ,
wxITEM_NORMAL },
- { WXMENU_FOLDER_FILTERS, gettext_noop("&Filters..."), gettext_noop("Edit the
filters to use for current folder") , wxITEM_NORMAL },
+ { WXMENU_FOLDER_SEARCH, gettext_noop("&Search..."), gettext_noop("Search for
+the messages in folder(s)") , wxITEM_NORMAL },
{ WXMENU_SEPARATOR, "", "" ,
wxITEM_NORMAL },
+ { WXMENU_FOLDER_FILTERS, gettext_noop("&Filters..."), gettext_noop("Edit the
+filters to use for current folder") , wxITEM_NORMAL },
{ WXMENU_FOLDER_PROP, gettext_noop("&Properties..."), gettext_noop("Show the
properties of the current folder") , wxITEM_NORMAL },
@@ -407,5 +408,4 @@
{ WXMENU_MSG_NEXT_UNREAD, gettext_noop("&Next unread\tCtrl-U"),
gettext_noop("Select next unread message") , wxITEM_NORMAL },
{ WXMENU_MSG_NEXT_FLAGGED, gettext_noop("N&ext flagged"), gettext_noop("Select
next flagged message") , wxITEM_NORMAL },
- { WXMENU_MSG_SEARCH, gettext_noop("Searc&h..."), gettext_noop("Search and select
messages") , wxITEM_NORMAL },
{ WXMENU_SEPARATOR, "", "" ,
wxITEM_NORMAL },
{ WXMENU_MSG_FLAG, gettext_noop("Fla&g\tCtrl-I"), gettext_noop("Mark message
as flagged/unflagged") , wxITEM_NORMAL },
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates