Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22216/src/gui
Modified Files:
wxSubfoldersDialog.cpp
Log Message:
show folders not (yet) present in the tree in bold in browse subfolders dialog
Index: wxSubfoldersDialog.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxSubfoldersDialog.cpp,v
retrieving revision 1.80
retrieving revision 1.81
diff -b -u -2 -r1.80 -r1.81
--- wxSubfoldersDialog.cpp 28 Oct 2003 18:10:32 -0000 1.80
+++ wxSubfoldersDialog.cpp 21 Apr 2004 21:41:27 -0000 1.81
@@ -48,4 +48,7 @@
#endif // wxWin 2.2.6+
+// TODO: this code doesn't work yet, finish it
+//#define USE_SELECT_BUTTONS
+
// ----------------------------------------------------------------------------
// options we use here
@@ -64,4 +67,6 @@
// ----------------------------------------------------------------------------
+#ifdef USE_SELECT_BUTTONS
+
// control ids
enum
@@ -71,4 +76,6 @@
};
+#endif // USE_SELECT_BUTTONS
+
// how often to update the progress display?
static const size_t PROGRESS_THRESHOLD = 10;
@@ -144,7 +151,10 @@
String m_folderPath;
- // the folder itself
+ // the root folder itself
MFolder *m_folder;
+ // the folder whose children we're currently enumerating, may be NULL
+ MFolder *m_folderCur;
+
// and the corresponding (halfopened) mail folder
ASMailFolder *m_mailFolder;
@@ -189,7 +199,9 @@
void OnText(wxCommandEvent& event);
+#ifdef USE_SELECT_BUTTONS
// select/unselect all button handlers
void OnSelectAll(wxCommandEvent& event);
void OnUnselectAll(wxCommandEvent& event);
+#endif // USE_SELECT_BUTTONS
// called by wxFolderNameTextCtrl (see below)
@@ -342,4 +354,6 @@
m_folder = folderRoot;
m_folder->IncRef();
+ m_folderCur = folderRoot;
+ m_folderCur->IncRef();
m_mailFolder = mailFolder;
@@ -432,4 +446,10 @@
wxString reference = GetRelativePath(m_idParent);
+ // and remember this folder itself, if we already have it in the tree: we
+ // use it to check whether its children are already in the main tree
+ if ( m_folderCur )
+ m_folderCur->DecRef();
+ m_folderCur = m_folder->GetSubfolder(reference);
+
// we may need a separator
if ( !m_reference.empty() )
@@ -529,14 +549,15 @@
}
- // this doesn't make much sense... someone proposed to show
- // instead the folders already existing in the tree in bold (or
- // maybe the folders not existing in the tree) - this might be
- // more useful (TODO?)
-#if 0
- if ( attr & ASMailFolder::ATT_MARKED )
+ // show the folders not already present in the tree in bold
+ // so that new folders are immediately visible
+ //
+ // note that if the parent folder is not in the tree, its children
+ // don't risk to be there neither
+ MFolder_obj folder(m_folderCur ? m_folderCur->GetSubfolder(name)
+ : NULL);
+ if ( !folder )
{
SetItemBold(id);
}
-#endif // 0
}
}
@@ -643,4 +664,6 @@
wxSubfoldersTree::~wxSubfoldersTree()
{
+ if ( m_folderCur )
+ m_folderCur->DecRef();
m_folder->DecRef();
m_mailFolder->DecRef();
@@ -889,4 +912,5 @@
}
+
#ifdef USE_SELECT_BUTTONS
-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click
_______________________________________________
Mahogany-cvsupdates mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/mahogany-cvsupdates