summaryrefslogtreecommitdiffabout
authorzautrix <zautrix>2004-10-06 08:41:05 (UTC)
committer zautrix <zautrix>2004-10-06 08:41:05 (UTC)
commit641d3327a51405f7ed995bb5c58d0207de7b5ca2 (patch) (side-by-side diff)
tree97526f04afd9d3df6244a64bb2e7f91a1c72d6ae
parent8e5089d2f2011e38d811ae0fc6b6d4edaeaf89b8 (diff)
downloadkdepimpi-641d3327a51405f7ed995bb5c58d0207de7b5ca2.zip
kdepimpi-641d3327a51405f7ed995bb5c58d0207de7b5ca2.tar.gz
kdepimpi-641d3327a51405f7ed995bb5c58d0207de7b5ca2.tar.bz2
fixes in export phone dialog
Diffstat (more/less context) (show whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index ef73a78..6a9a2f1 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -50,94 +50,97 @@
#include "kodialogmanager.h"
#include "kdialogbase.h"
#include "kapplication.h"
#include "kofilterview.h"
#include "kstandarddirs.h"
#include "koprefs.h"
#include "kfiledialog.h"
#include "koglobals.h"
#include "kglobal.h"
#include "klocale.h"
#include "kconfig.h"
#include "simplealarmclient.h"
#include "externalapphandler.h"
using namespace KCal;
#ifndef _WIN32_
#include <unistd.h>
#else
#include "koimportoldialog.h"
#endif
#include "mainwindow.h"
class KOex2phonePrefs : public QDialog
{
public:
KOex2phonePrefs( QWidget *parent=0, const char *name=0 ) :
QDialog( parent, name, true )
{
setCaption( i18n("Export to phone options") );
QVBoxLayout* lay = new QVBoxLayout( this );
lay->setSpacing( 3 );
lay->setMargin( 3 );
-
- lay->addWidget(new QLabel( i18n("Please read phone sync howto to\nknow more about the connection settings."), this ) );
+ QLabel *lab;
+ lay->addWidget(lab = new QLabel( i18n("Please read Help-Sync Howto\nto know what settings to use."), this ) );
+ lab->setAlignment (AlignHCenter );
QHBox* temphb;
temphb = new QHBox( this );
new QLabel( i18n("I/O device: "), temphb );
mPhoneDevice = new QLineEdit( temphb);
lay->addWidget( temphb );
temphb = new QHBox( this );
new QLabel( i18n("Connection: "), temphb );
mPhoneConnection = new QLineEdit( temphb);
lay->addWidget( temphb );
temphb = new QHBox( this );
new QLabel( i18n("Model(opt.): "), temphb );
mPhoneModel = new QLineEdit( temphb);
lay->addWidget( temphb );
mWriteBackFuture= new QCheckBox( i18n("Write back events in future only"), this );
mWriteBackFuture->setChecked( true );
lay->addWidget( mWriteBackFuture );
temphb = new QHBox( this );
new QLabel( i18n("Max. weeks in future: ") , temphb );
mWriteBackFutureWeeks= new QSpinBox(1,104, 1, temphb);
mWriteBackFutureWeeks->setValue( 8 );
lay->addWidget( temphb );
- QPushButton * ok = new QPushButton( i18n("Export!"), this );
+ lay->addWidget(lab = new QLabel( i18n("NOTE: This will remove all old\n todo/calendar data on phone!"), this ) );
+ lab->setAlignment (AlignHCenter );
+ QPushButton * ok = new QPushButton( i18n("Export to mobile phone!"), this );
lay->addWidget( ok );
QPushButton * cancel = new QPushButton( i18n("Cancel"), this );
lay->addWidget( cancel );
connect ( ok,SIGNAL(clicked() ),this , SLOT ( accept() ) );
connect (cancel, SIGNAL(clicked() ), this, SLOT ( reject()) );
- resize( 220, 220 );
+ resize( 220, 240 );
}
public:
QLineEdit* mPhoneConnection, *mPhoneDevice, *mPhoneModel;
QCheckBox* mWriteBackFuture;
QSpinBox* mWriteBackFutureWeeks;
};
int globalFlagBlockStartup;
MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
QMainWindow( parent, name )
{
mPassWordPiSync = "abc";
#ifdef DESKTOP_VERSION
setFont( QFont("Arial"), 14 );
#endif
mSyncActionDialog = 0;
mServerSocket = 0;
mClosed = false;
//QString confFile = KStandardDirs::appDir() + "config/korganizerrc";
QString confFile = locateLocal("config","korganizerrc");
QFileInfo finf ( confFile );
bool showWarning = !finf.exists();
setIcon(SmallIcon( "ko24" ) );
mBlockAtStartup = true;
mFlagKeyPressed = false;
setCaption("KOrganizer/Pi");
KOPrefs *p = KOPrefs::instance();
KPimGlobalPrefs::instance()->setGlobalConfig();
// if ( QApplication::desktop()->height() > 480 ) {
// if ( p->mHourSize == 4 )
@@ -1128,64 +1131,68 @@ void MainWindow::slotSyncMenu( int action )
} else if ( action >= 1003 ) {
if ( temp->getIsLocalFileSync() ) {
if ( syncWithFile( temp->getRemoteFileName( ), false ) )
KOPrefs::instance()->mLastSyncedLocalFile = temp->getRemoteFileName();
} else {
if ( temp->getIsPhoneSync() ) {
KOPrefs::instance()->mPhoneDevice = temp->getPhoneDevice( ) ;
KOPrefs::instance()->mPhoneConnection = temp->getPhoneConnection( );
KOPrefs::instance()->mPhoneModel = temp->getPhoneModel( );
syncPhone();
} else if ( temp->getIsPiSync() ) {
mPassWordPiSync = temp->getRemotePw();
KOPrefs::instance()->mActiveSyncPort = temp->getRemotePort();
KOPrefs::instance()->mActiveSyncIP = temp->getRemoteIP();
syncPi();
} else
syncRemote( temp );
}
}
delete temp;
mBlockSaveFlag = false;
}
void MainWindow::exportToPhone( int mode )
{
//ex2phone->insertItem(i18n("Complete calendar..."), 1 );
//ex2phone->insertItem(i18n("Filtered calendar..."), 2 );
KOex2phonePrefs ex2phone;
ex2phone.mPhoneConnection->setText( KOPrefs::instance()->mEx2PhoneConnection );
ex2phone.mPhoneDevice->setText( KOPrefs::instance()->mEx2PhoneDevice );
ex2phone.mPhoneModel->setText( KOPrefs::instance()->mEx2PhoneModel );
+ if ( mode == 1 )
+ ex2phone.setCaption(i18n("Export complete calendar"));
+ if ( mode == 2 )
+ ex2phone.setCaption(i18n("Export filtered calendar"));
if ( !ex2phone.exec() ) {
return;
}
KOPrefs::instance()->mEx2PhoneConnection = ex2phone.mPhoneConnection->text();
KOPrefs::instance()->mEx2PhoneDevice = ex2phone.mPhoneDevice->text();
KOPrefs::instance()->mEx2PhoneModel = ex2phone.mPhoneModel->text();
int inFuture = 0;
if ( ex2phone.mWriteBackFuture->isChecked() )
inFuture = ex2phone.mWriteBackFutureWeeks->value();
QPtrList<Incidence> delSel;
if ( mode == 1 )
delSel = mCalendar->rawIncidences();
if ( mode == 2 )
delSel = mCalendar->incidences();
CalendarLocal* cal = new CalendarLocal();
cal->setLocalTime();
Incidence *incidence = delSel.first();
QDateTime cur = QDateTime::currentDateTime().addDays( -7 );
QDateTime end = cur.addDays( ( inFuture +1 ) *7 );
while ( incidence ) {
if ( incidence->type() != "journal" ) {
bool add = true;
if ( inFuture ) {
QDateTime dt;
if ( incidence->type() == "Todo" ) {
Todo * t = (Todo*)incidence;
if ( t->hasDueDate() )
dt = t->dtDue();
else
dt = cur.addSecs( 62 );