Skip to content
Permalink
Browse files
Show proj params when selecting one in combo box
git-svn-id: http://svn.osgeo.org/qgis/trunk@3150 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
timlinux committed Apr 13, 2005
1 parent 955d35e commit 626385238423d00a2f61679f580d9cddbcb34f89
Showing with 89 additions and 25 deletions.
  1. +2 −0 ChangeLog
  2. +1 −1 configure.in
  3. +18 −20 qgis.kdevelop
  4. +41 −3 src/qgscustomprojectiondialog.cpp
  5. +1 −1 src/qgscustomprojectiondialog.h
  6. +14 −0 src/qgscustomprojectiondialogbase.ui
  7. +12 −0 src/qgscustomprojectiondialogbase.ui.h
@@ -2,6 +2,8 @@
------------------------------------------------------------------------------
Version 0.6 'Simon' .... development version
QGIS Change Log
2005-04-13 [timlinux] 0.6devel13
** Show params on proj designer widget when a projection is sleected
2005-04-12 [ges] 0.6.0devel12
** Applied patches from Markus Neteler to allow compilation on Qt 3.1
2005-04-12 [timlinux] 0.6devel12
@@ -26,7 +26,7 @@ dnl ---------------------------------------------------------------------------
MAJOR_VERSION=0
MINOR_VERSION=6
MICRO_VERSION=0
EXTRA_VERSION=12
EXTRA_VERSION=13
if test $EXTRA_VERSION -eq 0; then
VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${MICRO_VERSION}
else
@@ -9,7 +9,7 @@
<ignoreparts/>
<projectdirectory>.</projectdirectory>
<absoluteprojectpath>false</absoluteprojectpath>
<description></description>
<description/>
</general>
<kdevautoproject>
<general>
@@ -20,7 +20,7 @@
<mainprogram>/home/gsherman/development/qgis07_dev/debug/src/qgis</mainprogram>
<directoryradio>custom</directoryradio>
<customdirectory>/</customdirectory>
<programargs></programargs>
<programargs/>
<terminal>false</terminal>
<autocompile>true</autocompile>
<envvars/>
@@ -41,14 +41,14 @@
<f77compiler>kdevpgf77options</f77compiler>
<cxxflags>-O0 -g3</cxxflags>
<envvars/>
<topsourcedir></topsourcedir>
<cppflags></cppflags>
<ldflags></ldflags>
<ccompilerbinary></ccompilerbinary>
<cxxcompilerbinary></cxxcompilerbinary>
<f77compilerbinary></f77compilerbinary>
<cflags></cflags>
<f77flags></f77flags>
<topsourcedir/>
<cppflags/>
<ldflags/>
<ccompilerbinary/>
<cxxcompilerbinary/>
<f77compilerbinary/>
<cflags/>
<f77flags/>
</debug>
</configurations>
<make>
@@ -59,18 +59,18 @@
<abortonerror>true</abortonerror>
<numberofjobs>1</numberofjobs>
<dontact>false</dontact>
<makebin></makebin>
<makebin/>
<prio>0</prio>
</make>
</kdevautoproject>
<kdevdebugger>
<general>
<dbgshell>libtool</dbgshell>
<programargs></programargs>
<gdbpath></gdbpath>
<configGdbScript></configGdbScript>
<runShellScript></runShellScript>
<runGdbScript></runGdbScript>
<programargs/>
<gdbpath/>
<configGdbScript/>
<runShellScript/>
<runGdbScript/>
<breakonloadinglibs>true</breakonloadinglibs>
<separatetty>false</separatetty>
<floatingtoolbar>false</floatingtoolbar>
@@ -155,16 +155,14 @@
<headerCompletionDelay>250</headerCompletionDelay>
</codecompletion>
<creategettersetter>
<prefixGet></prefixGet>
<prefixGet/>
<prefixSet>set</prefixSet>
<prefixVariable>m_,_</prefixVariable>
<parameterName>theValue</parameterName>
<inlineGet>true</inlineGet>
<inlineSet>true</inlineSet>
</creategettersetter>
<references>
<pcs>Qt</pcs>
</references>
<references/>
</kdevcppsupport>
<kdevfileview>
<groups>
@@ -164,11 +164,49 @@ void QgsCustomProjectionDialog::pbnCancel_clicked()
}




void QgsCustomProjectionDialog::cboProjectionFamily_textChanged( const QString & )
void QgsCustomProjectionDialog::cboProjectionFamily_highlighted( const QString & theText)
{
#ifdef QGISDEBUG
std::cout << "Projection selected from combo" << std::endl;
#endif
//search the sqlite user projections db for the projection entry
//and display its parameters
QString myQGisSettingsDir = QDir::homeDirPath () + "/.qgis/";
sqlite3 *myDatabase;
char *myErrorMessage = 0;
const char *myTail;
sqlite3_stmt *myPreparedStatement;
int myResult;
//check the db is available
myResult = sqlite3_open(QString(myQGisSettingsDir+"user_projections.db").latin1(), &myDatabase);
if(myResult)
{
std::cout << "Can't open database: " << sqlite3_errmsg(myDatabase) << std::endl;
// XXX This will likely never happen since on open, sqlite creates the
// database if it does not exist.
assert(myResult == 0);
}

// Set up the query to retreive the projection information needed to populate the PROJECTION list
QString mySql = "select parameters from tbl_projection name where name='"+theText+"'";
#ifdef QGISDEBUG
std::cout << "Query to get proj params:" << mySql << std::endl;
#endif
myResult = sqlite3_prepare(myDatabase, (const char *)mySql, mySql.length(), &myPreparedStatement, &myTail);
// XXX Need to free memory from the error msg if one is set
if(myResult == SQLITE_OK)
{
sqlite3_step(myPreparedStatement) == SQLITE_ROW;
QString myParametersString = (char *)sqlite3_column_text(myPreparedStatement,0);
#ifdef QGISDEBUG
std::cout << "Setting parameters text box to: " << myParametersString << std::endl;
#endif
txtExpectedParameters->setReadOnly(false);
txtExpectedParameters->setText(myParametersString);
txtExpectedParameters->setReadOnly(true);
}
sqlite3_finalize(myPreparedStatement);
sqlite3_close(myDatabase);
}


@@ -34,7 +34,7 @@ public slots:
void pbnOK_clicked();
void pbnApply_clicked();
void pbnCancel_clicked();
void cboProjectionFamily_textChanged( const QString & );
void cboProjectionFamily_highlighted( const QString & );
};

#endif
@@ -193,6 +193,18 @@ Parameters:</string>
<receiver>QgsCustomProjectionDialogBase</receiver>
<slot>cboProjectionFamily_textChanged(const QString&amp;)</slot>
</connection>
<connection>
<sender>cboProjectionFamily</sender>
<signal>activated(const QString&amp;)</signal>
<receiver>QgsCustomProjectionDialogBase</receiver>
<slot>cboProjectionFamily_activated(const QString&amp;)</slot>
</connection>
<connection>
<sender>cboProjectionFamily</sender>
<signal>highlighted(const QString&amp;)</signal>
<receiver>QgsCustomProjectionDialogBase</receiver>
<slot>cboProjectionFamily_highlighted(const QString&amp;)</slot>
</connection>
</connections>
<includes>
<include location="local" impldecl="in implementation">qgscustomprojectiondialogbase.ui.h</include>
@@ -203,6 +215,8 @@ Parameters:</string>
<slot>pbnOK_clicked()</slot>
<slot>pbnHelp_clicked()</slot>
<slot>cboProjectionFamily_textChanged( const QString &amp; )</slot>
<slot>cboProjectionFamily_activated( const QString &amp; )</slot>
<slot>cboProjectionFamily_highlighted( const QString &amp; )</slot>
</slots>
<layoutdefaults spacing="6" margin="11"/>
</UI>
@@ -39,3 +39,15 @@ void QgsCustomProjectionDialogBase::cboProjectionFamily_textChanged( const QStri
{

}


void QgsCustomProjectionDialogBase::cboProjectionFamily_activated( const QString & )
{

}


void QgsCustomProjectionDialogBase::cboProjectionFamily_highlighted( const QString & )
{

}

0 comments on commit 6263852

Please sign in to comment.