Logo Search packages:      
Sourcecode: qgis version File versions

qgsgrasseditbase.cpp

/****************************************************************************
** Form implementation generated from reading ui file 'qgsgrasseditbase.ui'
**
** Created: Tue Nov 30 19:34:32 2004
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.3   edited Nov 24 2003 $)
**
** WARNING! All changes made in this file will be lost!
****************************************************************************/

#include "qgsgrasseditbase.h"

#include <qvariant.h>
#include <qpushbutton.h>
#include <qtabwidget.h>
#include <qwidget.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <qlineedit.h>
#include <qspinbox.h>
#include <qheader.h>
#include <qlistview.h>
#include <qframe.h>
#include <qtable.h>
#include <qlayout.h>
#include <qtooltip.h>
#include <qwhatsthis.h>
#include <qaction.h>
#include <qmenubar.h>
#include <qpopupmenu.h>
#include <qtoolbar.h>
#include <qimage.h>
#include <qpixmap.h>

#include "qgsgrasseditbase.ui.h"
static const char* const image0_data[] = { 
"22 22 2 1",
". c None",
"# c #303030",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"....................#.",
"...................#..",
"......##...........#..",
".....#..#.........#...",
"....#....#........#...",
"...#......#......#....",
"...#......#......#....",
"..#........#....#.....",
"..#.........#..#......",
".#...........##.......",
".#....................",
"......................",
"......................",
"......................",
"......................"};

static const char* const image1_data[] = { 
"22 22 4 1",
". c None",
"b c #a0a0a0",
"a c #ffae57",
"# c #ffffff",
"......................",
"......................",
"......................",
"......................",
"........#####.........",
"......#########.......",
".....###########......",
".....###########......",
"......#########.......",
"......aaaaaaaaa.......",
"......aaaaaaaaa.bbb...",
"......aaaaaaaaaa...b..",
".....aaaaaaaaaaa...b..",
".....aaaaaaaaaaa...b..",
".....aaaaaaaaaaa...b..",
".....aaaaaaaaaaa..b...",
".....aaaaaaaaaaa..b...",
"......aaaaaaaaa.bb....",
".......aaaaaaa........",
"........aaaaa.........",
"......................",
"......................"};

static const char* const image2_data[] = { 
"22 22 2 1",
". c None",
"# c #303030",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"...........#..........",
"...........#..........",
"...........#..........",
"...........#..........",
".......#########......",
"...........#..........",
"...........#..........",
"...........#..........",
"...........#..........",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................"};

static const char* const image3_data[] = { 
"22 22 2 1",
". c None",
"# c #303030",
"......................",
".........####.........",
".......##....##.......",
".....##........##.....",
"....#............#....",
"...#..............#...",
"...#..............#...",
"..#................#..",
"..#................#..",
".#..................#.",
".#..................#.",
".#..................#.",
".#..................#.",
"..#................#..",
"..#................#..",
"...#..............#...",
"...#..............#...",
"....#............#....",
".....##........##.....",
".......##....##.......",
".........####.........",
"......................"};

static const char* const image4_data[] = { 
"22 22 3 1",
". c None",
"a c #303030",
"# c #808080",
"......................",
".........####.........",
".......##....##.......",
".....##........##.....",
"....#............#....",
"...#..............#...",
"...#..............#...",
"..#........a.......#..",
"..#........a.......#..",
".#.........a........#.",
".#.........a........#.",
".#.....aaaaaaaaa....#.",
".#.........a........#.",
"..#........a.......#..",
"..#........a.......#..",
"...#.......a......#...",
"...#..............#...",
"....#............#....",
".....##........##.....",
".......##....##.......",
".........####.........",
"......................"};

static const char* const image5_data[] = { 
"22 22 3 1",
". c None",
"a c #303030",
"# c #ff0000",
"......................",
"......................",
"..........###.........",
"..........###.........",
"..........###.........",
".........#...#........",
"........#.....#.......",
".......#.......#......",
"......#.........#.....",
"...aaa...........aaa..",
"aaaaaa...........aaaaa",
"...aaa...........aaa..",
"......a.........a.....",
".......a.......a......",
"........a.....a.......",
".........a...a........",
"..........aaa.........",
"..........aaa.........",
"..........aaa.........",
"......................",
"......................",
"......................"};

static const char* const image6_data[] = { 
"22 22 3 1",
". c None",
"# c #303030",
"a c #ff0000",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"...###...........###..",
"######aaaaaaaaaaa#####",
"...###...........###..",
"......#.........#.....",
".......#.......#......",
"........#.....#.......",
".........#...#........",
"..........###.........",
"..........###.........",
"..........###.........",
"......................",
"......................",
"......................"};

static const char* const image7_data[] = { 
"22 22 3 1",
". c None",
"a c #303030",
"# c #ff0000",
"......................",
"......................",
"..........###.........",
"..........###.........",
"..........###.........",
".........#...#........",
"........#.....#.......",
".......#.......#......",
"......#.........#.....",
"...aaa...........aaa..",
"aaaaaaaaaaaaaaaaaaaaaa",
"...aaa...........aaa..",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................"};

static const char* const image8_data[] = { 
"22 22 5 1",
". c None",
"# c #0000ff",
"a c #303030",
"c c #9e770b",
"b c #ff0000",
"......................",
"......................",
"......................",
"......................",
"......................",
".......##.............",
".......###............",
"........###...........",
".........###..........",
"...aaa....###....aaa..",
"aaaaaaaaa..###.aaaaaaa",
"...aaa......###..aaa..",
"..........b..###......",
".........bb...###...c.",
"......b..b.....###.cc.",
"......b....b....##cc..",
"........b..b.....ccc..",
"........b.......ccccc.",
"...............cc..ccc",
"....................cc",
"......................",
"......................"};

static const char* const image9_data[] = { 
"22 22 3 1",
". c None",
"a c #303030",
"# c #ff0000",
"....................#.",
"...................#..",
"......##...........#..",
".....#..#.........#...",
"....#..a.#........#...",
"...#...a..#......#....",
"...#...a..#......#....",
"..#....a...#....#.....",
"..#..a.a.a..#..#......",
".#...aaaaa...##.......",
".#....aaa.............",
".......a............a.",
"...................a..",
"......aa...........a..",
".....a..a.........a...",
"....a....a........a...",
"...a......a......a....",
"...a......a......a....",
"..a........a....a.....",
"..a.........a..a......",
".a...........aa.......",
".a...................."};

static const char* const image10_data[] = { 
"22 22 2 1",
". c None",
"# c #ff0000",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"......................",
"....................#.",
"...................#..",
"......##...........#..",
".....#..#.........#...",
"....#....#........#...",
"...#......#......#....",
"...#......#......#....",
"..#........#....#.....",
"..#.........#..#......",
".#...........##.......",
".#....................",
"......................",
"......................",
"......................",
"......................"};

static const char* const image11_data[] = { 
"22 22 2 1",
". c None",
"# c #303030",
"......................",
"..##################..",
"..#....#...........#..",
"..#.##.#.#########.#..",
"..#....#...........#..",
"..##################..",
"..#....#...........#..",
"..#.##.#.#########.#..",
"..#....#...........#..",
"..##################..",
"..#....#...........#..",
"..#.##.#.#########.#..",
"..#....#...........#..",
"..##################..",
"..#....#...........#..",
"..#.##.#.#########.#..",
"..#....#...........#..",
"..##################..",
"......................",
"......................",
"......................",
"......................"};


/*
 *  Constructs a QgsGrassEditBase as a child of 'parent', with the
 *  name 'name' and widget flags set to 'f'.
 *
 */
QgsGrassEditBase::QgsGrassEditBase( QWidget* parent, const char* name, WFlags fl )
    : QMainWindow( parent, name, fl ),
      image0( (const char **) image0_data ),
      image1( (const char **) image1_data ),
      image2( (const char **) image2_data ),
      image3( (const char **) image3_data ),
      image4( (const char **) image4_data ),
      image5( (const char **) image5_data ),
      image6( (const char **) image6_data ),
      image7( (const char **) image7_data ),
      image8( (const char **) image8_data ),
      image9( (const char **) image9_data ),
      image10( (const char **) image10_data ),
      image11( (const char **) image11_data )
{
    (void)statusBar();
    if ( !name )
      setName( "QgsGrassEditBase" );
    setCentralWidget( new QWidget( this, "qt_central_widget" ) );
    QgsGrassEditBaseLayout = new QVBoxLayout( centralWidget(), 5, 5, "QgsGrassEditBaseLayout"); 

    tabWidget = new QTabWidget( centralWidget(), "tabWidget" );
    tabWidget->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, tabWidget->sizePolicy().hasHeightForWidth() ) );

    tab = new QWidget( tabWidget, "tab" );
    tabLayout = new QGridLayout( tab, 1, 1, 11, 6, "tabLayout"); 

    textLabel3 = new QLabel( tab, "textLabel3" );

    tabLayout->addWidget( textLabel3, 0, 0 );

    catLabel = new QLabel( tab, "catLabel" );

    tabLayout->addWidget( catLabel, 1, 0 );

    textLabel2 = new QLabel( tab, "textLabel2" );

    tabLayout->addWidget( textLabel2, 1, 2 );

    mCatModeBox = new QComboBox( FALSE, tab, "mCatModeBox" );

    tabLayout->addMultiCellWidget( mCatModeBox, 0, 0, 1, 3 );

    mCatEntry = new QLineEdit( tab, "mCatEntry" );

    tabLayout->addWidget( mCatEntry, 1, 1 );

    mFieldBox = new QComboBox( FALSE, tab, "mFieldBox" );
    mFieldBox->setEditable( TRUE );
    mFieldBox->setDuplicatesEnabled( FALSE );

    tabLayout->addWidget( mFieldBox, 1, 3 );
    tabWidget->insertTab( tab, QString("") );

    tab_2 = new QWidget( tabWidget, "tab_2" );
    tabLayout_2 = new QGridLayout( tab_2, 1, 1, 11, 6, "tabLayout_2"); 

    textLabel4 = new QLabel( tab_2, "textLabel4" );

    tabLayout_2->addWidget( textLabel4, 0, 0 );

    mSnapPixels = new QSpinBox( tab_2, "mSnapPixels" );
    mSnapPixels->setValue( 10 );

    tabLayout_2->addWidget( mSnapPixels, 0, 1 );
    tabWidget->insertTab( tab_2, QString("") );

    tab_3 = new QWidget( tabWidget, "tab_3" );
    tabLayout_3 = new QHBoxLayout( tab_3, 11, 6, "tabLayout_3"); 

    symbologyList = new QListView( tab_3, "symbologyList" );
    symbologyList->addColumn( tr( "Column 1" ) );
    symbologyList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, symbologyList->sizePolicy().hasHeightForWidth() ) );
    symbologyList->setMinimumSize( QSize( 20, 20 ) );
    symbologyList->setResizeMode( QListView::AllColumns );
    symbologyList->setTreeStepSize( 20 );
    tabLayout_3->addWidget( symbologyList );
    tabWidget->insertTab( tab_3, QString("") );

    tab_4 = new QWidget( tabWidget, "tab_4" );
    tabLayout_4 = new QVBoxLayout( tab_4, 11, 6, "tabLayout_4"); 

    frame9 = new QFrame( tab_4, "frame9" );
    frame9->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)5, 0, 0, frame9->sizePolicy().hasHeightForWidth() ) );
    frame9->setMinimumSize( QSize( 0, 30 ) );
    frame9->setMaximumSize( QSize( 32767, 30 ) );
    frame9->setFrameShape( QFrame::NoFrame );
    frame9->setFrameShadow( QFrame::Plain );
    frame9->setLineWidth( 0 );

    textLabel1 = new QLabel( frame9, "textLabel1" );
    textLabel1->setGeometry( QRect( 10, 2, 93, 26 ) );

    mTableField = new QComboBox( FALSE, frame9, "mTableField" );
    mTableField->setGeometry( QRect( 119, 1, 65, 29 ) );
    mTableField->setEditable( TRUE );
    mTableField->setDuplicatesEnabled( FALSE );
    tabLayout_4->addWidget( frame9 );

    mAttributeTable = new QTable( tab_4, "mAttributeTable" );
    mAttributeTable->setLineWidth( 2 );
    mAttributeTable->setResizePolicy( QTable::Manual );
    mAttributeTable->setNumRows( 0 );
    mAttributeTable->setNumCols( 3 );
    tabLayout_4->addWidget( mAttributeTable );

    frame3 = new QFrame( tab_4, "frame3" );
    frame3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, frame3->sizePolicy().hasHeightForWidth() ) );
    frame3->setMinimumSize( QSize( 0, 35 ) );
    frame3->setMaximumSize( QSize( 32767, 35 ) );
    frame3->setFrameShape( QFrame::NoFrame );
    frame3->setFrameShadow( QFrame::Plain );
    frame3->setLineWidth( 0 );
    frame3Layout = new QHBoxLayout( frame3, 3, 3, "frame3Layout"); 

    mAddColumnButton = new QPushButton( frame3, "mAddColumnButton" );
    mAddColumnButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, mAddColumnButton->sizePolicy().hasHeightForWidth() ) );
    frame3Layout->addWidget( mAddColumnButton );

    mAlterTableButton = new QPushButton( frame3, "mAlterTableButton" );
    mAlterTableButton->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)7, 0, 0, mAlterTableButton->sizePolicy().hasHeightForWidth() ) );
    frame3Layout->addWidget( mAlterTableButton );
    tabLayout_4->addWidget( frame3 );
    tabWidget->insertTab( tab_4, QString("") );
    QgsGrassEditBaseLayout->addWidget( tabWidget );

    // actions
    newLineAction = new QAction( this, "newLineAction" );
    newLineAction->setIconSet( QIconSet( image0 ) );
    closeEditAction = new QAction( this, "closeEditAction" );
    closeEditAction->setIconSet( QIconSet( image1 ) );
    newPointAction = new QAction( this, "newPointAction" );
    newPointAction->setIconSet( QIconSet( image2 ) );
    newBoundaryAction = new QAction( this, "newBoundaryAction" );
    newBoundaryAction->setIconSet( QIconSet( image3 ) );
    newCentroidAction = new QAction( this, "newCentroidAction" );
    newCentroidAction->setIconSet( QIconSet( image4 ) );
    moveVertexAction = new QAction( this, "moveVertexAction" );
    moveVertexAction->setIconSet( QIconSet( image5 ) );
    addVertexAction = new QAction( this, "addVertexAction" );
    addVertexAction->setIconSet( QIconSet( image6 ) );
    deleteVertexAction = new QAction( this, "deleteVertexAction" );
    deleteVertexAction->setIconSet( QIconSet( image7 ) );
    splitLineAction = new QAction( this, "splitLineAction" );
    splitLineAction->setIconSet( QIconSet( image8 ) );
    moveLineAction = new QAction( this, "moveLineAction" );
    moveLineAction->setIconSet( QIconSet( image9 ) );
    deleteLineAction = new QAction( this, "deleteLineAction" );
    deleteLineAction->setIconSet( QIconSet( image10 ) );
    editCatsAction = new QAction( this, "editCatsAction" );
    editAttributesAction = new QAction( this, "editAttributesAction" );
    editAttributesAction->setIconSet( QIconSet( image11 ) );


    // toolbars
    newToolBar = new QToolBar( QString(""), this, DockTop ); 

    newPointAction->addTo( newToolBar );
    newLineAction->addTo( newToolBar );
    newBoundaryAction->addTo( newToolBar );
    newCentroidAction->addTo( newToolBar );
    editVertexToolBar = new QToolBar( QString(""), this, DockTop ); 

    moveVertexAction->addTo( editVertexToolBar );
    addVertexAction->addTo( editVertexToolBar );
    deleteVertexAction->addTo( editVertexToolBar );
    editLineToolBar = new QToolBar( QString(""), this, DockTop ); 

    moveLineAction->addTo( editLineToolBar );
    splitLineAction->addTo( editLineToolBar );
    deleteLineAction->addTo( editLineToolBar );
    editLineToolBar->addSeparator();
    editAttributesAction->addTo( editLineToolBar );
    mainToolBar = new QToolBar( QString(""), this, DockTop ); 

    closeEditAction->addTo( mainToolBar );

    languageChange();
    resize( QSize(419, 272).expandedTo(minimumSizeHint()) );
    clearWState( WState_Polished );

    // signals and slots connections
    connect( addVertexAction, SIGNAL( activated() ), this, SLOT( addVertex() ) );
    connect( closeEditAction, SIGNAL( activated() ), this, SLOT( closeEdit() ) );
    connect( deleteLineAction, SIGNAL( activated() ), this, SLOT( deleteLine() ) );
    connect( deleteVertexAction, SIGNAL( activated() ), this, SLOT( deleteVertex() ) );
    connect( moveLineAction, SIGNAL( activated() ), this, SLOT( moveLine() ) );
    connect( moveVertexAction, SIGNAL( activated() ), this, SLOT( moveVertex() ) );
    connect( newBoundaryAction, SIGNAL( activated() ), this, SLOT( newBoundary() ) );
    connect( newCentroidAction, SIGNAL( activated() ), this, SLOT( newCentroid() ) );
    connect( newLineAction, SIGNAL( activated() ), this, SLOT( newLine() ) );
    connect( newPointAction, SIGNAL( activated() ), this, SLOT( newPoint() ) );
    connect( splitLineAction, SIGNAL( activated() ), this, SLOT( splitLine() ) );
    connect( editAttributesAction, SIGNAL( activated() ), this, SLOT( editAttributes() ) );
    connect( mFieldBox, SIGNAL( activated(int) ), this, SLOT( fieldChanged() ) );
    connect( mCatModeBox, SIGNAL( activated(int) ), this, SLOT( catModeChanged() ) );
    connect( mAddColumnButton, SIGNAL( clicked() ), this, SLOT( addColumn() ) );
    connect( mAlterTableButton, SIGNAL( clicked() ), this, SLOT( alterTable() ) );
    connect( mTableField, SIGNAL( activated(int) ), this, SLOT( attributeTableFieldChanged() ) );
}

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

/*
 *  Sets the strings of the subwidgets using the current
 *  language.
 */
void QgsGrassEditBase::languageChange()
{
    setCaption( tr( "GRASS Edit" ) );
    textLabel3->setText( tr( "Mode" ) );
    catLabel->setText( tr( "Category" ) );
    textLabel2->setText( tr( "Field (layer)" ) );
    mCatModeBox->setCurrentItem( 0 );
    tabWidget->changeTab( tab, tr( "Category" ) );
    textLabel4->setText( tr( "Snapping in screen pixels" ) );
    tabWidget->changeTab( tab_2, tr( "Settings" ) );
    symbologyList->header()->setLabel( 0, tr( "Column 1" ) );
    symbologyList->clear();
    QListViewItem * item = new QListViewItem( symbologyList, 0 );
    item->setText( 0, tr( "New Item" ) );

    tabWidget->changeTab( tab_3, tr( "Symbology" ) );
    textLabel1->setText( tr( "Field (layer)" ) );
    mAddColumnButton->setText( tr( "Add Column" ) );
    mAlterTableButton->setText( tr( "Create / Alter Table" ) );
    tabWidget->changeTab( tab_4, tr( "Table" ) );
    newLineAction->setText( tr( "New line" ) );
    newLineAction->setMenuText( tr( "New line" ) );
    newLineAction->setAccel( tr( "F2" ) );
    closeEditAction->setText( tr( "Close" ) );
    closeEditAction->setMenuText( tr( "Close" ) );
    newPointAction->setText( tr( "New point" ) );
    newPointAction->setAccel( tr( "F1" ) );
    newPointAction->setMenuText(tr( "New point" ));
    newBoundaryAction->setText( tr( "New boundary" ) );
    newBoundaryAction->setAccel( tr( "F3" ) );
    newBoundaryAction->setMenuText(tr( "New boundary" ));
    newCentroidAction->setText( tr( "New centroid" ) );
    newCentroidAction->setAccel( tr( "F4" ) );
    newCentroidAction->setMenuText(tr( "New centroid" ));
    moveVertexAction->setText( tr( "Move vertex" ) );
    moveVertexAction->setAccel( tr( "F5" ) );
    moveVertexAction->setMenuText(tr( "Move vertex" ));
    addVertexAction->setText( tr( "Add vertex" ) );
    addVertexAction->setAccel( tr( "F6" ) );
    addVertexAction->setMenuText(tr( "Add vertex" ));
    deleteVertexAction->setText( tr( "Delete vertex" ) );
    deleteVertexAction->setAccel( tr( "F7" ) );
    deleteVertexAction->setMenuText(tr( "Delete vertex" ));
    splitLineAction->setText( tr( "Split line" ) );
    splitLineAction->setAccel( tr( "F10" ) );
    splitLineAction->setMenuText(tr( "Split line" ));
    moveLineAction->setText( tr( "Move line" ) );
    moveLineAction->setAccel( tr( "F9" ) );
    moveLineAction->setMenuText(tr( "Move line" ));
    deleteLineAction->setText( tr( "Delete line" ) );
    deleteLineAction->setAccel( tr( "F11" ) );
    deleteLineAction->setMenuText(tr( "Delete line" ));
    editCatsAction->setText( tr( "Edit categories" ) );
    editCatsAction->setMenuText(tr( "Edit categories" ));
    editAttributesAction->setText( tr( "Edit attributes" ) );
    editAttributesAction->setMenuText(tr( "Edit attributes" ));
    newToolBar->setLabel( tr( "Tools" ) );
    editVertexToolBar->setLabel( tr( "Toolbar" ) );
    editLineToolBar->setLabel( tr( "Toolbar" ) );
    mainToolBar->setLabel( tr( "Toolbar" ) );
}


Generated by  Doxygen 1.6.0   Back to index