Skip to content

Commit d72f12b

Browse files
author
timlinux
committed
added missing icons for rec naviagation to the custom projection dialog
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@8506 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent ee70aa5 commit d72f12b

File tree

2 files changed

+53
-26
lines changed

2 files changed

+53
-26
lines changed

src/app/qgscustomprojectiondialog.cpp

Lines changed: 32 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,16 @@ QgsCustomProjectionDialog::QgsCustomProjectionDialog(QWidget *parent, Qt::WFlags
4444
{
4545
setupUi(this);
4646

47+
QString myThemePath = QgsApplication::themePath();
48+
pbnFirst->setPixmap(QPixmap(myThemePath+"mIconFirst.png"));
49+
QString myString = "Setting first button to : " + myThemePath+"mIconFirst.png";
50+
qDebug(myString.toLocal8Bit());
51+
pbnPrevious->setPixmap(QPixmap(myThemePath+"mIconPrevious.png"));
52+
pbnNext->setPixmap(QPixmap(myThemePath+"mIconNext.png"));
53+
pbnLast->setPixmap(QPixmap(myThemePath+"mIconLast.png"));
54+
pbnNew->setPixmap(QPixmap(myThemePath+"mIconNew.png"));
55+
pbnSave->setPixmap(QPixmap(myThemePath+"mActionFileSave.png"));
56+
pbnDelete->setPixmap(QPixmap(myThemePath+"mIconDelete.png"));
4757
// user database is created at QGIS startup in QgisApp::createDB
4858
// we just check whether there is our database [MD]
4959
QFileInfo myFileInfo;
@@ -414,18 +424,18 @@ void QgsCustomProjectionDialog::on_pbnFirst_clicked()
414424
// XXX Need to free memory from the error msg if one is set
415425
if(myResult == SQLITE_OK)
416426
{
417-
if (sqlite3_step(myPreparedStatement) == SQLITE_ROW)
418-
{
419-
mCurrentRecordId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,0));
420-
leName->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,1)));
421-
//QString myProjectionFamilyId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,2));
422-
//cboProjectionFamily->setCurrentText(getProjectionFamilyName(myProjectionFamilyId));
423-
//QString myEllipsoidId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,3));
424-
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
425-
leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4)));
426-
mCurrentRecordLong=1;
427-
lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong));
428-
}
427+
if (sqlite3_step(myPreparedStatement) == SQLITE_ROW)
428+
{
429+
mCurrentRecordId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,0));
430+
leName->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,1)));
431+
//QString myProjectionFamilyId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,2));
432+
//cboProjectionFamily->setCurrentText(getProjectionFamilyName(myProjectionFamilyId));
433+
//QString myEllipsoidId = QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,3));
434+
//cboEllipsoid->setCurrentText(getEllipsoidName(myEllipsoidId));
435+
leParameters->setText(QString::fromUtf8((char *)sqlite3_column_text(myPreparedStatement,4)));
436+
mCurrentRecordLong=1;
437+
lblRecordNo->setText(QString::number(mCurrentRecordLong) + " of " + QString::number(mRecordCountLong));
438+
}
429439
}
430440
else
431441
{
@@ -450,13 +460,13 @@ void QgsCustomProjectionDialog::on_pbnFirst_clicked()
450460
{
451461
pbnNext->setEnabled(false);
452462
pbnLast->setEnabled(false);
453-
pbnDelete->setEnabled(false);
463+
pbnDelete->setEnabled(true);
454464
}
455465
else
456466
{
457467
pbnNext->setEnabled(true);
458468
pbnLast->setEnabled(true);
459-
pbnDelete->setEnabled(false);
469+
pbnDelete->setEnabled(true);
460470
}
461471
}
462472

@@ -688,23 +698,16 @@ void QgsCustomProjectionDialog::on_pbnLast_clicked()
688698

689699
void QgsCustomProjectionDialog::on_pbnNew_clicked()
690700
{
691-
#ifdef QGISDEBUG
692-
if (pbnNew->text()==tr("Abort"))
693-
{
694-
std::cout << "QgsCustomProjectionDialog::on_pbnNew_clicked() - abort requested" << std::endl;
695-
}
696-
else
697-
{
698-
std::cout << "QgsCustomProjectionDialog::on_pbnNew_clicked() - new requested" << std::endl;
699-
}
700-
#endif
701701
if (pbnNew->text()==tr("Abort"))
702702
{
703703
//if we get here, user has aborted add record
704+
QString myThemePath = QgsApplication::themePath();
705+
pbnNew->setPixmap(QPixmap(myThemePath+"mIconNew.png"));
706+
//next line needed for new/abort logic
704707
pbnNew->setText(tr("New"));
705708
//get back to the last used record before insert was pressed
706-
if (mCurrentRecordId.isEmpty())
707-
{
709+
if (mCurrentRecordId.isEmpty())
710+
{
708711
on_pbnFirst_clicked();
709712
}
710713
else
@@ -721,6 +724,9 @@ void QgsCustomProjectionDialog::on_pbnNew_clicked()
721724
pbnNext->setEnabled(false);
722725
pbnLast->setEnabled(false);
723726
pbnDelete->setEnabled(false);
727+
QString myThemePath = QgsApplication::themePath();
728+
pbnNew->setPixmap(QPixmap(myThemePath+"mIconNew.png"));
729+
//next line needed for new/abort logic
724730
pbnNew->setText(tr("Abort"));
725731
//clear the controls
726732
leName->setText("");

src/ui/qgscustomprojectiondialogbase.ui

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,13 +65,19 @@
6565
<property name="text" >
6666
<string>|&lt;</string>
6767
</property>
68+
<property name="icon" >
69+
<iconset>../../images/themes/default/mIconFirst.png</iconset>
70+
</property>
6871
</widget>
6972
</item>
7073
<item>
7174
<widget class="QToolButton" name="pbnPrevious" >
7275
<property name="text" >
7376
<string>&lt;</string>
7477
</property>
78+
<property name="icon" >
79+
<iconset>../../images/themes/default/mIconPrevious.png</iconset>
80+
</property>
7581
</widget>
7682
</item>
7783
<item>
@@ -89,34 +95,49 @@
8995
<property name="text" >
9096
<string>></string>
9197
</property>
98+
<property name="icon" >
99+
<iconset>../../images/themes/default/mIconNext.png</iconset>
100+
</property>
92101
</widget>
93102
</item>
94103
<item>
95104
<widget class="QToolButton" name="pbnLast" >
96105
<property name="text" >
97106
<string>>|</string>
98107
</property>
108+
<property name="icon" >
109+
<iconset>../../images/themes/default/mIconLast.png</iconset>
110+
</property>
99111
</widget>
100112
</item>
101113
<item>
102114
<widget class="QToolButton" name="pbnNew" >
103115
<property name="text" >
104116
<string>*</string>
105117
</property>
118+
<property name="icon" >
119+
<iconset>../../images/themes/default/mIconNew.png</iconset>
120+
</property>
106121
</widget>
107122
</item>
108123
<item>
109124
<widget class="QToolButton" name="pbnSave" >
110125
<property name="text" >
111126
<string>S</string>
112127
</property>
128+
<property name="icon" >
129+
<iconset>../../images/themes/default/mActionFileSave.png</iconset>
130+
</property>
113131
</widget>
114132
</item>
115133
<item>
116134
<widget class="QToolButton" name="pbnDelete" >
117135
<property name="text" >
118136
<string>X</string>
119137
</property>
138+
<property name="icon" >
139+
<iconset>../../images/themes/default/mIconDelete.png</iconset>
140+
</property>
120141
</widget>
121142
</item>
122143
</layout>

0 commit comments

Comments
 (0)