GUI: Unhide the File->Refresh Local IMAP Cache action by moving the code from kmgroupware.cpp to kmmainwidget.cpp. The error was that no-one called KMGroupware::setupActions() and no-one caught KMGroupware::signalMenusChanged()

CCMAIL: bo@sonofthor.dk

svn path=/trunk/kdepim/; revision=262575
wilder-work
Marc Mutz 23 years ago
parent 3baeed1a13
commit cfbc884697
  1. 27
      kmgroupware.cpp
  2. 9
      kmgroupware.h
  3. 12
      kmmainwidget.cpp
  4. 1
      kmmainwidget.h
  5. 3
      kmmainwin.rc

@ -150,33 +150,6 @@ bool KMGroupware::vPartFoundAndDecoded( KMMessage* msg, QString& s )
}
void KMGroupware::slotInvalidateIMAPFolders()
{
QString str = i18n("Are you sure you want to refresh the IMAP cache?\n"
"This will remove all changes you have done locally to your folders");
QString s1 = i18n("Refresh IMAP Cache");
QString s2 = i18n("&Refresh");
if( KMessageBox::warningContinueCancel(kmkernel->mainWin(), str, s1, s2 ) == KMessageBox::Continue)
kmkernel->acctMgr()->invalidateIMAPFolders();
}
//-----------------------------------------------------------------------------
void KMGroupware::setupActions()
{
static bool actionsSetup = false;
if( !actionsSetup && kmkernel->mainWin() ) {
actionsSetup = true;
// file menu: some entries
new KAction( i18n("refresh local imap cache", "Refresh Local IMAP Cache"), 0,
this, SLOT(slotInvalidateIMAPFolders()), kmkernel->mainWin()->actionCollection(),
"invalidate_imap_cache" );
}
emit signalMenusChanged();
}
//-----------------------------------------------------------------------------
// Special Contacts methods called by KMKernel's DCOP functions
//-----------------------------------------------------------------------------

@ -45,7 +45,6 @@ public:
public:
void setupActions(); // Not const since it emits a signal
void processVCalRequest( const QCString& receiver, const QString& vCalIn,
QString& choice );
void processVCalReply( const QCString& sender, const QString& vCalIn,
@ -96,14 +95,6 @@ public:
void setMainWidget( KMMainWidget* mw ) { mMainWidget = mw; }
signals:
/** The menus were changed */
void signalMenusChanged();
public slots:
/** Delete and sync the local IMAP cache */
void slotInvalidateIMAPFolders();
protected:
// Figure out if a vCal is a todo, event or neither
enum VCalType { vCalEvent, vCalTodo, vCalUnknown };

@ -1012,6 +1012,14 @@ void KMMainWidget::slotRefreshFolder()
}
}
void KMMainWidget::slotInvalidateIMAPFolders() {
if ( KMessageBox::warningContinueCancel( this,
i18n("Are you sure you want to refresh the IMAP cache?\n"
"This will remove all changes that you have done "
"locally to your IMAP folders."),
i18n("Refresh IMAP Cache"), i18n("&Refresh") ) == KMessageBox::Continue )
kmkernel->acctMgr()->invalidateIMAPFolders();
}
//-----------------------------------------------------------------------------
void KMMainWidget::slotExpireAll() {
@ -2022,6 +2030,10 @@ void KMMainWidget::setupActions()
this, SLOT(slotExpireAll()),
actionCollection(), "expire_all_folders" );
(void) new KAction( i18n("&Refresh Local IMAP Cache"), "refresh",
this, SLOT(slotInvalidateIMAPFolders()),
actionCollection(), "file_invalidate_imap_cache" );
(void) new KAction( i18n("Empty T&rash"), 0,
KMKernel::self(), SLOT(slotEmptyTrash()),
actionCollection(), "empty_trash" );

@ -211,6 +211,7 @@ protected slots:
void slotModifyFolder();
void slotExpireFolder();
void slotExpireAll();
void slotInvalidateIMAPFolders();
void slotMarkAllAsRead();
void slotRemoveFolder();
void slotEmptyFolder();

@ -1,5 +1,5 @@
<!DOCTYPE kpartgui>
<kpartgui version="60" name="kmmainwin" >
<kpartgui version="61" name="kmmainwin" >
<MenuBar>
<Menu noMerge="1" name="file" >
<text>&amp;File</text>
@ -10,6 +10,7 @@
<Separator/>
<Action name="compact_all_folders" />
<Action name="expire_all_folders" />
<Action name="file_invalidate_imap_cache"/>
<Action name="empty_trash"/>
<Separator/>
<Action name="check_mail" />

Loading…
Cancel
Save