1
//---------------------------------------------------------------------------
3
// Project: OpenWalnut ( http://www.openwalnut.org )
5
// Copyright 2009 OpenWalnut Community, BSV@Uni-Leipzig and CNCF@MPI-CBS
6
// For more information see http://www.openwalnut.org/copying
8
// This file is part of OpenWalnut.
10
// OpenWalnut is free software: you can redistribute it and/or modify
11
// it under the terms of the GNU Lesser General Public License as published by
12
// the Free Software Foundation, either version 3 of the License, or
13
// (at your option) any later version.
15
// OpenWalnut is distributed in the hope that it will be useful,
16
// but WITHOUT ANY WARRANTY; without even the implied warranty of
17
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
// GNU Lesser General Public License for more details.
20
// You should have received a copy of the GNU Lesser General Public License
21
// along with OpenWalnut. If not, see <http://www.gnu.org/licenses/>.
23
//---------------------------------------------------------------------------
25
#include <QtGui/QAction>
26
#include <QtGui/QLabel>
28
#include "../WMainWindow.h"
30
#include "WQtCommandPrompt.h"
32
#include "WQtCommandPromptToolbar.h"
33
#include "WQtCommandPromptToolbar.moc"
35
WQtCommandPromptToolbar::WQtCommandPromptToolbar( const QString& title, WMainWindow* parent ):
36
QToolBar( title, parent ),
37
m_mainWindow( parent )
39
setObjectName( title );
40
this->setAllowedAreas( Qt::TopToolBarArea | Qt::BottomToolBarArea );
41
setMinimumWidth( 50 );
42
setMinimumHeight( 20 );
45
// toggle it using ":"
46
QList< QKeySequence > commandPromptShortcut;
47
commandPromptShortcut.append( QKeySequence( Qt::Key_Colon ) );
48
toggleViewAction()->setShortcuts( commandPromptShortcut );
50
QLabel* label = new QLabel( this );
51
label->setText( "<b>:</b>" );
52
label->setStyleSheet( "background: #080808;" );
55
m_prompt = new WQtCommandPrompt( this );
56
addWidget( m_prompt );
59
// TODO(ebaum): make this configurable
60
setStyleSheet( "background: #080808;"
61
"border: 2px solid #080808;"
68
// if the toolbar is triggered:
69
connect( toggleViewAction(), SIGNAL( triggered( bool ) ), this, SLOT( show() ) );
70
connect( m_prompt, SIGNAL( done() ), this, SLOT( exit() ) );
73
WQtCommandPromptToolbar::~WQtCommandPromptToolbar()
78
void WQtCommandPromptToolbar::show()
84
void WQtCommandPromptToolbar::exit()