Skip to content

Commit

Permalink
Migrate from Qt3 widgets to Qt4 widgets
Browse files Browse the repository at this point in the history
Misc. code tidy ups

But, schema selection in main dialog table not yet done


git-svn-id: http://svn.osgeo.org/qgis/trunk@4744 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
g_j_m committed Jan 25, 2006
1 parent 7360f9e commit 2f0e168
Show file tree
Hide file tree
Showing 14 changed files with 467 additions and 428 deletions.
13 changes: 11 additions & 2 deletions src/plugins/spit/Makefile.am
Expand Up @@ -22,10 +22,17 @@ bin_PROGRAMS = spit
ui_%.h: %.ui
$(UIC) -o $@ $<

%.qrc.cpp: %.qrc
$(RCC) -o $@ $<

spit_MOC = qgsspit.moc.cpp \
qgsshapefile.moc.cpp \
qgseditreservedwordsdialog.moc.cpp
qgseditreservedwordsdialog.moc.cpp \
qgsconnectiondialog.moc.cpp

spit_RES = spit.qrc.cpp

spit_QRC = spit.qrc

spitplugin_la_MOC = $(spit_MOC) qgsspitplugin.moc.cpp

Expand All @@ -46,7 +53,9 @@ common_sources = qgsspit.cpp \
qgsshapefile.h \
qgseditreservedwordsdialog.h \
qgseditreservedwordsdialog.cpp \
$(spit_UI)
$(spit_UI) \
$(spit_QRC) \
$(spit_RES)

spitplugin_la_SOURCES = $(common_sources) \
qgsspitplugin.cpp \
Expand Down
16 changes: 9 additions & 7 deletions src/plugins/spit/qgsconnectiondialog.cpp
Expand Up @@ -15,11 +15,13 @@
* *
***************************************************************************/

// $Id:$

#include <iostream>
#include <qsettings.h>
#include <qlineedit.h>
#include <qcheckbox.h>
#include <qmessagebox.h>

#include <QSettings>
#include <QMessageBox>

extern "C"
{
#include <libpq-fe.h>
Expand Down Expand Up @@ -78,9 +80,9 @@ void QgsConnectionDialog::testConnection()

if (PQstatus(pd) == CONNECTION_OK) {
// Database successfully opened; we can now issue SQL commands.
QMessageBox::information(this, "Test connection", "Connection to " + txtDatabase->text() + " was successfull");
QMessageBox::information(this, tr("Test connection"), tr("Connection to ") + txtDatabase->text() + tr(" was successfull"));
} else {
QMessageBox::information(this, "Test connection", "Connection failed - Check settings and try again ");
QMessageBox::information(this, tr("Test connection"), tr("Connection failed - Check settings and try again "));
}

PQfinish(pd);
Expand All @@ -102,7 +104,7 @@ void QgsConnectionDialog::saveConnection()
}

void QgsConnectionDialog::helpInfo(){
QString message = "General Interface Help:\n\n";
QString message = tr("General Interface Help:\n\n");
QgsMessageViewer * e = new QgsMessageViewer(this);
e->setMessage(message);
e->exec();
Expand Down
10 changes: 10 additions & 0 deletions src/plugins/spit/qgsconnectiondialog.h
Expand Up @@ -18,18 +18,28 @@
#ifndef QGSCONNECTIONDIALOG_H
#define QGSCONNECTIONDIALOG_H

// $Id:$

#include "ui_qgsconnectiondialogbase.h"
#include "qgisgui.h"

class QgsConnectionDialog : public QDialog, private Ui::QgsConnectionDialogBase
{
Q_OBJECT
public:

QgsConnectionDialog(QWidget *parent = 0, const QString& connName = QString::null, Qt::WFlags fl = QgisGui::ModalDialogFlags);
~QgsConnectionDialog();
void testConnection();
void saveConnection();
void helpInfo();

public slots:

void on_btnOk_clicked() { saveConnection(); }
void on_btnCancel_clicked() { done(1); }
void on_btnHelp_clicked() { helpInfo(); }
void on_btnConnect_clicked() { testConnection(); }
};

#endif
83 changes: 37 additions & 46 deletions src/plugins/spit/qgsconnectiondialogbase.ui
Expand Up @@ -9,7 +9,7 @@
<x>0</x>
<y>0</y>
<width>348</width>
<height>303</height>
<height>332</height>
</rect>
</property>
<property name="windowTitle" >
Expand All @@ -18,25 +18,49 @@
<property name="sizeGripEnabled" >
<bool>true</bool>
</property>
<layout class="QGridLayout" >
<layout class="QVBoxLayout" >
<property name="margin" >
<number>11</number>
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="0" column="0" >
<widget class="Q3GroupBox" name="GroupBox1" >
<item>
<widget class="QGroupBox" name="groupBox" >
<property name="title" >
<string>Connection Information</string>
</property>
<layout class="QGridLayout" >
<property name="margin" >
<number>11</number>
<number>9</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item row="1" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="chkStorePassword" >
<property name="text" >
<string>Save Password</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnConnect" >
<property name="text" >
<string>Test Connect</string>
</property>
</widget>
</item>
</layout>
</item>
<item row="0" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
Expand All @@ -57,7 +81,7 @@
<widget class="QLabel" name="TextLabel1_2" >
<property name="font" >
<font>
<family></family>
<family>Sans Serif</family>
<pointsize>11</pointsize>
<weight>50</weight>
<italic>false</italic>
Expand All @@ -75,7 +99,7 @@
<widget class="QLabel" name="TextLabel1" >
<property name="font" >
<font>
<family></family>
<family>Sans Serif</family>
<pointsize>11</pointsize>
<weight>50</weight>
<italic>false</italic>
Expand All @@ -93,7 +117,7 @@
<widget class="QLabel" name="TextLabel2" >
<property name="font" >
<font>
<family></family>
<family>Sans Serif</family>
<pointsize>11</pointsize>
<weight>50</weight>
<italic>false</italic>
Expand All @@ -111,7 +135,7 @@
<widget class="QLabel" name="TextLabel2_2" >
<property name="font" >
<font>
<family></family>
<family>Sans Serif</family>
<pointsize>11</pointsize>
<weight>50</weight>
<italic>false</italic>
Expand All @@ -129,7 +153,7 @@
<widget class="QLabel" name="TextLabel3" >
<property name="font" >
<font>
<family></family>
<family>Sans Serif</family>
<pointsize>11</pointsize>
<weight>50</weight>
<italic>false</italic>
Expand All @@ -147,7 +171,7 @@
<widget class="QLabel" name="TextLabel3_2" >
<property name="font" >
<font>
<family></family>
<family>Sans Serif</family>
<pointsize>11</pointsize>
<weight>50</weight>
<italic>false</italic>
Expand Down Expand Up @@ -205,34 +229,10 @@
</item>
</layout>
</item>
<item row="1" column="0" >
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
</property>
<property name="spacing" >
<number>6</number>
</property>
<item>
<widget class="QCheckBox" name="chkStorePassword" >
<property name="text" >
<string>Save Password</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnConnect" >
<property name="text" >
<string>Test Connect</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item row="1" column="0" >
<item>
<layout class="QHBoxLayout" >
<property name="margin" >
<number>0</number>
Expand Down Expand Up @@ -304,15 +304,6 @@
</widget>
<layoutdefault spacing="6" margin="11" />
<pixmapfunction>qPixmapFromMimeSource</pixmapfunction>
<customwidgets>
<customwidget>
<class>Q3GroupBox</class>
<extends></extends>
<header>Qt3Support/Q3GroupBox</header>
<container>1</container>
<pixmap></pixmap>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>txtName</tabstop>
<tabstop>txtHost</tabstop>
Expand Down

0 comments on commit 2f0e168

Please sign in to comment.