summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/mainwindow.cpp27
1 files changed, 17 insertions, 10 deletions
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index 45775c5..94bc4c1 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -185,79 +185,79 @@ MainWindow::MainWindow( QWidget *parent, const char *name ) :
if ( p->mHourSize > 22 )
p->mHourSize = 22;
QMainWindow::ToolBarDock tbd;
if ( p->mToolBarHor ) {
if ( p->mToolBarUp )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUp )
tbd = Right;
else
tbd = Left;
}
if ( KOPrefs::instance()->mUseAppColors )
QApplication::setPalette( QPalette (KOPrefs::instance()->mAppColor1, KOPrefs::instance()->mAppColor2), true );
globalFlagBlockStartup = 1;
iconToolBar = new QPEToolBar( this );
addToolBar (iconToolBar , tbd );
#ifdef DESKTOP_VERSION
if ( KOPrefs::instance()->mShowIconFilter )
#else
- if ( KOPrefs::instance()->mShowIconFilter || !p->mShowIconOnetoolbar )
+ if ( KOPrefs::instance()->mShowIconFilter || ( !p->mShowIconOnetoolbar &&!p->mShowIconFilterview ) )
#endif
{
if ( p->mToolBarHorF ) {
if ( p->mToolBarUpF )
tbd = Bottom;
else
tbd = Top;
}
else {
if ( p->mToolBarUpF )
tbd = Right;
else
tbd = Left;
}
filterToolBar = new QPEToolBar ( this );
filterMenubar = new KMenuBar( 0 );
QFontMetrics fm ( filterMenubar->font() );
#ifndef DESKTOP_VERSION
filterToolBar->setFocusPolicy( NoFocus );
filterMenubar->setFocusPolicy( NoFocus );
#endif
filterPopupMenu = new QPopupMenu( this );
filterMenubar->insertItem( i18n("No Filter"), filterPopupMenu,0 );
QString addTest = "A";
filterMenubar->setMinimumWidth( fm.width( i18n("No Filter")+addTest ) );
#ifdef DESKTOP_VERSION
- addTest = "AAABBBCCCx";
+ addTest = "AAAAAABBBCCCx";
#else
- addTest = "AAx";
+ addTest = "AAAAAx";
#endif
filterMenubar->setMaximumWidth( fm.width( i18n("No Filter")+addTest ) );
addToolBar (filterToolBar , tbd );
connect ( filterPopupMenu , SIGNAL( activated ( int ) ), this, SLOT (selectFilterPopup( int ) ) );
connect ( filterPopupMenu , SIGNAL( aboutToShow() ), this, SLOT (fillFilterMenuPopup() ) );
if ( !KOPrefs::instance()->mShowIconFilter && !p->mShowIconOnetoolbar )
filterToolBar->hide();
} else {
filterToolBar = 0;
filterMenubar = 0;
filterPopupMenu = 0;
}
if ( p->mShowIconOnetoolbar ) {
viewToolBar = iconToolBar ;
navigatorToolBar = iconToolBar ;
} else {
#ifndef DESKTOP_VERSION
setToolBarsMovable( false );
#endif
if ( p->mToolBarHorV ) {
if ( p->mToolBarUpV )
tbd = Bottom;
else
tbd = Top;
@@ -816,68 +816,69 @@ void MainWindow::initActions()
action = new QAction( "Undo Delete", i18n("All events"), 0, this );
action->addTo( nextConflictMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( conflictAll() ) );
action = new QAction( "Undo Delete", i18n("Allday events"), 0, this );
action->addTo( nextConflictMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( conflictAllday() ) );
action = new QAction( "Undo Delete", i18n("Events with time"), 0, this );
action->addTo( nextConflictMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( conflictNotAll() ) );
actionMenu->insertSeparator();
icon = loadPixmap( pathString + "newevent" );
QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this );
ne_action->addTo( mCurrentItemMenu );
connect( ne_action, SIGNAL( activated() ),
mView, SLOT( newEvent() ) );
icon = loadPixmap( pathString + "newtodo" );
- configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
QAction* nt_action = new QAction( i18n("New Todo..."), icon, i18n("New Todo..."), 0, this );
nt_action->addTo( mCurrentItemMenu );
connect( nt_action, SIGNAL( activated() ),
mView, SLOT( newTodo() ) );
mNewSubTodoAction = new QAction( "new_subtodo", i18n("New Sub-Todo..."), 0,
this );
mNewSubTodoAction->addTo( mCurrentItemMenu );
connect( mNewSubTodoAction, SIGNAL( activated() ),
mView, SLOT( newSubTodo() ) );
mCurrentItemMenu->insertSeparator();
icon = loadPixmap( pathString + "newevent" );
configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 );
configureToolBarMenu->insertItem(i18n("Only one toolbar"), 6 );
configureToolBarMenu->insertSeparator();
configureToolBarMenu->insertItem(i18n("Filtermenu"), 7 );
configureToolBarMenu->insertSeparator();
configureToolBarMenu->insertItem(i18n("Week Number"), 400);
configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 );
+ icon = loadPixmap( pathString + "newtodo" );
+ configureToolBarMenu->insertItem(icon, i18n("New Todo..."), 20 );
//actionMenu->insertItem ( i18n("Selected Item"), mCurrentItemMenu);
mShowAction = new QAction( "show_incidence", i18n("Show"), 0, this );
mShowAction->addTo( mCurrentItemMenu );
connect( mShowAction, SIGNAL( activated() ),
mView, SLOT( showIncidence() ) );
mEditAction = new QAction( "edit_incidence", i18n("Edit..."), 0, this );
mEditAction->addTo( mCurrentItemMenu );
connect( mEditAction, SIGNAL( activated() ),
mView, SLOT( editIncidence() ) );
mDeleteAction = new QAction( "delete_incidence", i18n("Delete..."), 0, this );
mDeleteAction->addTo( mCurrentItemMenu );
connect( mDeleteAction, SIGNAL( activated() ),
mView, SLOT( deleteIncidence() ) );
mCloneAction = new QAction( "clone_incidence", i18n("Clone..."), 0, this );
mCloneAction->addTo( mCurrentItemMenu );
connect( mCloneAction, SIGNAL( activated() ),
mView, SLOT( cloneIncidence() ) );
mMoveAction = new QAction( "Move_incidence", i18n("Move..."), 0, this );
mMoveAction->addTo( mCurrentItemMenu );
@@ -1027,48 +1028,49 @@ void MainWindow::initActions()
icon = loadPixmap( pathString + "todo" );
configureToolBarMenu->insertItem(icon, i18n("Todo View"), 80 );
QAction* todoview_action = new QAction( i18n("Todo View"), icon, i18n("Todo View"), 0, this );
todoview_action->addTo( viewMenu );
connect( todoview_action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showTodoView() ) );
#if 0
action = new QAction( "view_timespan", "Time Span", 0, this );
action->addTo( viewMenu );
connect( action, SIGNAL( activated() ),
mView->viewManager(), SLOT( showTimeSpanView() ) );
#endif
action = new QAction( "purge_completed", i18n("Purge Completed..."), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( purgeCompleted() ) );
+ icon = loadPixmap( pathString + "search" );
configureToolBarMenu->insertItem(icon, i18n("Search"), 120 , 5);
actionMenu->insertSeparator();
action = new QAction( "manage cat", i18n("Edit category list..."), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( editCategories() ) );
action = new QAction( "manage cat", i18n("Manage new categories..."), 0,
this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ), mView, SLOT( manageCategories() ) );
actionMenu->insertSeparator();
icon = loadPixmap( pathString + "configure" );
action = new QAction( i18n("Configure"),icon, i18n("Configure KO/Pi..."), 0, this );
action->addTo( actionMenu );
connect( action, SIGNAL( activated() ),
mView, SLOT( edit_options() ) );
action = new QAction( i18n("Configure"),icon, i18n("Configure Calendar Files..."), 0, this );
action->addTo( actionMenu );
@@ -2304,49 +2306,52 @@ void MainWindow::selectFilter( int fil )
{
if ( fil == 0 ) {
mView->editFilters( );
} else if ( fil == 1 ){
if ( mView->filterView()->filtersEnabled() )
mView->toggleFilerEnabled( );
} else {
if ( !mView->filterView()->filtersEnabled() ) {
mView->filterView()->blockSignals( true );
mView->toggleFilerEnabled( );
mView->filterView()->blockSignals( false );
}
mView->selectFilter( fil-2 );
}
}
void MainWindow::updateFilterToolbar()
{
if ( filterMenubar ) {
if ( !mView->filterView()->filtersEnabled() ) {
filterMenubar->changeItem( 0, i18n("No Filter") );
} else {
CalFilter *curfilter = mView->filterView()->selectedFilter();
if ( curfilter ) {
- filterMenubar->changeItem( 0, curfilter->name() );
+ QString name = curfilter->name();
+ if ( name.length() > 12 )
+ name = name.left(10)+"...";
+ filterMenubar->changeItem( 0, name );
}
}
}
}
void MainWindow::selectFilterPopup( int fil )
{
selectFilter( fil + 1 );
}
void MainWindow::configureToolBar( int item )
{
configureToolBarMenu->setItemChecked( item, !configureToolBarMenu-> isItemChecked ( item ) );
KOPrefs *p = KOPrefs::instance();
p-> mShowIconStretch= configureToolBarMenu->isItemChecked( 5 );
p-> mShowIconOnetoolbar = configureToolBarMenu->isItemChecked( 6 );
p-> mShowIconFilter = configureToolBarMenu->isItemChecked( 7 );
p-> mShowIconNewEvent= configureToolBarMenu->isItemChecked( 10 );
p->mShowIconNewTodo = configureToolBarMenu->isItemChecked( 20 );
p->mShowIconNavigator = configureToolBarMenu->isItemChecked( 22 );
p->mShowIconAllday = configureToolBarMenu->isItemChecked( 24 );
p->mShowIconFilterview = configureToolBarMenu->isItemChecked( 26 );
p->mShowIconToggleFull = configureToolBarMenu->isItemChecked( 28 );
p-> mShowIconSearch= configureToolBarMenu->isItemChecked( 120 );
@@ -2641,33 +2646,35 @@ void MainWindow::weekAction()
if(popup->exec(iconToolBar->mapToGlobal(QPoint(x,y)-QPoint( dX,dY))))
{
month = picker->getResult();
emit selectWeek ( month );
//qDebug("weekSelected %d ", month);
}
delete popup;
}
void MainWindow::hideEvent ( QHideEvent * )
{
QString message;
QDateTime nextA = mCalendar->nextAlarmEventDateTime();
if ( nextA.isValid() ) {
QString sum = mCalendar->nextSummary();
message = i18n("%1 %2 - %3 (next event/todo with alarm)").arg( KGlobal::locale()->formatTime(nextA.time() , false)).arg(sum ).arg( KGlobal::locale()->formatDate(nextA.date() , false));
setCaption( message );
}
}
void MainWindow::resizeEvent( QResizeEvent* e)
{
#ifndef DESKTOP_VERSION
- if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
- if (QApplication::desktop()->width() > QApplication::desktop()->height() )
- filterToolBar->hide();
- else
- filterToolBar->show();
+ if ( filterToolBar ) {
+ if ( !KOPrefs::instance()->mShowIconFilter && !KOPrefs::instance()->mShowIconOnetoolbar && QApplication::desktop()->width() > 320) {
+ if (QApplication::desktop()->width() > QApplication::desktop()->height() )
+ filterToolBar->hide();
+ else
+ filterToolBar->show();
+ }
}
#endif
QMainWindow::resizeEvent( e);
}