Commit 357c687a authored by Jan Möbius's avatar Jan Möbius

Moved update settings to qsettings

git-svn-id: http://www.openflipper.org/svnrepo/OpenFlipper/branches/Free@11684 383ad7c9-94d9-4d36-a494-682f7c89f535
parent 18bd6c25
......@@ -297,20 +297,6 @@ void Core::readApplicationOptions(INIFile& _ini) {
PluginFunctions::viewerProperties(i).backgroundColor(OpenFlipperSettings().value(entryHeader+"BackgroundColor",QColor(0,0,0)).value< QColor >());
}
//============================================================================
// Update information
//============================================================================
QString updateUrl = "";
if( _ini.get_entry(updateUrl, "Options", "UpdateURL") )
OpenFlipper::Options::updateUrl(updateUrl);
QString updateUsername = "";
if( _ini.get_entry(updateUsername, "Options", "UpdateUsername") )
OpenFlipper::Options::updateUsername(updateUsername);
QString updatePassword = "";
if( _ini.get_entry(updatePassword, "Options", "UpdatePassword") )
OpenFlipper::Options::updatePassword(updatePassword);
}
}
......@@ -400,13 +386,6 @@ void Core::writeApplicationOptions(INIFile& _ini) {
//============================================================================
_ini.add_entry("Options","SlotDebugging",OpenFlipper::Options::doSlotDebugging() );
//============================================================================
// Update information
//============================================================================
_ini.add_entry("Options","UpdateURL",OpenFlipper::Options::updateUrl() );
_ini.add_entry("Options","UpdateUsername",OpenFlipper::Options::updateUsername() );
_ini.add_entry("Options","UpdatePassword",OpenFlipper::Options::updatePassword() );
if ( !_ini.section_exists("Plugins") )
_ini.add_section("Plugins");
......
......@@ -186,15 +186,6 @@ static bool debug_ = false;
/// Slot Debugging
static bool doSlotDebugging_ = false;
/// URL for updates
static QString updateURL_ = "";
/// Username for updates
static QString updateUsername_ = "";
/// Password for updates
static QString updatePassword_ = "";
/// last used DataType
static QString lastDataType_ = "Triangle Mesh";
......@@ -749,30 +740,6 @@ bool doSlotDebugging( ) {
return doSlotDebugging_;
}
void updateUrl( QString _url ) {
updateURL_ = _url;
}
QString updateUrl( ) {
return updateURL_;
}
void updateUsername( QString _username ) {
updateUsername_ = _username;
}
QString updateUsername( ) {
return updateUsername_;
}
void updatePassword( QString _password ) {
updatePassword_ = _password;
}
QString updatePassword( ) {
return updatePassword_;
}
QString coreVersion() {
#ifndef CORE_VERSION
#define CORE_VERSION "1.0.0RC2"
......
......@@ -121,8 +121,13 @@
* * Core/File/UseLoadDefaults Use the defaults saved in the file plugins \n
*
* <b>Log Settings</b>\n
* * Core/Log/Logfile This is the location of the log file \n
* * Core/Log/logFileEnabled This controls, if logging to file is enabled(bool)\n
* * Core/Log/Logfile This is the location of the log file \n
* * Core/Log/logFileEnabled This controls, if logging to file is enabled(bool)\n
*
* <b>Update Settings</b>\n
* * Core/Update/UserName Update UserName
* * Core/Update/Pass Update Password
* * Core/Update/URL Update URL
*
* <b>Mouse Controls<b>\n
* * Core/Mouse/Wheel/ZoomFactor Zoom factor used when turning the mouse wheel (double)\n
......@@ -145,6 +150,8 @@
* \n
* Anaglyph stereo mode settings:\n
*/
DLLEXPORT
OpenFlipperQSettings& OpenFlipperSettings();
......@@ -721,44 +728,6 @@ void doSlotDebugging( bool _debugging );
DLLEXPORT
bool doSlotDebugging( );
/** @} */
//===========================================================================
/** @name Update Options
* @{ */
//===========================================================================
/** Set Server URL to check for updates
*/
DLLEXPORT
void updateUrl( QString _url );
/** Get Server URL to check for updates
*/
DLLEXPORT
QString updateUrl( );
/** Set Username for updates
*/
DLLEXPORT
void updateUsername( QString _username );
/** Get Username for updates
*/
DLLEXPORT
QString updateUsername( );
/** Set Password for updates
*/
DLLEXPORT
void updatePassword( QString _password );
/** Get Password for updates
*/
DLLEXPORT
QString updatePassword( );
/** @} */
//===========================================================================
......
......@@ -365,9 +365,9 @@ void OptionsWidget::showEvent ( QShowEvent * /*event*/ ) {
initPluginOptions();
// updates
updateUser->setText( OpenFlipper::Options::updateUsername() );
updatePass->setText( OpenFlipper::Options::updatePassword() );
updateURL->setText( OpenFlipper::Options::updateUrl( ) );
updateUser->setText( OpenFlipperSettings().value("Core/Update/UserName","anonymous").toString() );
updatePass->setText( OpenFlipperSettings().value("Core/Update/Pass","anonymous").toString() );
updateURL->setText( OpenFlipperSettings().value("Core/Update/URL","http://").toString() );
// debugging
slotDebugging->setChecked(OpenFlipper::Options::doSlotDebugging());
......@@ -695,9 +695,9 @@ void OptionsWidget::slotApply() {
OpenFlipperSettings().setValue("Core/Gui/glViewer/nativeMouse",nativeMouse->isChecked ());
// updates
OpenFlipper::Options::updateUrl( updateURL->text() );
OpenFlipper::Options::updateUsername( updateUser->text() );
OpenFlipper::Options::updatePassword( updatePass->text() );
OpenFlipperSettings().setValue("Core/Update/UserName", updateUser->text());
OpenFlipperSettings().setValue("Core/Update/Pass",updatePass->text());
OpenFlipperSettings().setValue("Core/Update/URL",updateURL->text());
// Debugging
OpenFlipper::Options::doSlotDebugging(slotDebugging->isChecked());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment