Allow to open vacation server page

wilder-work
Montel Laurent 12 years ago
parent 946b9e0905
commit cc13b177c0
  1. 6
      kmmainwidget.cpp
  2. 2
      kmmainwidget.h
  3. 9
      widgets/vacationscriptindicatorwidget.cpp
  4. 7
      widgets/vacationscriptindicatorwidget.h

@ -319,7 +319,7 @@ K_GLOBAL_STATIC( KMMainWidget::PtrList, theMainWidgetList )
KStatusBar *sb = mainWin ? mainWin->statusBar() : 0;
mVacationScriptIndicator = new KMail::VacationScriptIndicatorWidget( sb );
mVacationScriptIndicator->hide();
connect( mVacationScriptIndicator, SIGNAL(clicked()), SLOT(slotEditVacation()) );
connect( mVacationScriptIndicator, SIGNAL(clicked(QString)), SLOT(slotEditVacation(QString)) );
if ( KSieveUi::Util::checkOutOfOfficeOnStartup() )
QTimer::singleShot( 0, this, SLOT(slotCheckVacation()) );
@ -2347,13 +2347,13 @@ void KMMainWidget::slotCheckVacation()
connect(mVacationManager, SIGNAL(editVacation()), SLOT(slotEditVacation()) );
}
void KMMainWidget::slotEditVacation()
void KMMainWidget::slotEditVacation(const QString &serverName)
{
if ( !kmkernel->askToGoOnline() ) {
return;
}
mVacationManager->slotEditVacation();
mVacationManager->slotEditVacation(serverName);
}
//-----------------------------------------------------------------------------

@ -225,7 +225,7 @@ class KMAIL_EXPORT KMMainWidget : public QWidget
/** Trigger the dialog for editing out-of-office scripts. */
void slotEditVacation();
void slotEditVacation(const QString &serverName = QString());
/** Adds if not existing/removes if existing the tag identified by @p aLabel
in all selected messages */

@ -24,7 +24,8 @@
using namespace KMail;
ServerLabel::ServerLabel(const QString &serverName, QWidget * parent)
: QLabel( parent )
: QLabel( parent ),
mServerName(serverName)
{
setToolTip(serverName);
setPixmap(KIcon( QLatin1String("network-server") ).pixmap( 16, 16 ) );
@ -38,7 +39,7 @@ ServerLabel::~ServerLabel()
void ServerLabel::mouseReleaseEvent(QMouseEvent * event)
{
Q_EMIT clicked();
Q_EMIT clicked(mServerName);
QLabel::mouseReleaseEvent( event );
}
@ -96,12 +97,12 @@ void VacationScriptIndicatorWidget::createIndicator()
mBoxLayout = new QHBoxLayout;
mBoxLayout->setMargin(0);
mBoxLayout->setSpacing(0);
mInfo = new VacationLabel(i18n("Out of office reply active on server"));
mInfo = new VacationLabel(i18np("Out of office reply active on server", "Out of office reply active on servers", mServerActive.count()));
connect(mInfo, SIGNAL(clicked()), this, SIGNAL(clicked()));
mBoxLayout->addWidget(mInfo);
Q_FOREACH (const QString &server, mServerActive) {
ServerLabel *lab = new ServerLabel(server);
connect(lab, SIGNAL(clicked()), this, SIGNAL(clicked()));
connect(lab, SIGNAL(clicked(QString)), this, SIGNAL(clicked(QString)));
mBoxLayout->addWidget(lab);
}
setLayout(mBoxLayout);

@ -31,10 +31,13 @@ public:
~ServerLabel();
Q_SIGNALS:
void clicked();
void clicked(const QString &serverName);
protected:
void mouseReleaseEvent(QMouseEvent *event);
private:
QString mServerName;
};
class VacationLabel : public QLabel
@ -65,7 +68,7 @@ public:
bool hasVacationScriptActive() const;
Q_SIGNALS:
void clicked();
void clicked(const QString &serverName = QString());
private:
void createIndicator();

Loading…
Cancel
Save