Q_EMIT tabCloseRequested(index);
} else if (selectedAction == renameTabAction) {
bool renamed = false;
- const QString tabNewName = QInputDialog::getText(this, i18n("Rename Tab"), i18n("New tab name:"), QLineEdit::Normal, tabText(index), &renamed);
+ const QString tabNewName = QInputDialog::getText(this, i18nc("@title:window for text input", "Rename Tab"), i18n("New tab name:"), QLineEdit::Normal, tabText(index), &renamed);
if (renamed) {
Q_EMIT tabRenamed(index, tabNewName);
void tabDragMoveEvent(int index, QDragMoveEvent *event);
void tabDropEvent(int index, QDropEvent *event);
void tabDetachRequested(int index);
- void tabRenamed(int index, const QString &name);
+ void tabRenamed(int index, const QString &label);
protected:
void dragEnterEvent(QDragEnterEvent *event) override;
void switchActiveView();
- void setTitle(const QString &name);
+ /**
+ * Overwrites the automatically generated label of this tab with @p label.
+ * This @p label will be kept until it is overwritten by calling this method again.
+ * Calling this with an empty string will restore the automatic labelling.
+ */
+ void setCustomLabel(const QString &label);
- QString title() const;
+ /**
+ * @see setCustomLabel.
+ */
+ QString customLabel() const;
Q_SIGNALS:
void activeViewChanged(DolphinViewContainer *viewContainer);
bool m_primaryViewActive;
bool m_splitViewEnabled;
bool m_active;
- QString m_title;
+ /** @see setCustomLabel(). */
+ QString m_customLabel;
};
class DolphinTabPageSplitterHandle : public QSplitterHandle
void currentTabChanged(int index);
- void renameTab(int index, const QString &name);
+ /**
+ * Calls DolphinTabPage::setCustomLabel(label) for the tab at @p index
+ * and propagates that change to the DolphinTabBar.
+ * @see DolphinTabPage::setCustomLabel().
+ */
+ void renameTab(int index, const QString &label);
protected:
void tabInserted(int index) override;