summaryrefslogtreecommitdiffstats
path: root/krecipes/src/krecipes.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'krecipes/src/krecipes.cpp')
-rw-r--r--krecipes/src/krecipes.cpp110
1 files changed, 55 insertions, 55 deletions
diff --git a/krecipes/src/krecipes.cpp b/krecipes/src/krecipes.cpp
index 845c29b..9449351 100644
--- a/krecipes/src/krecipes.cpp
+++ b/krecipes/src/krecipes.cpp
@@ -44,11 +44,11 @@
#include "backends/recipedb.h"
#include "backends/progressinterface.h"
-#include <qdragobject.h>
+#include <ntqdragobject.h>
#include <kprinter.h>
-#include <qpainter.h>
-#include <qpaintdevicemetrics.h>
-#include <qmessagebox.h>
+#include <ntqpainter.h>
+#include <ntqpaintdevicemetrics.h>
+#include <ntqmessagebox.h>
#include <kprogress.h>
#include <kmessagebox.h>
@@ -95,10 +95,10 @@ Krecipes::Krecipes()
// allow the view to change the statusbar and caption
- connect( m_view, SIGNAL( signalChangeStatusbar( const QString& ) ),
- this, SLOT( changeStatusbar( const QString& ) ) );
- connect( m_view, SIGNAL( signalChangeCaption( const QString& ) ),
- this, SLOT( changeCaption( const QString& ) ) );
+ connect( m_view, SIGNAL( signalChangeStatusbar( const TQString& ) ),
+ this, SLOT( changeStatusbar( const TQString& ) ) );
+ connect( m_view, SIGNAL( signalChangeCaption( const TQString& ) ),
+ this, SLOT( changeCaption( const TQString& ) ) );
connect( m_view, SIGNAL( panelShown( KrePanel, bool ) ), SLOT( updateActions( KrePanel, bool ) ) );
connect( m_view, SIGNAL( panelShown( KrePanel, bool ) ), SLOT( updateActions( KrePanel, bool ) ) );
@@ -113,10 +113,10 @@ Krecipes::Krecipes()
enableSaveOption( false ); // Disables saving initially
recipeSelected( false ); //nothing is selected initially
- parsing_file_dlg = new KDialog( this, "parsing_file_dlg", true, Qt::WX11BypassWM );
- QLabel *parsing_file_dlg_label = new QLabel( i18n( "Gathering recipe data from file.\nPlease wait..." ), parsing_file_dlg );
- parsing_file_dlg_label->setFrameStyle( QFrame::Box | QFrame::Raised );
- ( new QVBoxLayout( parsing_file_dlg ) ) ->addWidget( parsing_file_dlg_label );
+ parsing_file_dlg = new KDialog( this, "parsing_file_dlg", true, TQt::WX11BypassWM );
+ TQLabel *parsing_file_dlg_label = new TQLabel( i18n( "Gathering recipe data from file.\nPlease wait..." ), parsing_file_dlg );
+ parsing_file_dlg_label->setFrameStyle( TQFrame::Box | TQFrame::Raised );
+ ( new TQVBoxLayout( parsing_file_dlg ) ) ->addWidget( parsing_file_dlg_label );
parsing_file_dlg->adjustSize();
//parsing_file_dlg->setFixedSize(parsing_file_dlg->size());
@@ -256,16 +256,16 @@ void Krecipes::readProperties( KConfig * )
// the app is being restored. read in here whatever you wrote
// in 'saveProperties'
- //QString url = config->readEntry("lastURL");
+ //TQString url = config->readEntry("lastURL");
//if (!url.isNull())
// m_view->openURL(KURL(url));
}
-void Krecipes::dragEnterEvent( QDragEnterEvent *event )
+void Krecipes::dragEnterEvent( TQDragEnterEvent *event )
{
// accept uri drops only
- event->accept( QUriDrag::canDecode( event ) );
+ event->accept( TQUriDrag::canDecode( event ) );
}
@@ -283,10 +283,10 @@ void Krecipes::fileOpen()
// button is clicked
/*
// this brings up the generic open dialog
- KURL url = KURLRequesterDlg::getURL(QString::null, this, i18n("Open Location") );
+ KURL url = KURLRequesterDlg::getURL(TQString::null, this, i18n("Open Location") );
*/
// standard filedialog
- /*KURL url = KFileDialog::getOpenURL(QString::null, QString::null, this, i18n("Open Location"));
+ /*KURL url = KFileDialog::getOpenURL(TQString::null, TQString::null, this, i18n("Open Location"));
if (!url.isEmpty())
m_view->openURL(url);*/
}
@@ -317,7 +317,7 @@ void Krecipes::filePrint()
void Krecipes::import()
{
- KFileDialog file_dialog( QString::null,
+ KFileDialog file_dialog( TQString::null,
"*.kre *.kreml|Krecipes (*.kre, *.kreml)\n"
"*.mx2|MasterCook (*.mx2)\n"
"*.mxp *.txt|MasterCook Export (*.mxp, *.txt)\n"
@@ -332,9 +332,9 @@ void Krecipes::import()
file_dialog.setMode( KFile::Files );
if ( file_dialog.exec() == KFileDialog::Accepted ) {
- QStringList warnings_list;
+ TQStringList warnings_list;
- QString selected_filter = file_dialog.currentFilter();
+ TQString selected_filter = file_dialog.currentFilter();
BaseImporter *importer;
if ( selected_filter == "*.mxp *.txt" )
@@ -353,7 +353,7 @@ void Krecipes::import()
importer = new RezkonvImporter();
else {
KMessageBox::sorry( this,
- QString( i18n( "Filter \"%1\" not recognized.\n"
+ TQString( i18n( "Filter \"%1\" not recognized.\n"
"Please select one of the provided filters." ) ).arg( selected_filter ),
i18n( "Unrecognized Filter" )
);
@@ -373,7 +373,7 @@ void Krecipes::import()
if ( !direct ) {
RecipeImportDialog import_dialog( importer->recipeList() );
- if ( import_dialog.exec() != QDialog::Accepted ) {
+ if ( import_dialog.exec() != TQDialog::Accepted ) {
delete importer;
return;
}
@@ -386,13 +386,13 @@ void Krecipes::import()
if ( !importer->getMessages().isEmpty() ) {
KTextEdit * warningEdit = new KTextEdit( this );
- warningEdit->setTextFormat( Qt::RichText );
- warningEdit->setText( QString( i18n( "NOTE: We recommend that all recipes generating warnings be checked to ensure that they were properly imported, and no loss of recipe data has occurred.<br><br>" ) ) + importer->getMessages() );
+ warningEdit->setTextFormat( TQt::RichText );
+ warningEdit->setText( TQString( i18n( "NOTE: We recommend that all recipes generating warnings be checked to ensure that they were properly imported, and no loss of recipe data has occurred.<br><br>" ) ) + importer->getMessages() );
warningEdit->setReadOnly( true );
KDialogBase showWarningsDlg( KDialogBase::Swallow, i18n( "Import Warnings" ), KDialogBase::Ok, KDialogBase::Default, this );
showWarningsDlg.setMainWidget( warningEdit ); //KDialogBase will delete warningEdit for us
- showWarningsDlg.resize( QSize( 550, 250 ) );
+ showWarningsDlg.resize( TQSize( 550, 250 ) );
showWarningsDlg.exec();
}
@@ -403,9 +403,9 @@ void Krecipes::import()
void Krecipes::kreDBImport()
{
DBImportDialog importOptions;
- if ( importOptions.exec() == QDialog::Accepted ) {
+ if ( importOptions.exec() == TQDialog::Accepted ) {
//Get all params, even if we don't use them
- QString host, user, pass, table;
+ TQString host, user, pass, table;
int port;
importOptions.serverParams( host, user, pass, port, table );
@@ -413,7 +413,7 @@ void Krecipes::kreDBImport()
parsing_file_dlg->show();
KApplication::setOverrideCursor( KCursor::waitCursor() );
- QStringList tables;
+ TQStringList tables;
if ( importOptions.dbType() == "SQLite" )
tables << importOptions.dbFile();
else //MySQL or PostgreSQL
@@ -428,14 +428,14 @@ void Krecipes::kreDBImport()
if ( !direct ) {
RecipeImportDialog import_dialog( importer.recipeList() );
- if ( import_dialog.exec() != QDialog::Accepted ) {
+ if ( import_dialog.exec() != TQDialog::Accepted ) {
return;
}
else
importer.setRecipeList( import_dialog.getSelectedRecipes() );
}
- QString error = importer.getErrorMsg();
+ TQString error = importer.getErrorMsg();
if ( !error.isEmpty() ) {
KMessageBox::sorry( this, error );
}
@@ -451,12 +451,12 @@ void Krecipes::pageSetupSlot()
KConfig *config = KGlobal::config();
config->setGroup("Page Setup");
- QString layout = config->readEntry( "Layout", locate( "appdata", "layouts/Default.klo" ) );
- QString printLayout = config->readEntry( "PrintLayout", locate( "appdata", "layouts/Default.klo" ) );
+ TQString layout = config->readEntry( "Layout", locate( "appdata", "layouts/Default.klo" ) );
+ TQString printLayout = config->readEntry( "PrintLayout", locate( "appdata", "layouts/Default.klo" ) );
if ( layout == printLayout ) {
KMessageBox::information( this, i18n("The recipe print and view layouts use the same file for their style, meaning changing one view's look changes them both. If this is not the behavior you desire, load one style and save it under a different name."),
- QString::null, "sharedLayoutWarning" );
+ TQString::null, "sharedLayoutWarning" );
}
PageSetupDialog page_setup( this, recipe );
@@ -470,12 +470,12 @@ void Krecipes::printSetupSlot()
KConfig *config = KGlobal::config();
config->setGroup("Page Setup");
- QString layout = config->readEntry( "Layout", locate( "appdata", "layouts/Default.klo" ) );
- QString printLayout = config->readEntry( "PrintLayout", locate( "appdata", "layouts/Default.klo" ) );
+ TQString layout = config->readEntry( "Layout", locate( "appdata", "layouts/Default.klo" ) );
+ TQString printLayout = config->readEntry( "PrintLayout", locate( "appdata", "layouts/Default.klo" ) );
if ( layout == printLayout ) {
KMessageBox::information( this, i18n("The recipe print and view layouts use the same file for their style, meaning changing one view's look changes them both. If this is not the behavior you desire, load one style and save it under a different name."),
- QString::null, "sharedLayoutWarning" );
+ TQString::null, "sharedLayoutWarning" );
}
PageSetupDialog pageSetup( this, recipe, "Print" );
@@ -489,20 +489,20 @@ void Krecipes::conversionToolSlot()
void Krecipes::backupSlot()
{
- QString fileName = KFileDialog::getSaveFileName(QString::null,
- QString("*.krecbk|%1 (*.krecbk)").arg("Krecipes Backup File"),
+ TQString fileName = KFileDialog::getSaveFileName(TQString::null,
+ TQString("*.krecbk|%1 (*.krecbk)").arg("Krecipes Backup File"),
this,i18n("Save Backup As..."));
int overwrite = KMessageBox::Yes;
- if ( QFile::exists(fileName) ) {
- overwrite = KMessageBox::warningYesNo( this, QString( i18n( "File \"%1\" exists. Are you sure you want to overwrite it?" ) ).arg( fileName ) );
+ if ( TQFile::exists(fileName) ) {
+ overwrite = KMessageBox::warningYesNo( this, TQString( i18n( "File \"%1\" exists. Are you sure you want to overwrite it?" ) ).arg( fileName ) );
}
if ( !fileName.isNull() && overwrite == KMessageBox::Yes ) {
ProgressInterface pi(this);
pi.listenOn(m_view->database);
- QString errMsg;
+ TQString errMsg;
if ( !m_view->database->backup( fileName, &errMsg ) )
KMessageBox::error( this, errMsg, i18n("Backup Failed") );
}
@@ -510,17 +510,17 @@ void Krecipes::backupSlot()
void Krecipes::restoreSlot()
{
- QString filename = KFileDialog::getOpenFileName(QString::null,
- QString("*.krecbk|%1 (*.krecbk)").arg(i18n("Krecipes Backup File")),
+ TQString filename = KFileDialog::getOpenFileName(TQString::null,
+ TQString("*.krecbk|%1 (*.krecbk)").arg(i18n("Krecipes Backup File")),
this,i18n("Restore Backup"));
if ( !filename.isNull() ) {
- switch ( KMessageBox::warningContinueCancel(this,i18n("<b>Restoring this file will erase ALL data currently in the database!</b><br /><br />If you want to keep the recipes in your database, click \"Cancel\" and first export your recipes. These can then be imported once the restore is complete.<br /><br />Are you sure you want to proceed?"),QString::null,KStdGuiItem::cont(),"RestoreWarning") ) {
+ switch ( KMessageBox::warningContinueCancel(this,i18n("<b>Restoring this file will erase ALL data currently in the database!</b><br /><br />If you want to keep the recipes in your database, click \"Cancel\" and first export your recipes. These can then be imported once the restore is complete.<br /><br />Are you sure you want to proceed?"),TQString::null,KStdGuiItem::cont(),"RestoreWarning") ) {
case KMessageBox::Continue: {
ProgressInterface pi(this);
pi.listenOn(m_view->database);
- QString errMsg;
+ TQString errMsg;
if ( m_view->database->restore( filename, &errMsg ) )
KMessageBox::information(this,i18n("Restore successful."));
else
@@ -540,9 +540,9 @@ void Krecipes::mergeSimilarCategories()
ElementList categories;
m_view->database->loadCategories(&categories);
SimilarCategoriesDialog dlg(categories,this);
- if ( dlg.exec() == QDialog::Accepted ) {
- QValueList<int> ids = dlg.matches();
- QString name = dlg.element();
+ if ( dlg.exec() == TQDialog::Accepted ) {
+ TQValueList<int> ids = dlg.matches();
+ TQString name = dlg.element();
int id = m_view->database->findExistingCategoryByName(name);
if ( id == -1 ) {
@@ -550,7 +550,7 @@ void Krecipes::mergeSimilarCategories()
id = m_view->database->lastInsertID();
}
- for ( QValueList<int>::const_iterator it = ids.begin(); it != ids.end(); ++it ) {
+ for ( TQValueList<int>::const_iterator it = ids.begin(); it != ids.end(); ++it ) {
if ( id != *it )
m_view->database->mergeCategories(id, *it);
}
@@ -562,9 +562,9 @@ void Krecipes::mergeSimilarIngredients()
ElementList ingredients;
m_view->database->loadIngredients(&ingredients);
SimilarCategoriesDialog dlg(ingredients,this);
- if ( dlg.exec() == QDialog::Accepted ) {
- QValueList<int> ids = dlg.matches();
- QString name = dlg.element();
+ if ( dlg.exec() == TQDialog::Accepted ) {
+ TQValueList<int> ids = dlg.matches();
+ TQString name = dlg.element();
if ( ids.isEmpty() || name.isEmpty() ) return;
@@ -574,7 +574,7 @@ void Krecipes::mergeSimilarIngredients()
id = m_view->database->lastInsertID();
}
- for ( QValueList<int>::const_iterator it = ids.begin(); it != ids.end(); ++it ) {
+ for ( TQValueList<int>::const_iterator it = ids.begin(); it != ids.end(); ++it ) {
if ( id != *it )
m_view->database->mergeIngredients(id, *it);
}
@@ -684,13 +684,13 @@ void Krecipes::optionsPreferences()
}
-void Krecipes::changeStatusbar( const QString& text )
+void Krecipes::changeStatusbar( const TQString& text )
{
// display the text on the statusbar
statusBar() ->message( text );
}
-void Krecipes::changeCaption( const QString& text )
+void Krecipes::changeCaption( const TQString& text )
{
// display the text on the caption
setCaption( text );