Main | License | Installation | FAQ | Screenshots | Contact | Links | Sf.net | Freshmeat.net | KDE-Apps.org
Requirements | Design | Modules | Class Hierarchy | Alphabetical List | Data Structures | File List | Data Fields | Globals | Related Pages

destroyDialog.ui.h

Go to the documentation of this file.
00001 /****************************************************************************
00002 ** ui.h extension file, included from the uic-generated form implementation.
00003 **
00004 ** If you wish to add, delete or rename functions or slots use
00005 ** Qt Designer which will update this file, preserving your code. Create an
00006 ** init() function in place of a constructor, and a destroy() function in
00007 ** place of a destructor.
00008 *****************************************************************************/
00009 
00010 
00011 void DestroyDialog::init()
00012 {
00013   assert( serverTypeCombo->text( 0 ) == i18n( "Network" ) );
00014   assert( serverTypeCombo->text( 1 ) == i18n( "Embedded" ) );
00015   const char *home = getenv( "HOME" );
00016   if ( home != NULL )
00017     socketEdit->setText( QString( home ) +
00018                          "/.kde/share/apps/anymeal/db/mysql.sock" );
00019   serverWidgetStack->raiseWidget( serverTypeCombo->currentItem() );
00020 }
00021 
00022 void DestroyDialog::updateOkEnabled()
00023 {
00024   okButton->setEnabled
00025     ( !databaseEdit->text().isEmpty() &&
00026       !sourceKey().isEmpty() &&
00027       !rootUserEdit->text().isEmpty() && 
00028       ( !rootPassWordCheckBox->isChecked() ||
00029         !rootPassWordEdit->text().isEmpty() ) );
00030 }
00031 
00032 
00033 void DestroyDialog::selectSocket()
00034 {
00035   QString fileName =
00036     KFileDialog::getOpenFileName( ":dbfolder",
00037                                   i18n( "*.sock|Socket (*.sock)\n"
00038                                         "*|All Files(*)" ),
00039                                   this,
00040                                   i18n( "Select database socket" ) );
00041   if ( fileName != QString::null ) {
00042     socketEdit->setText( fileName );
00043   };
00044 }
00045 
00046 QString DestroyDialog::sourceKey()
00047 {
00048   return serverTypeCombo->currentItem() == 0 ?
00049     serverEdit->text() :
00050     socketEdit->text();
00051 }
00052 
00053 
00054 void DestroyDialog::setSocket( const QString &socket )
00055 {
00056   std::string socketstr( (const char *)socket );
00057   unsigned int pos = socketstr.find_last_of( "/" );
00058   if ( pos != std::string::npos )
00059     folderEdit->setText( std::string( socketstr, 0, pos ).c_str() );
00060 }


anymeal 0.30 - recipe management software - Make the most of your food! - © Jan Wedekind Sun Sep 14 16:01:26 2008 - GNU Free Documentation License