[kde-doc-english] [trojita] src/Gui: GUI: show message subject in the composer's window title
Jan Kundrát
jkt at flaska.net
Wed Dec 4 16:05:31 UTC 2013
Git commit 64d89fdab53b27e027e3257bd83d967c3d11a8f4 by Jan Kundrát.
Committed on 27/11/2013 at 17:24.
Pushed by jkt into branch 'master'.
GUI: show message subject in the composer's window title
M +10 -0 src/Gui/ComposeWidget.cpp
M +1 -0 src/Gui/ComposeWidget.h
M +0 -3 src/Gui/ComposeWidget.ui
http://commits.kde.org/trojita/64d89fdab53b27e027e3257bd83d967c3d11a8f4
diff --git a/src/Gui/ComposeWidget.cpp b/src/Gui/ComposeWidget.cpp
index 6954646..f1f4752 100644
--- a/src/Gui/ComposeWidget.cpp
+++ b/src/Gui/ComposeWidget.cpp
@@ -125,6 +125,7 @@ ComposeWidget::ComposeWidget(MainWindow *mainWindow, QSettings *settings, MSA::M
connect(ui->mailText, SIGNAL(urlsAdded(QList<QUrl>)), SLOT(slotAttachFiles(QList<QUrl>)));
connect(ui->mailText, SIGNAL(sendRequest()), SLOT(send()));
connect(ui->mailText, SIGNAL(textChanged()), SLOT(setMessageUpdated()));
+ connect(ui->subject, SIGNAL(textChanged(QString)), SLOT(updateWindowTitle()));
FromAddressProxyModel *proxy = new FromAddressProxyModel(this);
proxy->setSourceModel(m_mainWindow->senderIdentitiesModel());
@@ -1053,5 +1054,14 @@ void ComposeWidget::setMessageUpdated()
m_messageEverEdited = m_messageUpdated = true;
}
+void ComposeWidget::updateWindowTitle()
+{
+ if (ui->subject->text().isEmpty()) {
+ setWindowTitle(tr("Compose Mail"));
+ } else {
+ setWindowTitle(tr("%1 - Compose Mail").arg(ui->subject->text()));
+ }
+}
+
}
diff --git a/src/Gui/ComposeWidget.h b/src/Gui/ComposeWidget.h
index 3a114e8..c1cc4a9 100644
--- a/src/Gui/ComposeWidget.h
+++ b/src/Gui/ComposeWidget.h
@@ -103,6 +103,7 @@ private slots:
void slotAttachFiles(QList<QUrl> urls);
void slotUpdateSignature();
+ void updateWindowTitle();
void autoSaveDraft();
void setMessageUpdated();
diff --git a/src/Gui/ComposeWidget.ui b/src/Gui/ComposeWidget.ui
index 6adec64..559a849 100644
--- a/src/Gui/ComposeWidget.ui
+++ b/src/Gui/ComposeWidget.ui
@@ -10,9 +10,6 @@
<height>362</height>
</rect>
</property>
- <property name="windowTitle">
- <string>Compose Mail</string>
- </property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QSplitter" name="verticalSplitter">
More information about the kde-doc-english
mailing list