diff --git a/kmmainwidget.cpp b/kmmainwidget.cpp index 25b045306..ca26b839e 100644 --- a/kmmainwidget.cpp +++ b/kmmainwidget.cpp @@ -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); } //----------------------------------------------------------------------------- diff --git a/kmmainwidget.h b/kmmainwidget.h index 5d0076b82..87aebcd95 100644 --- a/kmmainwidget.h +++ b/kmmainwidget.h @@ -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 */ diff --git a/widgets/vacationscriptindicatorwidget.cpp b/widgets/vacationscriptindicatorwidget.cpp index 2cf935f3c..dd3ac7a98 100644 --- a/widgets/vacationscriptindicatorwidget.cpp +++ b/widgets/vacationscriptindicatorwidget.cpp @@ -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); diff --git a/widgets/vacationscriptindicatorwidget.h b/widgets/vacationscriptindicatorwidget.h index 759c16e9e..a7d9f5670 100644 --- a/widgets/vacationscriptindicatorwidget.h +++ b/widgets/vacationscriptindicatorwidget.h @@ -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();