summaryrefslogtreecommitdiffabout
path: root/kaddressbook/old_mainwindow.cpp
Side-by-side diff
Diffstat (limited to 'kaddressbook/old_mainwindow.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--kaddressbook/old_mainwindow.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/kaddressbook/old_mainwindow.cpp b/kaddressbook/old_mainwindow.cpp
index 0e886d9..7a445c7 100644
--- a/kaddressbook/old_mainwindow.cpp
+++ b/kaddressbook/old_mainwindow.cpp
@@ -1,837 +1,837 @@
#include <qlabel.h>
#include <qapp.h>
#include <qmessagebox.h>
#include <qaction.h>
#include <kdebug.h> // defined kdDebug()
#include <klocale.h> // defines i18n (microkde)
#include "kabprefs.h"
#ifndef DESKTOP_VERSION
#include <qpe/qpetoolbar.h>
#include <qpe/qpemenubar.h>
#include <qpe/resource.h>
#else
#include <qtoolbar.h>
#include <qmenubar.h>
#include <resource.h>
#endif
/*
#include <stdlib.h>
#include <qaction.h>
#include <qpainter.h>
#include <qwhatsthis.h>
#include <qpopupmenu.h>
#include <qmessagebox.h>
#include <qlineedit.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qwmatrix.h>
#ifndef DESKTOP_VERSION
#include <qpe/global.h>
#include <qpe/qpemenubar.h>
#include <qpe/qpetoolbar.h>
#include <qpe/resource.h>
#include <qpe/qpeapplication.h>
#include <qtopia/alarmserver.h>
#include <qtopia/qcopenvelope_qws.h>
#else
#include <qtoolbar.h>
#include <qdir.h>
#include <qapplication.h>
//#include <resource.h>
#endif
#include <libkcal/calendarlocal.h>
#include <libkcal/todo.h>
//#include "calendarview.h"
//#include "koviewmanager.h"
//#include "koagendaview.h"
//#include "kodialogmanager.h"
//#include "kdialogbase.h"
//#include "koprefs.h"
//#include "kfiledialog.h"
//#include "koglobals.h"
//#include "kconfig.h"
//#include "simplealarmclient.h"
*/
//US using namespace KACore;
#include "mainwindow.h"
MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
QMainWindow( parent, name )
{
#ifdef DESKTOP_VERSION
setFont( QFont("Arial"), 14 );
#endif
// mBlockAtStartup = true;
kdDebug() << "MainWindow()::MainWindow()" << endl;
// mFlagKeyPressed = false;
setCaption("KAddressbook/Pi");
KABPrefs *p = KABPrefs::instance();
if ( QApplication::desktop()->height() > 480 ) {
//US if ( p->mHourSize == 4 )
//US p->mHourSize = 6;
}
QMainWindow::ToolBarDock tbd;
if ( p->mToolBarHor ) {
if ( p->mToolBarUp )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUp )
tbd = Right;
else
tbd = Left;
}
iconToolBar = new QPEToolBar( this );
addToolBar (iconToolBar , tbd );
/*US
mBlockSaveFlag = false;
mCalendarModifiedFlag = false;
*/
QLabel* splash = new QLabel(i18n("KA/Pi is starting ... "), this );
splash->setAlignment ( AlignCenter );
setCentralWidget( splash );
#ifndef DESKTOP_VERSION
showMaximized();
#endif
qDebug("Mainwidget x %d y %d w %d h %d", x(), y(), width(), height ());
// setDefaultPreferences();
/* mCalendar = new CalendarLocal();
mView = new CalendarView( mCalendar, this,"mCalendar " );
mView->hide();
//mView->resize(splash->size() );
*/
initActions();
#ifndef DESKTOP_VERSION
//US iconToolBar->show();
qApp->processEvents();
#endif
qDebug("Splashwidget x %d y %d w %d h %d", splash-> x(), splash->y(), splash->width(),splash-> height ());
int vh = height() ;
int vw = width();
qDebug("Toolbar hei %d ",iconToolBar->height() );
/*US if ( iconToolBar->orientation () == Qt:: Horizontal ) {
vh -= iconToolBar->height();
} else {
vw -= iconToolBar->height();
}
*/
//mView->setMaximumSize( splash->size() );
//mView->resize( splash->size() );
//qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
/* mView->readSettings();
if( !QFile::exists( defaultFileName() ) ) {
mView->saveCalendar( defaultFileName() );
}
mView->openCalendar( defaultFileName() );
processIncidenceSelection( 0 );
connect( mView, SIGNAL( incidenceSelected( Incidence * ) ),
SLOT( processIncidenceSelection( Incidence * ) ) );
connect( mView, SIGNAL( modifiedChanged( bool ) ),
SLOT( slotModifiedChanged( bool ) ) );
connect( mView, SIGNAL( signalmodified() ),
SLOT( checkAlarms( ) ) );
connect( &mSaveTimer, SIGNAL( timeout() ), SLOT( save() ) );
connect( &alarmTimer, SIGNAL( timeout() ), SLOT( writeAlarm() ) );
mView->setModified( false );
mBlockAtStartup = false;
mView->setModified( false );
setCentralWidget( mView );
mView->show();
*/
delete splash;
qApp->processEvents();
//US qDebug("MainView x %d y %d w %d h %d", mView->x(),mView-> y(), mView->width(), mView->height ());
}
MainWindow::~MainWindow()
{
qDebug("MainWindow::~MainWindow() ");
kdDebug() << "MainWindow()::~MainWindow()" << endl;
//save toolbar location
/*
KOPrefs *p = KOPrefs::instance();
p->mToolBarHor = ( iconToolBar->orientation () == Qt:: Horizontal );
p->mToolBarUp = iconToolBar->x() > width()/2 ||
iconToolBar->y() > height()/2;
alarmTimer.stop();
mView->writeSettings();
writeAlarm();
if ( mCalendarModifiedFlag )
save();
delete mCalendar;
*/
}
void MainWindow::closeEvent( QCloseEvent* ce )
{
if ( ! KABPrefs::instance()->mAskForQuit ) {
ce->accept();
return;
}
switch( QMessageBox::information( this, "KA/Pi",
i18n("Do you really want\nto close KA/Pi?"),
i18n("Close!"), i18n("No"),
0, 0 ) ) {
case 0:
ce->accept();
break;
case 1:
ce->ignore();
break;
case 2:
default:
break;
}
}
void MainWindow::recieve( const QCString& cmsg, const QByteArray& data )
{
/*
QDataStream stream( data, IO_ReadOnly );
// QMessageBox::about( this, "About KOrganizer/Pi", "*" +msg +"*" );
if ( cmsg == "-writeFile" ) {
mView->viewManager()->showWhatsNextView();
save();
setCaption( i18n("File written on AD request"));
showMaximized();
raise();
#ifndef DESKTOP_VERSION
QCopEnvelope e3("kosaved", "blabla");
#endif
return;
}
if ( cmsg == "-newCountdown" ) {
qDebug("newCountdown ");
}
QString msg ;;
QString allmsg = cmsg;
while ( allmsg.length() > 0 ) {
int nextC = allmsg.find( "-", 1 );
if ( nextC == -1 ) {
msg = allmsg;
allmsg = "";
} else{
msg = allmsg.left( nextC );
allmsg = allmsg.mid( nextC, allmsg.length()-nextC );
}
//qDebug("msg: %s all: %s ", msg.latin1(), allmsg.latin1() );
if ( msg == "-newEvent" ) {
mView->newEvent();
}
if ( msg == "-newTodo" ) {
mView->newTodo();
}
if ( msg == "-showWN" ) {
mView->viewManager()->showWhatsNextView();
}
if ( msg == "-showTodo" ) {
mView->viewManager()->showTodoView();
}
if ( msg == "-showList" ) {
mView->viewManager()->showListView();
}
else if ( msg == "-showDay" ) {
mView->viewManager()->showDayView();
}
else if ( msg == "-showWWeek" ) {
mView->viewManager()->showWorkWeekView();
}
else if ( msg == "-showWeek" ) {
mView->viewManager()->showWeekView();
}
else if ( msg == "-showTodo" ) {
mView->viewManager()->showTodoView();
}
else if ( msg == "-showJournal" ) {
mView->viewManager()->showJournalView();
}
else if ( msg == "-showKO" ) {
mView->viewManager()->showNextXView();
}
else if ( msg == "-showWNext" ) {
mView->viewManager()->showWhatsNextView();
}
}
showMaximized();
raise();
*/
}
QPixmap MainWindow::loadPixmap( QString name )
{
return KGlobal::iconLoader().loadPixmap( name );
/*US use the advanced version of the iconloader
#ifdef DESKTOP_VERSION
QPixmap pixmapLoader;
QString file;
file = QDir::homeDirPath()+"/kaddressbook/pics/" + name+".png";
//qDebug("pixmap name %s ", file.latin1());
pixmapLoader.load( file );
return pixmapLoader;
#else
return Resource::loadPixmap( name );
#endif
*/
}
void MainWindow::initActions()
{
iconToolBar->clear();
KABPrefs *p = KABPrefs::instance();
QPEMenuBar *menuBar1 = new QPEMenuBar( iconToolBar );
- QPopupMenu *menuBar = new QPopupMenu( this );
+ Q3PopupMenu *menuBar = new Q3PopupMenu( this );
menuBar1->insertItem( "ME", menuBar);
- QPopupMenu *fileMenu = new QPopupMenu( this );
- QPopupMenu *editMenu = new QPopupMenu( this );
- QPopupMenu *viewMenu = new QPopupMenu( this );
- QPopupMenu *settingsMenu = new QPopupMenu( this );
- QPopupMenu *importMenu = new QPopupMenu( this );
+ Q3PopupMenu *fileMenu = new Q3PopupMenu( this );
+ Q3PopupMenu *editMenu = new Q3PopupMenu( this );
+ Q3PopupMenu *viewMenu = new Q3PopupMenu( this );
+ Q3PopupMenu *settingsMenu = new Q3PopupMenu( this );
+ Q3PopupMenu *importMenu = new Q3PopupMenu( this );
menuBar1->setMaximumWidth( menuBar1->sizeHint().width() );
QIconSet icon;
icon = loadPixmap( pathString + "newtodo" );
configureToolBarMenu->insertItem(icon, "New todo", 20 );
QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this );
nt_action->addTo( actionMenu );
connect( nt_action, SIGNAL( activated() ),
mView, SLOT( newTodo() ) );
/*
QAction *action;
QIconSet icon;
// QPopupMenu *configureMenu= new QPopupMenu( menuBar );
configureToolBarMenu = new QPopupMenu( this );
configureToolBarMenu->setCheckable( true );
#ifdef DESKTOP_VERSION
QString pathString = "";
#else
QString pathString = "kaddressbook/";
#endif
if ( QApplication::desktop()->width() < 480 )
pathString += "icons16/";
configureAgendaMenu = new QPopupMenu( menuBar );
configureAgendaMenu->setCheckable( true );
configureAgendaMenu->insertItem("Toggle Allday", 1 );
configureAgendaMenu->insertSeparator();
configureAgendaMenu->insertItem("Tiny", 4 );
configureAgendaMenu->insertItem("Small", 6 );
configureAgendaMenu->insertItem("Medium", 8 );
configureAgendaMenu->insertItem("Normal", 10 );
configureAgendaMenu->insertItem("Large", 12 );
configureAgendaMenu->insertItem("Big", 14 );
configureAgendaMenu->insertItem("Bigger", 16 );
configureAgendaMenu->insertItem("Biggest", 18 );
//configureMenu->insertItem( "AgendaSize",configureAgendaMenu );
icon = loadPixmap( pathString + "newevent" );
icon = loadPixmap( pathString + "newevent" );
configureToolBarMenu->insertItem("Stretched TB", 5 );
configureToolBarMenu->insertSeparator();
configureToolBarMenu->insertItem(icon, "New event", 10 );
QAction* ne_action = new QAction( "New Event", icon, "New Event...", 0, this );
ne_action->addTo( actionMenu );
*/
/*
connect( ne_action, SIGNAL( activated() ),
mView, SLOT( newEvent() ) );
icon = loadPixmap( pathString + "newtodo" );
configureToolBarMenu->insertItem(icon, "New todo", 20 );
QAction* nt_action = new QAction( "New Todo", icon, "New Todo...", 0, this );
nt_action->addTo( actionMenu );
connect( nt_action, SIGNAL( activated() ),
mView, SLOT( newTodo() ) );
action = new QAction( "Toggle FilterView", QPixmap(), "Toggle FilterView", 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( toggleFilter() ) );
viewMenu->insertSeparator();
icon = loadPixmap( pathString + "picker" );
action = new QAction( "Date Picker", icon, "Date Picker", 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( showDatePicker() ) );
action->addTo( iconToolBar );
viewMenu->insertSeparator();
icon = loadPixmap( pathString + "list" );
configureToolBarMenu->insertItem(icon, "Event list", 30 );
QAction* showlist_action = new QAction( "List", icon, "List", 0, this );
showlist_action->addTo( viewMenu );
connect( showlist_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showListView() ) );
icon = loadPixmap( pathString + "day" );
configureToolBarMenu->insertItem(icon, "One day", 40 );
QAction* day1_action = new QAction( "Day", icon, "Day", 0, this );
day1_action->addTo( viewMenu );
// action->addTo( toolBar );
connect( day1_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showDayView() ) );
icon = loadPixmap( pathString + "workweek" );
configureToolBarMenu->insertItem(icon, "Work week", 50 );
QAction* day5_action = new QAction( "Work Week", icon, "Work Week", 0, this );
day5_action->addTo( viewMenu );
connect( day5_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showWorkWeekView() ) );
icon = loadPixmap( pathString + "week" );
configureToolBarMenu->insertItem(icon, "Week", 60 );
QAction* day7_action = new QAction( "Week", icon, "Week", 0, this );
day7_action->addTo( viewMenu );
connect( day7_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showWeekView() ) );
icon = loadPixmap( pathString + "month" );
configureToolBarMenu->insertItem(icon, "Month", 70 );
QAction* month_action = new QAction( "Month", icon, "Month", 0, this );
month_action->addTo( viewMenu );
connect( month_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showMonthView() ) );
icon = loadPixmap( pathString + "todo" );
configureToolBarMenu->insertItem(icon, "Todo list", 80 );
QAction* todoview_action = new QAction( "Todo", icon, "Todo", 0, this );
todoview_action->addTo( viewMenu );
connect( todoview_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showTodoView() ) );
icon = loadPixmap( pathString + "journal" );
configureToolBarMenu->insertItem(icon, "Journal", 90 );
QAction* viewjournal_action = new QAction( "Journal", icon, "Journal", 0, this );
viewjournal_action->addTo( viewMenu );
connect( viewjournal_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showJournalView() ) );
icon = loadPixmap( pathString + "xdays" );
configureToolBarMenu->insertItem(icon, "Next days", 100,4 );
QAction* xdays_action = new QAction( "Next days", icon, "Next Days", 0, this );
xdays_action->addTo( viewMenu );
connect( xdays_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showNextXView() ) );
icon = loadPixmap( pathString + "whatsnext" );
configureToolBarMenu->insertItem(icon, "Whats next", 110, 4 );
QAction* whatsnext_action = new QAction( "What's Next", icon, "What's Next", 0, this );
whatsnext_action->addTo( viewMenu );
connect( whatsnext_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showWhatsNextView() ) );
#if 0
action = new QAction( "view_timespan", "Time Span", 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showTimeSpanView() ) );
#endif
menuBar->insertItem( "View", viewMenu );
#if 0
QPopupMenu *navigationMenu = new QPopupMenu( menuBar );
action = new QAction( "Go backward", "Go Backward", 0, navigationMenu );
action->addTo( navigationMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( goPrevious() ) );
action = new QAction( "Go forward", "Go Forward", 0, navigationMenu );
action->addTo( navigationMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( goNext() ) );
menuBar->insertItem( "Go", navigationMenu );
#endif
mNewSubTodoAction = new QAction( "new_subtodo", "New Sub-Todo...", 0,
this );
mNewSubTodoAction->addTo( actionMenu );
connect( mNewSubTodoAction, SIGNAL( activated() ),
mView, SLOT( newSubTodo() ) );
actionMenu->insertSeparator();
mShowAction = new QAction( "show_incidence", "Show...", 0, this );
mShowAction->addTo( actionMenu );
connect( mShowAction, SIGNAL( activated() ),
mView, SLOT( showIncidence() ) );
mEditAction = new QAction( "edit_incidence", "Edit...", 0, this );
mEditAction->addTo( actionMenu );
connect( mEditAction, SIGNAL( activated() ),
mView, SLOT( editIncidence() ) );
mDeleteAction = new QAction( "delete_incidence", "Delete...", 0, this );
mDeleteAction->addTo( actionMenu );
connect( mDeleteAction, SIGNAL( activated() ),
mView, SLOT( deleteIncidence() ) );
actionMenu->insertSeparator();
action = new QAction( "purge_completed", i18n("Purge Completed"), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
icon = loadPixmap( pathString + "search" );
QAction* search_action = new QAction( "search", icon, "Search...", 0, this );
configureToolBarMenu->insertItem(icon, "Search", 120 , 4);
search_action->addTo( actionMenu );
connect( search_action, SIGNAL( activated() ),
mView->dialogManager(), SLOT( showSearchDialog() ) );
icon = loadPixmap( pathString + "today" );
configureToolBarMenu->insertItem(icon, "Today", 130);
QAction* today_action = new QAction( "Today", icon, "Go to Today", 0, this );
today_action->addTo( actionMenu );
connect( today_action, SIGNAL( activated() ),
mView, SLOT( goToday() ) );
//#if 0
actionMenu->insertSeparator();
action = new QAction( "configure", "Configure...", 0, this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( edit_options() ) );
//#endif
// actionMenu->insertSeparator();
action = new QAction( "import_qtopia", "Import (*.ics/*.vcs) file", 0,
this );
action->addTo( importMenu );
connect( action, SIGNAL( activated() ), SLOT( importIcal() ) );
action = new QAction( "import_quick", "Import last file", 0,
this );
action->addTo( importMenu );
connect( action, SIGNAL( activated() ), SLOT( quickImportIcal() ) );
importMenu->insertSeparator();
action = new QAction( "import_qtopia", "Import Opie/Qtopia Cal.", 0,
this );
action->addTo( importMenu );
importMenu->insertSeparator();
connect( action, SIGNAL( activated() ), SLOT( importQtopia() ) );
action = new QAction( "load_cal", "Load Calendar Backup", 0,
this );
action->addTo( importMenu );
connect( action, SIGNAL( activated() ), SLOT( loadCalendar() ) );
action = new QAction( "save_cal", "Save Calendar Backup", 0,
this );
action->addTo( importMenu );
connect( action, SIGNAL( activated() ), SLOT( saveCalendar() ) );
importMenu->insertSeparator();
action = new QAction( "import_qtopia", "Export VCalendar", 0,
this );
action->addTo( importMenu );
connect( action, SIGNAL( activated() ), SLOT( exportVCalendar() ) );
QPopupMenu *syncMenu = new QPopupMenu( this );
action = new QAction( "syncssh", "Remote via ssh/scp(not implemented)", 0,
this );
action->addTo( syncMenu );
connect( action, SIGNAL( activated() ), SLOT( syncSSH() ) );
action = new QAction( "synclocal", "With local file(not implemented)", 0,
this );
action->addTo( syncMenu );
connect( action, SIGNAL( activated() ), SLOT( syncLocalFile() ) );
action = new QAction( "quicksynclocal", "With last file(not implemented)", 0,
this );
action->addTo( syncMenu );
connect( action, SIGNAL( activated() ), SLOT( quickSyncLocalFile() ) );
menuBar->insertItem( "Actions", actionMenu );
menuBar->insertItem( "Load/Save", importMenu );
menuBar->insertItem( "Synchronize", syncMenu );
//menuBar->insertItem( "Configure",configureMenu );
//configureMenu->insertItem( "Toolbar",configureToolBarMenu );
menuBar->insertItem( "AgendaSize",configureAgendaMenu );
menuBar->insertItem( "Toolbar",configureToolBarMenu );
QPopupMenu *helpMenu = new QPopupMenu( menuBar );
icon = loadPixmap( "korganizer/korganizer" );
action = new QAction( "Key bindings", "Key Bindings...", 0, this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( keyBindings() ) );
action = new QAction( "Auto saving", "Auto saving...", 0, this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( aboutAutoSaving() ) );
action = new QAction( "Problemd", "Known Problems...", 0,this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( aboutKnownBugs() ) );
action = new QAction( "about", "About...", 0, this );
action->addTo( helpMenu );
connect( action, SIGNAL( activated() ),
SLOT( about() ) );
menuBar->insertItem( "Help", helpMenu );
*/
//menuBar->insertSeparator();
// ******************************************************
// menubar icons
iconToolBar->setHorizontalStretchable (true );
//menuBar->insertItem( iconToolBar );
//xdays_action
/*
if (p-> mShowIconNewEvent)
ne_action->addTo( iconToolBar );
if (p->mShowIconNewTodo )
nt_action->addTo( iconToolBar );
if (p-> mShowIconSearch)
search_action->addTo( iconToolBar );
if (p-> mShowIconNext)
whatsnext_action->addTo( iconToolBar );
if (p-> mShowIconNextDays)
xdays_action->addTo( iconToolBar );
if (p-> mShowIconList)
showlist_action->addTo( iconToolBar );
if (p-> mShowIconDay1)
day1_action->addTo( iconToolBar );
if (p-> mShowIconDay5)
day5_action->addTo( iconToolBar );
if (p-> mShowIconDay7)
day7_action->addTo( iconToolBar );
if (p-> mShowIconMonth)
month_action->addTo( iconToolBar );
if (p-> mShowIconTodoview)
todoview_action->addTo( iconToolBar );
if (p-> mShowIconJournal)
viewjournal_action->addTo( iconToolBar );
icon = loadPixmap( pathString + "2leftarrowB" );
configureToolBarMenu->insertItem(icon, "Prev. month", 200, 14);
if (p-> mShowIconBackFast) {
action = new QAction( "Prev month", icon, "Go Backward",0 , this );
connect( action, SIGNAL( activated() ),
mView, SLOT( goPreviousMonth() ) );
action->addTo( iconToolBar );
}
icon = loadPixmap( pathString + "1leftarrowB" );
configureToolBarMenu->insertItem(icon, "Go previous", 210,15);
if (p-> mShowIconBack) {
action = new QAction( "Go previous", icon, "Go Backward",0 , this );
connect( action, SIGNAL( activated() ),
mView, SLOT( goPrevious() ) );
action->addTo( iconToolBar );
}
if (p-> mShowIconToday)
today_action->addTo( iconToolBar );
icon = loadPixmap( pathString + "1rightarrowB" );
configureToolBarMenu->insertItem(icon, "Go next", 220);
if (p-> mShowIconForward) {
action = new QAction( "Go next", icon, "Go Backward",0 , this );
connect( action, SIGNAL( activated() ),
mView, SLOT( goNext() ) );
action->addTo( iconToolBar );
}
icon = loadPixmap( pathString + "2rightarrowB" );
configureToolBarMenu->insertItem(icon, "Next month", 230);
if (p-> mShowIconForwardFast) {
action = new QAction( "Next month", icon, "Go Backward",0 , this );
connect( action, SIGNAL( activated() ),
mView, SLOT( goNextMonth() ) );
action->addTo( iconToolBar );
}
*/
configureToolBarMenu->insertItem("WhatsThis", 300);
/*
if (p-> mShowIconNewEvent)
configureToolBarMenu->setItemChecked( 10, true );
if (p->mShowIconNewTodo )
configureToolBarMenu->setItemChecked( 20, true );
if (p-> mShowIconSearch)
configureToolBarMenu->setItemChecked( 120, true );
if (p-> mShowIconList)
configureToolBarMenu->setItemChecked( 30, true );
if (p-> mShowIconDay1)
configureToolBarMenu->setItemChecked( 40, true );
if (p-> mShowIconDay5)
configureToolBarMenu->setItemChecked( 50, true );
if (p-> mShowIconDay7)
configureToolBarMenu->setItemChecked( 60, true );
if (p-> mShowIconMonth)
configureToolBarMenu->setItemChecked( 70, true );
if (p-> mShowIconTodoview)
configureToolBarMenu->setItemChecked( 80, true );
if (p-> mShowIconBackFast)
configureToolBarMenu->setItemChecked( 200, true );
if (p-> mShowIconBack)
configureToolBarMenu->setItemChecked( 210, true );
if (p-> mShowIconToday)
configureToolBarMenu->setItemChecked( 130, true );
if (p-> mShowIconForward)
configureToolBarMenu->setItemChecked( 220, true );
if (p-> mShowIconForwardFast)
configureToolBarMenu->setItemChecked( 230, true );
if (p-> mShowIconNextDays)
configureToolBarMenu->setItemChecked( 100, true );
if (p-> mShowIconNext)
configureToolBarMenu->setItemChecked( 110, true );
if (p-> mShowIconJournal)
configureToolBarMenu->setItemChecked( 90, true );
if (p-> mShowIconWhatsThis)
configureToolBarMenu->setItemChecked( 300, true );
QLabel* dummy = new QLabel( iconToolBar );
dummy->setBackgroundColor( iconToolBar->backgroundColor() );
if (!p-> mShowIconStretch)
iconToolBar->setStretchableWidget ( dummy ) ;
else
configureToolBarMenu->setItemChecked( 5, true );
if (p-> mShowIconWhatsThis)
QWhatsThis::whatsThisButton ( iconToolBar );
connect( configureToolBarMenu, SIGNAL( activated( int ) ),this, SLOT(configureToolBar( int ) ) );
configureAgenda( p->mHourSize );
connect( configureAgendaMenu, SIGNAL( activated( int ) ),this, SLOT(configureAgenda( int ) ) );
*/
}
/*
void MainWindow::setDefaultPreferences()
{
KOPrefs *p = KOPrefs::instance();
p->mCompactDialogs = true;
p->mConfirm = true;
p->mEnableQuickTodo = false;
}
*/
void MainWindow::about()
{
QMessageBox::about( this, "About KOrganizer/Pi",
"KOrganizer/Platform-independent\n"
"(KO/Pi) 1.6.0e - "
#ifdef DESKTOP_VERSION
"Desktop Edition\n"
#else
"PDA-Edition\n"
"for: Zaurus 5500 / 7x0 / 8x0\n"
#endif
"(c) 2004 Lutz Rogowski\n"
"Email:lutz@pi-sync.net\n"
"KO/Pi is based on KOrganizer\n"
"(c) 2002,2003 Cornelius Schumacher\n"
"Email: schumacher@kde.org\n"
"KOrganizer/Pi is licensed\n"
"under the GPL.\n"
"KO/Pi can be compiled for\n"
"Linux, Zaurus-PDA and Windows\n"
"www.korganizer.org\n" );
}
/*
void MainWindow::keyBindings()
{
QMessageBox* msg;
msg = new QMessageBox( "Key bindings KOrganizer/Pi",
"Space: Toggle Fullscreen | P: Date Picker\n"
"H: This dialog | I: Show info | S: Search\n"
"F: Toggle Filterview | 1-4: Select Filter\n"
"N: Show next days | W: Whats next\n "
"V: Todo view | L: Event list view\n"
"T: Goto today | T+<ctrl>: New Todo\n"
"E: Edit item | E+<ctrl>: New Event\n"
"5: Work week view | 7: Week view\n"
"D: One day view | M: Month view\n"
"+,- : Zoom in/out Agenda | A: Toggle Allday\n"
"<ctrl>+<up>/<down>: Scroll todo view\n"
"<right>,C: Next week | <right>+<ctrl>: Next month\n"
"<left>,X: Prev. week | <left>+<ctrl>: Prev. month\n"
"<del>,<backspace>: Delete sel. item\n",
QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton );
msg->exec();
delete msg;
}
void MainWindow::aboutAutoSaving()
{
QMessageBox* msg;
msg = new QMessageBox( "Auto Saving in KOrganizer/Pi",
"After changing something, the data is\n"
"automatically saved to the file\n"
"~/Applications/korganizer/mycalendar.ics\n "
"after (configureable) one minute.\n"
"For safety reasons there is one autosaving\n"
"after 10 minutes (of idle time) again. The \n"
"data is saved automatically when closing KO/Pi\n"
"You can create a backup file \n"
"with: Load/Save - Save Calendar Backup\n",
QMessageBox::NoIcon,
QMessageBox::Ok,
QMessageBox::NoButton,
QMessageBox::NoButton);
msg->exec();
delete msg;
}
void MainWindow::aboutKnownBugs()
{
QMessageBox* msg;
msg = new QMessageBox( "Known Problems in KOrganizer/Pi",
"1) The QWhatsThis help is not working.\n"
"There is only a black rectangle displayed\n"
"when clicking on an event.\n "
"2) Audio alarm is available!\n"
"as an additional small application\n"
"3) Syncing is missing.\n"
"Syncing via ssh/scp will be available in\n"
"KOrganizer/Pi 2.0\n"
"\n"
"Please report unexpected behaviour to\n"
"lutz@pi-sync.net\n",
QMessageBox::NoIcon,