2
Copyright 2010 by Kurt Hindenburg <kurt.hindenburg@gmail.com>
4
This program is free software; you can redistribute it and/or modify
5
it under the terms of the GNU General Public License as published by
6
the Free Software Foundation; either version 2 of the License, or
7
(at your option) any later version.
9
This program is distributed in the hope that it will be useful,
10
but WITHOUT ANY WARRANTY; without even the implied warranty of
11
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12
GNU General Public License for more details.
14
You should have received a copy of the GNU General Public License
15
along with this program; if not, write to the Free Software
16
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21
#include "RenameTabsDialog.h"
24
#include "ui_RenameTabsDialog.h"
26
using namespace Konsole;
28
RenameTabsDialog::RenameTabsDialog(QWidget* parent)
31
setCaption(i18n("Rename Tab"));
32
setButtons( KDialog::Ok | KDialog::Cancel );
34
_ui = new Ui::RenameTabsDialog();
35
_ui->setupUi(mainWidget());
36
_ui->tabTitleEdit->setClearButtonShown(true);
37
_ui->remoteTabTitleEdit->setClearButtonShown(true);
39
// menus for local and remote tab title dynamic elements
40
TabTitleFormatAction* localTabTitleAction = new TabTitleFormatAction(this);
41
localTabTitleAction->setContext(Session::LocalTabTitle);
42
_ui->tabTitleEditButton->setMenu(localTabTitleAction->menu());
43
connect(localTabTitleAction, SIGNAL(dynamicElementSelected(const QString&)),
44
this, SLOT(insertTabTitleText(const QString&)));
46
TabTitleFormatAction* remoteTabTitleAction = new TabTitleFormatAction(this);
47
remoteTabTitleAction->setContext(Session::RemoteTabTitle);
48
_ui->remoteTabTitleEditButton->setMenu(remoteTabTitleAction->menu());
49
connect(remoteTabTitleAction, SIGNAL(dynamicElementSelected(const QString&)),
50
this, SLOT(insertRemoteTabTitleText(const QString&)));
54
RenameTabsDialog::~RenameTabsDialog()
60
void RenameTabsDialog::setTabTitleText(const QString& text)
62
_ui->tabTitleEdit->setText(text);
65
void RenameTabsDialog::setRemoteTabTitleText(const QString& text)
67
_ui->remoteTabTitleEdit->setText(text);
70
QString RenameTabsDialog::tabTitleText() const
72
return(_ui->tabTitleEdit->text());
75
QString RenameTabsDialog::remoteTabTitleText() const
77
return(_ui->remoteTabTitleEdit->text());
80
void RenameTabsDialog::insertTabTitleText(const QString& text)
82
_ui->tabTitleEdit->insert(text);
85
void RenameTabsDialog::insertRemoteTabTitleText(const QString& text)
87
_ui->remoteTabTitleEdit->insert(text);