Update of /cvsroot/mahogany/M/src/gui
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv7161/src/gui

Modified Files:
        wxRenameDialog.cpp 
Log Message:
don't even try to rename INBOX on IMAP server (should fix 901)

Index: wxRenameDialog.cpp
===================================================================
RCS file: /cvsroot/mahogany/M/src/gui/wxRenameDialog.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -b -u -2 -r1.11 -r1.12
--- wxRenameDialog.cpp  12 Oct 2003 13:14:48 -0000      1.11
+++ wxRenameDialog.cpp  18 Sep 2004 23:03:15 -0000      1.12
@@ -64,5 +64,4 @@
    bool HasChanges() const { return m_hasChanges; }
 
-   virtual bool TransferDataToWindow();
    virtual bool TransferDataFromWindow();
 
@@ -123,9 +122,17 @@
    // init members
    m_folder = folder;
-   m_chDelim = '/';
+   m_chDelim = MailFolder::GetFolderDelimiter(m_folder);
    m_hasChanges = false;
    m_folderName = folderName;
    m_mboxName = mboxName;
 
+   bool canRenameMailbox = true;
+   if ( folder->GetType() == MF_IMAP )
+   {
+      const String& name = folder->GetFullName();
+      if ( wxStricmp(name, _T("inbox")) )
+            canRenameMailbox = false;
+   }
+
    // first create the box around everything
    wxLayoutConstraints *c;
@@ -209,4 +216,7 @@
 
    // set the initial state of the controls
+   if ( !canRenameMailbox )
+      m_chkRenameMbox->Disable();
+
    DoUpdateUI();
 
@@ -224,5 +234,6 @@
 {
    // update the mailbox path if the user doesn't want to modify it himself
-   if ( !m_chkRenameMbox->GetValue() &&
+   if ( m_chkRenameMbox->IsEnabled() &&
+         !m_chkRenameMbox->GetValue() &&
         event.GetEventObject() == m_textFolder )
    {
@@ -261,5 +272,5 @@
    CHECK_RET( m_textMbox && m_labelMbox, _T("where are our controls?") );
 
-   bool enable = m_chkRenameMbox->GetValue();
+   bool enable = m_chkRenameMbox->IsEnabled() && m_chkRenameMbox->GetValue();
 
    m_textMbox->Enable(enable);
@@ -267,24 +278,4 @@
 }
 
-bool wxFolderRenameDialog::TransferDataToWindow()
-{
-   // get the folder delimiter
-   MailFolder *mf = MailFolder::OpenFolder(m_folder, MailFolder::ReadOnly);
-   if ( !mf )
-   {
-      // probably will fail to rename too, don't even try
-      wxLogError(_("Impossible to rename the mailbox '%s'."),
-                 m_mboxName->c_str());
-
-      return false;
-   }
-
-   m_chDelim = mf->GetFolderDelimiter();
-
-   mf->DecRef();
-
-   return true;
-}
-
 bool wxFolderRenameDialog::TransferDataFromWindow()
 {



-------------------------------------------------------
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

Reply via email to