~ubuntu-branches/ubuntu/trusty/kdebase/trusty

« back to all changes in this revision

Viewing changes to apps/konsole/src/RenameTabsDialog.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2010-11-25 16:00:47 UTC
  • mfrom: (1.1.53 upstream)
  • Revision ID: james.westby@ubuntu.com-20101125160047-bsycodsp50o8su5s
Tags: 4:4.5.80-0ubuntu1
* New upstream beta release
* Drop kubuntu_06_simple_aboutpage.diff, didn't apply and no point
  keeping a distro patch to an app we don't ship by default
* Drop kubuntu_23_konqueror_spinner_in_toolbar.diff now upstream

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright 2010 by Kurt Hindenburg <kurt.hindenburg@gmail.com>
 
3
 
 
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.
 
8
 
 
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.
 
13
 
 
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
 
17
    02110-1301  USA.
 
18
*/
 
19
 
 
20
// Own
 
21
#include "RenameTabsDialog.h"
 
22
 
 
23
// Konsole
 
24
#include "ui_RenameTabsDialog.h"
 
25
 
 
26
using namespace Konsole;
 
27
 
 
28
RenameTabsDialog::RenameTabsDialog(QWidget* parent)
 
29
: KDialog(parent)
 
30
{
 
31
    setCaption(i18n("Rename Tab"));
 
32
    setButtons( KDialog::Ok | KDialog::Cancel );
 
33
 
 
34
    _ui = new Ui::RenameTabsDialog();
 
35
    _ui->setupUi(mainWidget());
 
36
    _ui->tabTitleEdit->setClearButtonShown(true);
 
37
    _ui->remoteTabTitleEdit->setClearButtonShown(true);
 
38
 
 
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&)));
 
45
 
 
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&)));
 
51
 
 
52
}
 
53
 
 
54
RenameTabsDialog::~RenameTabsDialog()
 
55
{
 
56
    delete _ui;
 
57
}
 
58
 
 
59
 
 
60
void RenameTabsDialog::setTabTitleText(const QString& text)
 
61
{
 
62
    _ui->tabTitleEdit->setText(text);
 
63
}
 
64
 
 
65
void RenameTabsDialog::setRemoteTabTitleText(const QString& text)
 
66
{
 
67
    _ui->remoteTabTitleEdit->setText(text);
 
68
}
 
69
 
 
70
QString RenameTabsDialog::tabTitleText() const
 
71
{
 
72
    return(_ui->tabTitleEdit->text());
 
73
}
 
74
 
 
75
QString RenameTabsDialog::remoteTabTitleText() const
 
76
{
 
77
    return(_ui->remoteTabTitleEdit->text());
 
78
}
 
79
 
 
80
void RenameTabsDialog::insertTabTitleText(const QString& text)
 
81
{
 
82
    _ui->tabTitleEdit->insert(text);
 
83
}
 
84
 
 
85
void RenameTabsDialog::insertRemoteTabTitleText(const QString& text)
 
86
{
 
87
    _ui->remoteTabTitleEdit->insert(text);
 
88
}
 
89