~ubuntu-branches/ubuntu/quantal/qgis/quantal

« back to all changes in this revision

Viewing changes to plugins/gps_importer/qgsgpsdevicedialogbase.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Steve Halasz
  • Date: 2004-12-21 09:46:27 UTC
  • Revision ID: james.westby@ubuntu.com-20041221094627-r9lb6mlz2o3yp8gn
Tags: upstream-0.6.0
ImportĀ upstreamĀ versionĀ 0.6.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/****************************************************************************
 
2
** Form implementation generated from reading ui file 'qgsgpsdevicedialogbase.ui'
 
3
**
 
4
** Created: Sat Dec 4 08:59:06 2004
 
5
**      by: The User Interface Compiler ($Id: qt/main.cpp   3.3.3   edited Nov 24 2003 $)
 
6
**
 
7
** WARNING! All changes made in this file will be lost!
 
8
****************************************************************************/
 
9
 
 
10
#include "qgsgpsdevicedialogbase.h"
 
11
 
 
12
#include <qvariant.h>
 
13
#include <qframe.h>
 
14
#include <qlabel.h>
 
15
#include <qlineedit.h>
 
16
#include <qpushbutton.h>
 
17
#include <qlistbox.h>
 
18
#include <qlayout.h>
 
19
#include <qtooltip.h>
 
20
#include <qwhatsthis.h>
 
21
 
 
22
/*
 
23
 *  Constructs a QgsGPSDeviceDialogBase as a child of 'parent', with the
 
24
 *  name 'name' and widget flags set to 'f'.
 
25
 *
 
26
 *  The dialog will by default be modeless, unless you set 'modal' to
 
27
 *  TRUE to construct a modal dialog.
 
28
 */
 
29
QgsGPSDeviceDialogBase::QgsGPSDeviceDialogBase( QWidget* parent, const char* name, bool modal, WFlags fl )
 
30
    : QDialog( parent, name, modal, fl )
 
31
{
 
32
    if ( !name )
 
33
        setName( "QgsGPSDeviceDialogBase" );
 
34
    setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)1, 0, 0, sizePolicy().hasHeightForWidth() ) );
 
35
    setProperty( "modal", QVariant( TRUE, 0 ) );
 
36
    QgsGPSDeviceDialogBaseLayout = new QGridLayout( this, 1, 1, 11, 6, "QgsGPSDeviceDialogBaseLayout"); 
 
37
 
 
38
    line2 = new QFrame( this, "line2" );
 
39
    line2->setFrameShape( QFrame::VLine );
 
40
    line2->setFrameShadow( QFrame::Sunken );
 
41
    line2->setFrameShape( QFrame::VLine );
 
42
 
 
43
    QgsGPSDeviceDialogBaseLayout->addMultiCellWidget( line2, 0, 6, 1, 1 );
 
44
 
 
45
    textLabel3 = new QLabel( this, "textLabel3" );
 
46
    textLabel3->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)1, (QSizePolicy::SizeType)5, 0, 0, textLabel3->sizePolicy().hasHeightForWidth() ) );
 
47
 
 
48
    QgsGPSDeviceDialogBaseLayout->addMultiCellWidget( textLabel3, 0, 0, 2, 3 );
 
49
 
 
50
    textLabel4 = new QLabel( this, "textLabel4" );
 
51
 
 
52
    QgsGPSDeviceDialogBaseLayout->addMultiCellWidget( textLabel4, 1, 1, 2, 3 );
 
53
 
 
54
    leDownloadCmd = new QLineEdit( this, "leDownloadCmd" );
 
55
    leDownloadCmd->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 2, 0, leDownloadCmd->sizePolicy().hasHeightForWidth() ) );
 
56
 
 
57
    QgsGPSDeviceDialogBaseLayout->addMultiCellWidget( leDownloadCmd, 1, 1, 4, 5 );
 
58
 
 
59
    leDeviceName = new QLineEdit( this, "leDeviceName" );
 
60
    leDeviceName->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 2, 0, leDeviceName->sizePolicy().hasHeightForWidth() ) );
 
61
 
 
62
    QgsGPSDeviceDialogBaseLayout->addMultiCellWidget( leDeviceName, 0, 0, 4, 5 );
 
63
 
 
64
    leUploadCmd = new QLineEdit( this, "leUploadCmd" );
 
65
    leUploadCmd->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)7, (QSizePolicy::SizeType)0, 2, 0, leUploadCmd->sizePolicy().hasHeightForWidth() ) );
 
66
 
 
67
    QgsGPSDeviceDialogBaseLayout->addMultiCellWidget( leUploadCmd, 2, 2, 4, 5 );
 
68
 
 
69
    textLabel5 = new QLabel( this, "textLabel5" );
 
70
 
 
71
    QgsGPSDeviceDialogBaseLayout->addMultiCellWidget( textLabel5, 2, 2, 2, 3 );
 
72
 
 
73
    textLabel1 = new QLabel( this, "textLabel1" );
 
74
    textLabel1->setTextFormat( QLabel::RichText );
 
75
    textLabel1->setAlignment( int( QLabel::WordBreak | QLabel::AlignVCenter ) );
 
76
 
 
77
    QgsGPSDeviceDialogBaseLayout->addMultiCellWidget( textLabel1, 3, 6, 3, 5 );
 
78
 
 
79
    pbUpdateDevice = new QPushButton( this, "pbUpdateDevice" );
 
80
 
 
81
    QgsGPSDeviceDialogBaseLayout->addWidget( pbUpdateDevice, 6, 0 );
 
82
 
 
83
    pbDeleteDevice = new QPushButton( this, "pbDeleteDevice" );
 
84
 
 
85
    QgsGPSDeviceDialogBaseLayout->addWidget( pbDeleteDevice, 5, 0 );
 
86
 
 
87
    pbNewDevice = new QPushButton( this, "pbNewDevice" );
 
88
 
 
89
    QgsGPSDeviceDialogBaseLayout->addWidget( pbNewDevice, 4, 0 );
 
90
 
 
91
    lbDeviceList = new QListBox( this, "lbDeviceList" );
 
92
    lbDeviceList->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)7, 0, 0, lbDeviceList->sizePolicy().hasHeightForWidth() ) );
 
93
 
 
94
    QgsGPSDeviceDialogBaseLayout->addMultiCellWidget( lbDeviceList, 0, 3, 0, 0 );
 
95
 
 
96
    pbClose = new QPushButton( this, "pbClose" );
 
97
    pbClose->setDefault( TRUE );
 
98
 
 
99
    QgsGPSDeviceDialogBaseLayout->addWidget( pbClose, 7, 5 );
 
100
    spacer2 = new QSpacerItem( 370, 20, QSizePolicy::Expanding, QSizePolicy::Minimum );
 
101
    QgsGPSDeviceDialogBaseLayout->addMultiCell( spacer2, 7, 7, 0, 4 );
 
102
    languageChange();
 
103
    resize( QSize(488, 405).expandedTo(minimumSizeHint()) );
 
104
    clearWState( WState_Polished );
 
105
 
 
106
    // signals and slots connections
 
107
    connect( pbNewDevice, SIGNAL( clicked() ), this, SLOT( slotNewDevice() ) );
 
108
    connect( pbDeleteDevice, SIGNAL( clicked() ), this, SLOT( slotDeleteDevice() ) );
 
109
    connect( pbUpdateDevice, SIGNAL( clicked() ), this, SLOT( slotUpdateDevice() ) );
 
110
    connect( pbClose, SIGNAL( clicked() ), this, SLOT( close() ) );
 
111
    connect( lbDeviceList, SIGNAL( selectionChanged() ), this, SLOT( slotSelectionChanged() ) );
 
112
}
 
113
 
 
114
/*
 
115
 *  Destroys the object and frees any allocated resources
 
116
 */
 
117
QgsGPSDeviceDialogBase::~QgsGPSDeviceDialogBase()
 
118
{
 
119
    // no need to delete child widgets, Qt does it all for us
 
120
}
 
121
 
 
122
/*
 
123
 *  Sets the strings of the subwidgets using the current
 
124
 *  language.
 
125
 */
 
126
void QgsGPSDeviceDialogBase::languageChange()
 
127
{
 
128
    setCaption( tr( "GPS Device Editor" ) );
 
129
    textLabel3->setText( tr( "Device name:" ) );
 
130
    textLabel4->setText( tr( "Download command:" ) );
 
131
    QToolTip::add( leDownloadCmd, tr( "This is the command that will be used to download GPS data from the device. %in and %out will be replaced by the port and the GPX filename, respectively." ) );
 
132
    QToolTip::add( leDeviceName, tr( "This is the name of the device as it will appear in the lists" ) );
 
133
    QToolTip::add( leUploadCmd, tr( "This is the command that will be used to upload GPS data to the device. %in and %out will be replaced by the GPX filename and the port, respectively." ) );
 
134
    textLabel5->setText( tr( "Upload command:" ) );
 
135
    textLabel1->setText( tr( "<p>In the download and upload commands there can be special words that will be replaced by QGIS when the commands are used. These words are:</p>\n"
 
136
"<i>%babel</i> - the path to GPSBabel<br>\n"
 
137
"<i>%type</i> - the flag for the feature type that is being transferred (-w, -r or -t)<br>\n"
 
138
"<i>%in</i> - the GPX filename when uploading or the port when downloading<br>\n"
 
139
"<i>%out</i> - the port when uploading or the GPX filename when downloading" ) );
 
140
    pbUpdateDevice->setText( tr( "Update device" ) );
 
141
    pbDeleteDevice->setText( tr( "Delete device" ) );
 
142
    pbNewDevice->setText( tr( "New device" ) );
 
143
    pbClose->setText( tr( "Close" ) );
 
144
}
 
145
 
 
146
void QgsGPSDeviceDialogBase::slotProtocolChanged(const QString&)
 
147
{
 
148
    qWarning( "QgsGPSDeviceDialogBase::slotProtocolChanged(const QString&): Not implemented yet" );
 
149
}
 
150
 
 
151
void QgsGPSDeviceDialogBase::slotNewDevice()
 
152
{
 
153
    qWarning( "QgsGPSDeviceDialogBase::slotNewDevice(): Not implemented yet" );
 
154
}
 
155
 
 
156
void QgsGPSDeviceDialogBase::slotDeleteDevice()
 
157
{
 
158
    qWarning( "QgsGPSDeviceDialogBase::slotDeleteDevice(): Not implemented yet" );
 
159
}
 
160
 
 
161
void QgsGPSDeviceDialogBase::slotUpdateDevice()
 
162
{
 
163
    qWarning( "QgsGPSDeviceDialogBase::slotUpdateDevice(): Not implemented yet" );
 
164
}
 
165
 
 
166
void QgsGPSDeviceDialogBase::slotSelectionChanged()
 
167
{
 
168
    qWarning( "QgsGPSDeviceDialogBase::slotSelectionChanged(): Not implemented yet" );
 
169
}
 
170