Logo Search packages:      
Sourcecode: bbconf version File versions  Download package

menu_base.cc

/***************************************************************************
                         -- menu_base.cc --
                         -------------------
    begin                : 2001-09-01
    copyright            : (C) 2001 - 2002
    authors              : Jason Kasper (vanRijn)
                         : Ben Jansens (xOr)
    URL                  : http://bbconf.sourceforge.net
 ***************************************************************************/

/***************************************************************************
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 ***************************************************************************/
 // E_O_H_VR
/****************************************************************************
** Form implementation generated from reading ui file 'ui/menu_base.ui'
**
** Created: Mon Oct 8 12:06:20 2001
**      by:  The User Interface Compiler (uic)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/
#include "menu_base.h"

#include <qcombobox.h>
#include <qframe.h>
#include <qheader.h>
#include <qlabel.h>
#include <qlineedit.h>
#include <qlistview.h>
#include <qpushbutton.h>
#include <qlayout.h>
#include <qvariant.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qimage.h>
#include <qpixmap.h>

static const char* const image0_data[] = { 
"16 16 48 1",
". c None",
"N c #002cff",
"Q c #082cff",
"T c #183cf6",
"S c #2050ff",
"r c #2950e6",
"O c #2959ff",
"k c #3155e6",
"E c #315df6",
"w c #394cbd",
"K c #3965ee",
"B c #3965ff",
"J c #4159c5",
"z c #4175ff",
"R c #4a61c5",
"v c #4a7dff",
"A c #526dcd",
"I c #527dee",
"q c #6295ff",
"C c #6a85bd",
"s c #6a85c5",
"m c #6a91e6",
"P c #6a9dff",
"L c #6aa1ff",
"H c #73a5ff",
"f c #7ba1ee",
"D c #7baeff",
"d c #83aaee",
"y c #83b6ff",
"M c #83baff",
"e c #8b99b4",
"x c #8b9dc5",
"u c #8bbeff",
"p c #94caff",
"# c #9ca1b4",
"t c #9cceff",
"o c #9cd2ff",
"l c #a4b6cd",
"a c #a4baee",
"F c #a4cef6",
"j c #a4d2ff",
"c c #b4caee",
"n c #b4eaff",
"b c #bdcaee",
"G c #bdd6ff",
"i c #defaff",
"h c #e6faff",
"g c #f6ffff",
".....#abcde.....",
".....fghijk#....",
"....lmnopqr.....",
".....sptuvwl....",
".....xypyzA.....",
".....eypyBC.....",
".....lfpDE#.....",
".....ldtDE#.....",
".l...eFtyvCl..l.",
".sFGayuyyyHffIJ.",
".CKLMMyyDyDHBNA.",
"..COPyyyDDHzQR#.",
"...COPDDHHvNwl..",
"....CSqHqzNw#...",
".....CSvvQwl....",
"......srTA#....."};

static const char* const image1_data[] = { 
"16 16 45 1",
". c None",
"P c #1034ee",
"D c #1038ee",
"O c #183cf6",
"G c #1840ff",
"v c #295dff",
"p c #315dff",
"s c #3165ff",
"I c #3955d5",
"C c #3965ff",
"N c #396dff",
"F c #416dee",
"f c #4175ff",
"E c #4a65cd",
"K c #4a79ff",
"Q c #526dcd",
"L c #5271cd",
"M c #5285ff",
"g c #5a71c5",
"B c #5a89f6",
"q c #6279c5",
"J c #628dff",
"A c #6295ff",
"z c #6299ff",
"l c #6a79bd",
"w c #6a89d5",
"H c #6a99f6",
"o c #6a9dff",
"# c #7385bd",
"n c #73a5ff",
"y c #73aaff",
"b c #7ba1f6",
"k c #7baeff",
"j c #8bbeff",
"m c #94c6ff",
"u c #94ceff",
"i c #9ccaff",
"e c #9cd2ff",
"a c #b4c6f6",
"x c #bde6ff",
"t c #d5e2ff",
"d c #defaff",
"c c #e6eaff",
"h c #e6ffff",
"r c #ffffff",
"......#ab#......",
".....#cdefg.....",
"....#chijkfl....",
"...#chmknnopq...",
"..#rhjnnoooosl..",
".#thunnoooooovl.",
".wxiynoooozABCD.",
".#.#.#fooCE.b##.",
"......FyzG#.....",
"......BkAv#.....",
".....#Hkopg.....",
".....#kyACI.....",
".....#jnAfD.....",
".....wkAJKD.....",
".....LMNssO#....",
".....#DDDPQ....."};


/* 
 *  Constructs a MenuEditorBase which is a child of 'parent', with the 
 *  name 'name' and widget flags set to 'f' 
 */
MenuEditorBase::MenuEditorBase( QWidget* parent,  const char* name, WFlags fl )
    : QWidget( parent, name, fl )
{
    QPixmap image0( ( const char** ) image0_data );
    QPixmap image1( ( const char** ) image1_data );
    if ( !name )
      setName( "MenuEditorBase" );
    resize( 547, 506 ); 
    setCaption( tr( "Menu Editor" ) );
    MenuEditorBaseLayout = new QGridLayout( this ); 
    MenuEditorBaseLayout->setSpacing( 6 );
    MenuEditorBaseLayout->setMargin( 11 );

    Line1 = new QFrame( this, "Line1" );
    Line1->setFrameStyle( QFrame::HLine | QFrame::Sunken );

    MenuEditorBaseLayout->addMultiCellWidget( Line1, 1, 1, 0, 3 );

    TextLabel1 = new QLabel( this, "TextLabel1" );
    TextLabel1->setText( tr( "Menu Title/Header:" ) );

    MenuEditorBaseLayout->addWidget( TextLabel1, 0, 0 );

    titleText = new QLineEdit( this, "titleText" );

    MenuEditorBaseLayout->addMultiCellWidget( titleText, 0, 0, 1, 3 );

    Line1_2 = new QFrame( this, "Line1_2" );
    Line1_2->setFrameStyle( QFrame::HLine | QFrame::Sunken );

    MenuEditorBaseLayout->addMultiCellWidget( Line1_2, 8, 8, 0, 3 );
    QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding );
    MenuEditorBaseLayout->addItem( spacer, 5, 2 );

    itemNew = new QPushButton( this, "itemNew" );
    itemNew->setText( tr( "&New Item" ) );
    QToolTip::add(  itemNew, tr( "Add an item" ) );
    QWhatsThis::add(  itemNew, tr( "<b>Adds a new item to the list.</b><p>The item will be inserted at the top of the list and can be moved using the up- and down-buttons.</p>" ) );

    MenuEditorBaseLayout->addMultiCellWidget( itemNew, 2, 2, 2, 3 );

    itemNewSub = new QPushButton( this, "itemNewSub" );
    itemNewSub->setText( tr( "New &Child Item" ) );
    QToolTip::add(  itemNewSub, tr( "Add a subitem" ) );
    QWhatsThis::add(  itemNewSub, tr( "<b>Create a new subitem for the selected item.</b><p>New subitems are inserted at the top of the list of subitems, and new levels will be created automatically.</p>" ) );

    MenuEditorBaseLayout->addMultiCellWidget( itemNewSub, 3, 3, 2, 3 );

    itemDelete = new QPushButton( this, "itemDelete" );
    itemDelete->setText( tr( "&Delete Item" ) );
    QToolTip::add(  itemDelete, tr( "Delete item" ) );
    QWhatsThis::add(  itemDelete, tr( "<b>Deletes the selected item.</b><p>Existing subitems are deleted, too.</p>" ) );

    MenuEditorBaseLayout->addMultiCellWidget( itemDelete, 4, 4, 2, 3 );

    menuList = new QListView( this, "menuList" );
    menuList->addColumn( tr( "Blackbox Menu" ) );
    menuList->header()->setClickEnabled( FALSE, menuList->header()->count() - 1 );
    menuList->addColumn( tr( "   Item Type" ) );
    menuList->header()->setClickEnabled( FALSE, menuList->header()->count() - 1 );
    menuList->header()->setResizeEnabled( FALSE, menuList->header()->count() - 1 );
    menuList->addColumn( tr( "   Item Data" ) );
    menuList->header()->setClickEnabled( FALSE, menuList->header()->count() - 1 );
    menuList->header()->setResizeEnabled( FALSE, menuList->header()->count() - 1 );
    menuList->addColumn( tr( "   Item Type Name" ) );
    menuList->header()->setClickEnabled( FALSE, menuList->header()->count() - 1 );
    menuList->header()->setResizeEnabled( FALSE, menuList->header()->count() - 1 );
    QListViewItem * item_2 = new QListViewItem( menuList, 0 );
    item_2->setOpen( TRUE );
    QListViewItem * item = new QListViewItem( item_2, 0 );
    item->setText( 0, tr( "Subitem" ) );
    item->setText( 1, tr( "1" ) );
    item_2->setText( 0, tr( "New Submenu" ) );
    item_2->setText( 1, tr( "5" ) );

    item = new QListViewItem( menuList, item_2 );
    item->setText( 0, tr( "New Main Item" ) );
    item->setText( 1, tr( "1" ) );

    menuList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)3, (QSizePolicy::SizeType)3, menuList->sizePolicy().hasHeightForWidth() ) );
    menuList->setAcceptDrops( TRUE );
    menuList->setRootIsDecorated( TRUE );

    MenuEditorBaseLayout->addMultiCellWidget( menuList, 2, 7, 0, 1 );

    itemDown = new QPushButton( this, "itemDown" );
    itemDown->setText( tr( "" ) );
    itemDown->setPixmap( image0 );
    QToolTip::add(  itemDown, tr( "Move down" ) );
    QWhatsThis::add(  itemDown, tr( "<b>Move the selected item down.</b><p>The item will be moved within the hierarchy level.</p>" ) );

    MenuEditorBaseLayout->addMultiCellWidget( itemDown, 7, 7, 2, 3 );

    itemUp = new QPushButton( this, "itemUp" );
    itemUp->setText( tr( "" ) );
    itemUp->setPixmap( image1 );
    QToolTip::add(  itemUp, tr( "Move up" ) );
    QWhatsThis::add(  itemUp, tr( "<b>Move the selected item up.</b><p>The item will be moved within the hierarchy level.</p>" ) );

    MenuEditorBaseLayout->addMultiCellWidget( itemUp, 6, 6, 2, 3 );

    descriptionText = new QLineEdit( this, "descriptionText" );
    descriptionText->setEnabled( TRUE );

    MenuEditorBaseLayout->addMultiCellWidget( descriptionText, 9, 9, 1, 2 );

    descriptionLabel = new QLabel( this, "descriptionLabel" );
    descriptionLabel->setText( tr( "Description:" ) );

    MenuEditorBaseLayout->addWidget( descriptionLabel, 9, 0 );

    typeDropdown = new QComboBox( FALSE, this, "typeDropdown" );
    typeDropdown->insertItem( tr( "No Action (spacer)" ) );
    typeDropdown->insertItem( tr( "Execute Command" ) );
    typeDropdown->insertItem( tr( "Style (activate a new style)" ) );
    typeDropdown->insertItem( tr( "Options Menu (Config)" ) );
    typeDropdown->insertItem( tr( "Include a File" ) );
    typeDropdown->insertItem( tr( "Submenu" ) );
    typeDropdown->insertItem( tr( "Styles Directory" ) );
    typeDropdown->insertItem( tr( "Styles Menu" ) );
    typeDropdown->insertItem( tr( "Start/Restart Window Manager" ) );
    typeDropdown->insertItem( tr( "Reconfigure Blackbox" ) );
    typeDropdown->insertItem( tr( "Workspaces Menu" ) );
    typeDropdown->insertItem( tr( "Exit Blackbox" ) );
    typeDropdown->setEnabled( FALSE );

    MenuEditorBaseLayout->addMultiCellWidget( typeDropdown, 11, 11, 1, 3 );

    TextLabel4 = new QLabel( this, "TextLabel4" );
    TextLabel4->setText( tr( "Type:" ) );

    MenuEditorBaseLayout->addWidget( TextLabel4, 11, 0 );

    dataText = new QLineEdit( this, "dataText" );
    dataText->setEnabled( FALSE );

    MenuEditorBaseLayout->addMultiCellWidget( dataText, 10, 10, 1, 2 );

    dataLabel = new QLabel( this, "dataLabel" );
    dataLabel->setText( tr( "Data:" ) );

    MenuEditorBaseLayout->addWidget( dataLabel, 10, 0 );

    descriptionBrowse = new QPushButton( this, "descriptionBrowse" );
    descriptionBrowse->setEnabled( TRUE );
    descriptionBrowse->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, descriptionBrowse->sizePolicy().hasHeightForWidth() ) );
    descriptionBrowse->setMaximumSize( QSize( 20, 26 ) );
    descriptionBrowse->setText( tr( "..." ) );

    MenuEditorBaseLayout->addWidget( descriptionBrowse, 9, 3 );

    dataBrowse = new QPushButton( this, "dataBrowse" );
    dataBrowse->setEnabled( FALSE );
    dataBrowse->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)0, (QSizePolicy::SizeType)0, dataBrowse->sizePolicy().hasHeightForWidth() ) );
    dataBrowse->setMaximumSize( QSize( 20, 26 ) );
    dataBrowse->setText( tr( "..." ) );

    MenuEditorBaseLayout->addWidget( dataBrowse, 10, 3 );

    // signals and slots connections
    connect( titleText, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
    connect( titleText, SIGNAL( textChanged(const QString&) ), this, SLOT( titleTextChanged(const QString&) ) );
    connect( itemNew, SIGNAL( clicked() ), this, SLOT( modified() ) );
    connect( itemNew, SIGNAL( clicked() ), this, SLOT( itemNewClicked() ) );
    connect( itemNewSub, SIGNAL( clicked() ), this, SLOT( modified() ) );
    connect( itemNewSub, SIGNAL( clicked() ), this, SLOT( itemNewSubClicked() ) );
    connect( itemDelete, SIGNAL( clicked() ), this, SLOT( itemDeleteClicked() ) );
    connect( itemDelete, SIGNAL( clicked() ), this, SLOT( modified() ) );
    connect( itemUp, SIGNAL( clicked() ), this, SLOT( modified() ) );
    connect( itemUp, SIGNAL( clicked() ), this, SLOT( itemUpClicked() ) );
    connect( itemDown, SIGNAL( clicked() ), this, SLOT( itemDownClicked() ) );
    connect( itemDown, SIGNAL( clicked() ), this, SLOT( modified() ) );
    connect( descriptionText, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
    connect( descriptionText, SIGNAL( textChanged(const QString&) ), this, SLOT( descriptionTextChanged(const QString&) ) );
    connect( dataText, SIGNAL( textChanged(const QString&) ), this, SLOT( dataTextChanged(const QString&) ) );
    connect( dataText, SIGNAL( textChanged(const QString&) ), this, SLOT( modified() ) );
    connect( menuList, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( menuSelectionChanged(QListViewItem*) ) );
    connect( typeDropdown, SIGNAL( activated(int) ), this, SLOT( typeDropdownChanged(int) ) );
    connect( typeDropdown, SIGNAL( activated(const QString&) ), this, SLOT( modified() ) );
    connect( descriptionBrowse, SIGNAL( clicked() ), this, SLOT( descriptionBrowseClicked() ) );
    connect( dataBrowse, SIGNAL( clicked() ), this, SLOT( dataBrowseClicked() ) );

    // tab order
    setTabOrder( menuList, descriptionText );
    setTabOrder( descriptionText, dataText );
    setTabOrder( dataText, dataBrowse );
    setTabOrder( dataBrowse, typeDropdown );
    setTabOrder( typeDropdown, titleText );
    setTabOrder( titleText, itemNew );
    setTabOrder( itemNew, itemNewSub );
    setTabOrder( itemNewSub, itemDelete );
    setTabOrder( itemDelete, itemUp );
    setTabOrder( itemUp, itemDown );
}

/*  
 *  Destroys the object and frees any allocated resources
 */
MenuEditorBase::~MenuEditorBase()
{
    // no need to delete child widgets, Qt does it all for us
}

void MenuEditorBase::dataBrowseClicked()
{
    qWarning( "MenuEditorBase::dataBrowseClicked(): Not implemented yet!" );
}

void MenuEditorBase::dataTextChanged(const QString&)
{
    qWarning( "MenuEditorBase::dataTextChanged(const QString&): Not implemented yet!" );
}

void MenuEditorBase::descriptionTextChanged(const QString&)
{
    qWarning( "MenuEditorBase::descriptionTextChanged(const QString&): Not implemented yet!" );
}

void MenuEditorBase::itemDeleteClicked()
{
    qWarning( "MenuEditorBase::itemDeleteClicked(): Not implemented yet!" );
}

void MenuEditorBase::itemDownClicked()
{
    qWarning( "MenuEditorBase::itemDownClicked(): Not implemented yet!" );
}

void MenuEditorBase::itemLeftClicked()
{
    qWarning( "MenuEditorBase::itemLeftClicked(): Not implemented yet!" );
}

void MenuEditorBase::itemNewClicked()
{
    qWarning( "MenuEditorBase::itemNewClicked(): Not implemented yet!" );
}

void MenuEditorBase::itemNewSubClicked()
{
    qWarning( "MenuEditorBase::itemNewSubClicked(): Not implemented yet!" );
}

void MenuEditorBase::itemRightClicked()
{
    qWarning( "MenuEditorBase::itemRightClicked(): Not implemented yet!" );
}

void MenuEditorBase::itemUpClicked()
{
    qWarning( "MenuEditorBase::itemUpClicked(): Not implemented yet!" );
}

void MenuEditorBase::menuSelectionChanged(QListViewItem*)
{
    qWarning( "MenuEditorBase::menuSelectionChanged(QListViewItem*): Not implemented yet!" );
}

void MenuEditorBase::modified()
{
    qWarning( "MenuEditorBase::modified(): Not implemented yet!" );
}

void MenuEditorBase::descriptionBrowseClicked()
{
    qWarning( "MenuEditorBase::descriptionBrowseClicked(): Not implemented yet!" );
}

void MenuEditorBase::titleTextChanged(const QString&)
{
    qWarning( "MenuEditorBase::titleTextChanged(const QString&): Not implemented yet!" );
}

void MenuEditorBase::typeDropdownChanged(int)
{
    qWarning( "MenuEditorBase::typeDropdownChanged(int): Not implemented yet!" );
}


Generated by  Doxygen 1.6.0   Back to index