Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
added missing icons for rec naviagation to the custom projection dialog
git-svn-id: http://svn.osgeo.org/qgis/trunk@8506 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed May 23, 2008
1 parent 27e68b4 commit 3506587
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 26 deletions.
58 changes: 32 additions & 26 deletions src/app/qgscustomprojectiondialog.cpp
Expand Up @@ -44,6 +44,16 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog(QWidget *parent, Qt::WFlags
{
setupUi(this);

QString myThemePath = QgsApplication::themePath();
pbnFirst->setPixmap(QPixmap(myThemePath+"mIconFirst.png"));
QString myString = "Setting first button to : " + myThemePath+"mIconFirst.png";
qDebug(myString.toLocal8Bit());
pbnPrevious->setPixmap(QPixmap(myThemePath+"mIconPrevious.png"));
pbnNext->setPixmap(QPixmap(myThemePath+"mIconNext.png"));
pbnLast->setPixmap(QPixmap(myThemePath+"mIconLast.png"));
pbnNew->setPixmap(QPixmap(myThemePath+"mIconNew.png"));
pbnSave->setPixmap(QPixmap(myThemePath+"mActionFileSave.png"));
pbnDelete->setPixmap(QPixmap(myThemePath+"mIconDelete.png"));
// user database is created at QGIS startup in QgisApp::createDB
// we just check whether there is our database [MD]
QFileInfo myFileInfo;
Expand Down Expand Up @@ -414,18 +424,18 @@ void QgsCustomProjectionDialog::on_pbnFirst_clicked()
// XXX Need to free memory from the error msg if one is set
if(myResult == SQLITE_OK)
{
if (sqlite3_step(myPreparedStatement) == SQLITE_ROW)
{
mCurrentRecordId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,0));
leName->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,1)));
//QString myProjectionFamilyId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,2));
//cboProjectionFamily->setCurrentText(getProjectionFamilyName(myProjectionFamilyId));
//QString myEllipsoidId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,3));
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4)));
mCurrentRecordLong=1;
lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong));
}
if (sqlite3_step(myPreparedStatement) == SQLITE_ROW)
{
mCurrentRecordId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,0));
leName->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,1)));
//QString myProjectionFamilyId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,2));
//cboProjectionFamily->setCurrentText(getProjectionFamilyName(myProjectionFamilyId));
//QString myEllipsoidId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,3));
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4)));
mCurrentRecordLong=1;
lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong));
}
}
else
{
Expand All @@ -450,13 +460,13 @@ void QgsCustomProjectionDialog::on_pbnFirst_clicked()
{
pbnNext->setEnabled(false);
pbnLast->setEnabled(false);
pbnDelete->setEnabled(false);
pbnDelete->setEnabled(true);
}
else
{
pbnNext->setEnabled(true);
pbnLast->setEnabled(true);
pbnDelete->setEnabled(false);
pbnDelete->setEnabled(true);
}
}

Expand Down Expand Up @@ -688,23 +698,16 @@ void QgsCustomProjectionDialog::on_pbnLast_clicked()

void QgsCustomProjectionDialog::on_pbnNew_clicked()
{
#ifdef QGISDEBUG
if (pbnNew->text()==tr("Abort"))
{
std::cout << "QgsCustomProjectionDialog::on_pbnNew_clicked() - abort requested" << std::endl;
}
else
{
std::cout << "QgsCustomProjectionDialog::on_pbnNew_clicked() - new requested" << std::endl;
}
#endif
if (pbnNew->text()==tr("Abort"))
{
//if we get here, user has aborted add record
QString myThemePath = QgsApplication::themePath();
pbnNew->setPixmap(QPixmap(myThemePath+"mIconNew.png"));
//next line needed for new/abort logic
pbnNew->setText(tr("New"));
//get back to the last used record before insert was pressed
if (mCurrentRecordId.isEmpty())
{
if (mCurrentRecordId.isEmpty())
{
on_pbnFirst_clicked();
}
else
Expand All @@ -721,6 +724,9 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()
pbnNext->setEnabled(false);
pbnLast->setEnabled(false);
pbnDelete->setEnabled(false);
QString myThemePath = QgsApplication::themePath();
pbnNew->setPixmap(QPixmap(myThemePath+"mIconNew.png"));
//next line needed for new/abort logic
pbnNew->setText(tr("Abort"));
//clear the controls
leName->setText("");
Expand Down
21 changes: 21 additions & 0 deletions src/ui/qgscustomprojectiondialogbase.ui
Expand Up @@ -65,13 +65,19 @@
<property name="text" >
<string>|&lt;</string>
</property>
<property name="icon" >
<iconset>../../images/themes/default/mIconFirst.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbnPrevious" >
<property name="text" >
<string>&lt;</string>
</property>
<property name="icon" >
<iconset>../../images/themes/default/mIconPrevious.png</iconset>
</property>
</widget>
</item>
<item>
Expand All @@ -89,34 +95,49 @@
<property name="text" >
<string>></string>
</property>
<property name="icon" >
<iconset>../../images/themes/default/mIconNext.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbnLast" >
<property name="text" >
<string>>|</string>
</property>
<property name="icon" >
<iconset>../../images/themes/default/mIconLast.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbnNew" >
<property name="text" >
<string>*</string>
</property>
<property name="icon" >
<iconset>../../images/themes/default/mIconNew.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbnSave" >
<property name="text" >
<string>S</string>
</property>
<property name="icon" >
<iconset>../../images/themes/default/mActionFileSave.png</iconset>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="pbnDelete" >
<property name="text" >
<string>X</string>
</property>
<property name="icon" >
<iconset>../../images/themes/default/mIconDelete.png</iconset>
</property>
</widget>
</item>
</layout>
Expand Down

0 comments on commit 3506587

Please sign in to comment.