summaryrefslogtreecommitdiffabout
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--korganizer/calendarview.cpp6
-rw-r--r--korganizer/kodialogmanager.cpp4
-rw-r--r--korganizer/koprefs.h11
-rw-r--r--korganizer/koviewmanager.cpp20
-rw-r--r--korganizer/mainwindow.cpp1
-rw-r--r--korganizer/searchdialog.cpp47
-rw-r--r--korganizer/searchdialog.h1
-rw-r--r--microkde/KDGanttMinimizeSplitter.cpp7
-rw-r--r--microkde/kapplication.cpp15
-rw-r--r--microkde/kapplication.h1
-rw-r--r--microkde/kresources/factory.cpp6
11 files changed, 100 insertions, 19 deletions
diff --git a/korganizer/calendarview.cpp b/korganizer/calendarview.cpp
index 1e83236..beb19d9 100644
--- a/korganizer/calendarview.cpp
+++ b/korganizer/calendarview.cpp
@@ -1834,46 +1834,50 @@ void CalendarView::readSettings()
config->setGroup("WidgetLayout");
QStringList list;
list = config->readListEntry("MainLayout");
int x,y,w,h;
if ( ! list.isEmpty() ) {
x = list[0].toInt();
y = list[1].toInt();
w = list[2].toInt();
- h = list[3].toInt();
+ h = list[3].toInt();
+ KApplication::testCoords( &x,&y,&w,&h );
topLevelWidget()->setGeometry(x,y,w,h);
} else {
topLevelWidget()->setGeometry( 40 ,40 , 640, 440);
}
list = config->readListEntry("EditEventLayout");
if ( ! list.isEmpty() ) {
x = list[0].toInt();
y = list[1].toInt();
w = list[2].toInt();
h = list[3].toInt();
+ KApplication::testCoords( &x,&y,&w,&h );
mEventEditor->setGeometry(x,y,w,h);
}
list = config->readListEntry("EditTodoLayout");
if ( ! list.isEmpty() ) {
x = list[0].toInt();
y = list[1].toInt();
w = list[2].toInt();
h = list[3].toInt();
+ KApplication::testCoords( &x,&y,&w,&h );
mTodoEditor->setGeometry(x,y,w,h);
}
list = config->readListEntry("ViewerLayout");
if ( ! list.isEmpty() ) {
x = list[0].toInt();
y = list[1].toInt();
w = list[2].toInt();
h = list[3].toInt();
+ KApplication::testCoords( &x,&y,&w,&h );
getEventViewerDialog()->setGeometry(x,y,w,h);
}
#endif
config->setGroup( "Views" );
int dateCount = config->readNumEntry( "ShownDatesCount", 7 );
QValueList<int> sizes = config->readIntListEntry("Left Splitter Frame");
diff --git a/korganizer/kodialogmanager.cpp b/korganizer/kodialogmanager.cpp
index a8652ea..c927b37 100644
--- a/korganizer/kodialogmanager.cpp
+++ b/korganizer/kodialogmanager.cpp
@@ -35,16 +35,17 @@
#include "plugindialog.h"
#endif
#ifndef KORG_NOARCHIVE
#include "archivedialog.h"
#endif
#include "kconfig.h"
#include "kodialogmanager.h"
+#include <kapplication.h>
KODialogManager::KODialogManager( CalendarView *mainView ) :
QObject(), mMainView( mainView )
{
mOutgoingDialog = 0;
mIncomingDialog = 0;
mOptionsDialog = 0;
mSearchDialog = 0;
@@ -199,30 +200,31 @@ void KODialogManager::showSearchDialog()
QStringList list;
list = config->readListEntry("SearchLayout");
int x,y,w,h;
if ( ! list.isEmpty() ) {
x = list[0].toInt();
y = list[1].toInt();
w = list[2].toInt();
h = list[3].toInt();
+ KApplication::testCoords( &x,&y,&w,&h );
mSearchDialog->setGeometry(x,y,w,h);
}
#endif
}
// make sure the widget is on top again
#ifdef DESKTOP_VERSION
mSearchDialog->show();
#else
mSearchDialog->setMaximumSize( QApplication::desktop()->size());
mSearchDialog->showMaximized();
#endif
- mSearchDialog->raise();
+ mSearchDialog->raiseAndSelect();
}
SearchDialog * KODialogManager::getSearchDialog()
{
return mSearchDialog;
}
void KODialogManager::showArchiveDialog()
{
diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h
index 3a07348..cf8dae6 100644
--- a/korganizer/koprefs.h
+++ b/korganizer/koprefs.h
@@ -27,16 +27,25 @@
#include <libkdepim/kpimprefs.h>
#include <qdict.h>
class KConfig;
class QFont;
class QColor;
class QStringList;
+#define VIEW_WN_VIEW 1
+#define VIEW_NX_VIEW 2
+#define VIEW_J_VIEW 3
+#define VIEW_A_VIEW 4
+#define VIEW_ML_VIEW 5
+#define VIEW_M_VIEW 6
+#define VIEW_L_VIEW 7
+#define VIEW_T_VIEW 8
+
class KOPrefs : public KPimPrefs
{
public:
enum { FormatVCalendar, FormatICalendar };
enum { MailClientKMail, MailClientSendmail };
enum { IMIPDummy, IMIPKMail };
enum { IMIPOutbox, IMIPdirectsend };
enum { neverAuto, addressbookAuto, selectedAuto };
@@ -285,16 +294,18 @@ class KOPrefs : public KPimPrefs
// settings for eventviewer
bool mEVshowDetails;
bool mEVshowCreated;
bool mEVshowChanged;
bool mWTshowDetails;
bool mWTshowCreated;
bool mWTshowChanged;
+ int mCurrentDisplayedView;
+
private:
QDict<QColor> mCategoryColors;
QColor mDefaultCategoryColor;
QFont mDefaultTimeBarFont;
QFont mDefaultViewFont;
QFont mDefaultMonthViewFont;
diff --git a/korganizer/koviewmanager.cpp b/korganizer/koviewmanager.cpp
index c442d0b..406e741 100644
--- a/korganizer/koviewmanager.cpp
+++ b/korganizer/koviewmanager.cpp
@@ -222,25 +222,17 @@ void KOViewManager::showNextView()
if (mCurrentView == mMonthView && KOPrefs::instance()->mMonthViewWeek) goto MONTH;
if (mCurrentView == mMonthView ) goto LIST;
if (mCurrentView == mListView ) goto TODO;
// if (mCurrentView == mTodoView ) goto NEXT;
NEXT:
if ( KOPrefs::instance()->mShowIconNext ) { showWhatsNextView();goto ENTE ;}
NEXT_X:
if ( KOPrefs::instance()->mShowIconNextDays ) {
- globalFlagBlockAgenda = 1;
- if ( mCurrentAgendaView != 3 )
- mCurrentAgendaView = -1;
- showAgendaView(KOPrefs::instance()->mFullViewMonth);
- globalFlagBlockAgenda = 2;
- mMainView->dateNavigator()->selectDates( baseCycleDate ,
- KOPrefs::instance()->mNextXDays );
- mFlagShowNextxDays = true;
- mCurrentAgendaView = 3 ;
+ showNextXView();
goto ENTE ;
}
JOURNAL:
if ( KOPrefs::instance()->mShowIconJournal ) {
resetDateSilent( baseCycleDate , 1 );
showJournalView() ;goto ENTE ;}
DAY_1:
if ( KOPrefs::instance()->mShowIconDay1 ) {
@@ -402,17 +394,17 @@ void KOViewManager::showWhatsNextView()
connect(mMainView, SIGNAL(configChanged()), mWhatsNextView, SLOT(updateConfig()));
addView(mWhatsNextView);
connect(this, SIGNAL( printWNV() ),
mWhatsNextView, SLOT( printMe() ) );
}
globalFlagBlockAgenda = 1;
showView(mWhatsNextView, true );
//mWhatsNextView->updateView();
-
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_WN_VIEW;
}
void KOViewManager::slotprintWNV()
{
if (!mWhatsNextView)
showWhatsNextView();
emit printWNV();
@@ -448,16 +440,17 @@ void KOViewManager::showListView()
globalFlagBlockAgenda = 1;
if ( KOPrefs::instance()->mListViewMonthTimespan ) {
mMainView->setBlockShowDates( true );
mMainView->dateNavigator()->selectMonth();
mMainView->setBlockShowDates( false );
}
showView(mListView, KOPrefs::instance()->mFullViewTodo);
//mFlagShowNextxDays = temp;
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_L_VIEW;
}
void KOViewManager::showAgendaView( bool fullScreen )
{
mMainView->dialogManager()->hideSearchDialog();
// qDebug("KOViewManager::showAgendaView ");
bool full;
@@ -513,17 +506,17 @@ void KOViewManager::showAgendaView( bool fullScreen )
mMainView, SLOT ( beamIncidence( Incidence * ) ) );
connect( mAgendaView, SIGNAL( selectWeekNum( int ) ),
mMainView->dateNavigator(), SLOT ( selectWeek( int ) ) );
mAgendaView->readSettings();
mAgendaView->updateConfig();
}
showView( mAgendaView, full);
-
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_A_VIEW;
}
void KOViewManager::showDayView()
{
mCurrentAgendaView = mMainView->dateNavigator()->selectedDates().count();
mFlagShowNextxDays = false;
globalFlagBlockLabel = 1;
globalFlagBlockAgenda = 1;
@@ -587,16 +580,17 @@ void KOViewManager::showNextXView()
if ( mCurrentAgendaView != 3 )
mCurrentAgendaView = -1;
showAgendaView(KOPrefs::instance()->mFullViewMonth);
globalFlagBlockAgenda = 2;
mMainView->dateNavigator()->selectDates( QDate::currentDate(),
KOPrefs::instance()->mNextXDays );
mFlagShowNextxDays = true;
mCurrentAgendaView = 3 ;
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_NX_VIEW;
}
bool KOViewManager::showsNextDays()
{
return mFlagShowNextxDays;
}
void KOViewManager::createMonthView()
{
if (!mMonthView) {
@@ -671,16 +665,17 @@ void KOViewManager::showMonthViewWeek()
if ( KOPrefs::instance()->mViewChangeHoldNonFullscreen && mMainView->leftFrame()->isVisible() )
full = false;
else
full = true;
}
mMainView->dateNavigator()->selectWeek();
showView(mMonthView, full );
mMonthView->setKeyBFocus();
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_ML_VIEW ;
}
void KOViewManager::showMonth( const QDate & date )
{
mMainView->dateNavigator()->blockSignals( true );
mMainView->dateNavigator()->selectDate( date );
mMainView->dateNavigator()->blockSignals( false );
showMonthView();
@@ -701,16 +696,17 @@ void KOViewManager::showMonthView()
full = false;
else
full = true;
}
mMainView->dateNavigator()->selectMonth();
showView(mMonthView, full );
mMonthView->setKeyBFocus();
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_M_VIEW ;
}
void KOViewManager::showTodoView()
{
//mFlagShowNextxDays = false;
if ( !mTodoView ) {
mTodoView = new KOTodoView( mMainView->calendar(), mMainView->viewStack(),
@@ -756,16 +752,17 @@ void KOViewManager::showTodoView()
mMainView, SLOT ( beamIncidence( Incidence * ) ) );
KConfig *config = KOGlobals::config();
mTodoView->restoreLayout(config,"Todo View");
mTodoView->setNavigator( mMainView->dateNavigator() );
}
globalFlagBlockAgenda = 1;
showView( mTodoView, true );
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_T_VIEW ;
}
void KOViewManager::showJournalView()
{
//mFlagShowNextxDays = false;
if (!mJournalView) {
mJournalView = new KOJournalView(mMainView->calendar(),mMainView->viewStack(),
@@ -773,16 +770,17 @@ void KOViewManager::showJournalView()
connect( mMainView, SIGNAL( configChanged() ), mJournalView,
SLOT( updateConfig() ) );
connect(mJournalView, SIGNAL(deleteJournal(Journal *) ), mMainView,SLOT(deleteJournal(Journal *)) );
addView(mJournalView);
}
showView(mJournalView);
mMainView->dateNavigator()->selectDates( 1 );
+ KOPrefs::instance()->mCurrentDisplayedView = VIEW_J_VIEW ;
}
void KOViewManager::showTimeSpanView()
{
//mFlagShowNextxDays = false;
if (!mTimeSpanView) {
mTimeSpanView = new KOTimeSpanView(mMainView->calendar(),mMainView->viewStack(),
"KOViewManager::TimeSpanView");
diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp
index d98915b..357154e 100644
--- a/korganizer/mainwindow.cpp
+++ b/korganizer/mainwindow.cpp
@@ -140,16 +140,17 @@ MainWindow::MainWindow( QWidget *parent, const char *name, QString msg) :
QFileInfo finf ( confFile );
bool showWarning = !finf.exists();
setIcon(SmallIcon( "ko24" ) );
mBlockAtStartup = true;
mFlagKeyPressed = false;
setCaption("KO/Pi");
KOPrefs *p = KOPrefs::instance();
KPimGlobalPrefs::instance()->setGlobalConfig();
+ p->mCurrentDisplayedView = 0;
if ( p->mHourSize > 22 )
p->mHourSize = 22;
QMainWindow::ToolBarDock tbd;
if ( p->mToolBarHor ) {
if ( p->mToolBarUp )
tbd = Bottom;
else
tbd = Top;
diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp
index 341a839..db60383 100644
--- a/korganizer/searchdialog.cpp
+++ b/korganizer/searchdialog.cpp
@@ -72,17 +72,17 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
// Subjects to search
// QGroupBox *subjectGroup = new QGroupBox(1,Vertical,i18n("Search In"),
// topFrame);
QHBox *incidenceGroup = new QHBox( topFrame );
layout->addWidget(incidenceGroup);
mSearchEvent = new QCheckBox(i18n("Events"),incidenceGroup);
- mSearchEvent->setChecked(true);
+ //mSearchEvent->setChecked(true);
mSearchTodo = new QCheckBox(i18n("Todos"),incidenceGroup);
mSearchJournal = new QCheckBox(i18n("Journals"),incidenceGroup);
QHBox *subjectGroup = new QHBox( topFrame );
layout->addWidget(subjectGroup);
mSummaryCheck = new QCheckBox(i18n("Summary/Loc."),subjectGroup);
mSummaryCheck->setChecked(true);
@@ -124,16 +124,59 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent)
connect(OkButton,SIGNAL(clicked()),SLOT(hide()));
#endif
}
SearchDialog::~SearchDialog()
{
}
+void SearchDialog::raiseAndSelect()
+{
+
+ static int currentState = 0;
+
+ if ( !mSearchJournal->isChecked() && !mSearchTodo->isChecked() && !mSearchEvent->isChecked() )
+ currentState = 0;
+ int newState = 0;
+ if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
+ newState = VIEW_J_VIEW;
+ }
+ else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
+ newState = VIEW_T_VIEW;
+ }
+ else {
+ newState = VIEW_A_VIEW;
+ }
+ if ( newState != currentState ) {
+ if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_J_VIEW ) {
+ if ( ! mSearchJournal->isChecked() ) {
+ mSearchJournal->setChecked( true );
+ mSearchTodo->setChecked( false );
+ mSearchEvent->setChecked( false );
+ }
+ }
+ else if ( KOPrefs::instance()->mCurrentDisplayedView == VIEW_T_VIEW ) {
+ if ( ! mSearchTodo->isChecked() ) {
+ mSearchTodo->setChecked( true );
+ mSearchJournal->setChecked( false );
+ mSearchEvent->setChecked( false );
+ }
+ }
+ else {
+ if ( ! mSearchEvent->isChecked() ) {
+ mSearchEvent->setChecked( true );
+ mSearchJournal->setChecked( false );
+ mSearchTodo->setChecked( false );
+ }
+ }
+ }
+ currentState = newState;
+ raise();
+}
void SearchDialog::setFocusToList()
{
listView->resetFocus();
}
void SearchDialog::accept()
{
doSearch();
}
@@ -196,17 +239,17 @@ void SearchDialog::doSearch()
searchEdit->setFocus();
}
void SearchDialog::updateConfig()
{
listView->updateConfig();
}
void SearchDialog::updateView()
{
-
+ //qDebug("SearchDialog::updateView() %d ", isVisible());
QRegExp re;
re.setWildcard(true); // most people understand these better.
re.setCaseSensitive(false);
re.setPattern(searchEdit->text());
if (re.isValid()) {
search(re);
} else {
mMatchedEvents.clear();
diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h
index b730ed5..4559d20 100644
--- a/korganizer/searchdialog.h
+++ b/korganizer/searchdialog.h
@@ -44,16 +44,17 @@ using namespace KCal;
class SearchDialog : public QVBox
{
Q_OBJECT
public:
SearchDialog(Calendar *calendar,CalendarView *parent=0);
virtual ~SearchDialog();
KOListView *listview(){ return listView;}
void updateView();
+ void raiseAndSelect();
public slots:
void changeEventDisplay(Event *, int) { updateView(); }
void updateConfig();
void updateList();
protected slots:
void setFocusToList();
void accept();
diff --git a/microkde/KDGanttMinimizeSplitter.cpp b/microkde/KDGanttMinimizeSplitter.cpp
index c60b566..029f14b 100644
--- a/microkde/KDGanttMinimizeSplitter.cpp
+++ b/microkde/KDGanttMinimizeSplitter.cpp
@@ -107,17 +107,17 @@ void KDGanttSplitterHandle::mouseMoveEvent( QMouseEvent *e )
if ( !(e->state()&LeftButton) )
return;
if ( _activeButton != 0)
return;
QCOORD pos = s->pick(parentWidget()->mapFromGlobal(e->globalPos()))
- mouseOffset;
- if ( true /*opaque()*/ ) {
+ if ( opaque() ) {
s->moveSplitter( pos, id() );
} else {
int min = pos; int max = pos;
s->getRange( id(), &min, &max );
s->setRubberband( QMAX( min, QMIN(max, pos )));
}
_collapsed = false;
}
@@ -478,16 +478,21 @@ KDGanttMinimizeSplitter::~KDGanttMinimizeSplitter()
#if QT_VERSION >= 232
void KDGanttMinimizeSplitter::init()
{
data = new QSplitterData;
if ( orient == Horizontal )
setSizePolicy( QSizePolicy(QSizePolicy::Expanding,QSizePolicy::Minimum) );
else
setSizePolicy( QSizePolicy(QSizePolicy::Minimum,QSizePolicy::Expanding) );
+#ifndef DESKTOP_VERSION
+ setOpaqueResize( false );
+#else
+ setOpaqueResize( true );
+#endif
}
#endif
void KDGanttMinimizeSplitter::toggle()
{
if ( mFirstHandle )
mFirstHandle->toggle();
diff --git a/microkde/kapplication.cpp b/microkde/kapplication.cpp
index f05b91b..80a83e0 100644
--- a/microkde/kapplication.cpp
+++ b/microkde/kapplication.cpp
@@ -41,16 +41,31 @@ int KApplication::execDialog( QDialog* d )
;//d->resize( 800, 600 );
return d->exec();
}
void KApplication::showLicence()
{
KApplication::showFile( "KDE-Pim/Pi licence", "kdepim/licence.txt" );
}
+void KApplication::testCoords( int* x, int* y, int* wid, int * hei )
+{
+ int dWid = QApplication::desktop()->width() ;
+ int dHei = QApplication::desktop()->height();
+ if ( *x + *wid > dWid ) {
+ *x = 0;
+ if ( *wid > dWid )
+ *wid = dWid;
+ }
+ if ( *y + *hei > dHei ) {
+ *y = 0;
+ if ( *hei > dHei )
+ *hei = dHei;
+ }
+}
void KApplication::showFile(QString caption, QString fn)
{
QString text;
QString fileName;
#ifndef DESKTOP_VERSION
fileName = getenv("QPEDIR");
fileName += "/pics/" + fn ;
#else
diff --git a/microkde/kapplication.h b/microkde/kapplication.h
index 497ec2f..f7eb1ef 100644
--- a/microkde/kapplication.h
+++ b/microkde/kapplication.h
@@ -16,15 +16,16 @@ class KApplication
/**
* Generates a random string. It operates in the range [A-Za-z0-9]
* @param length Generate a string of this length.
* @return the random string
*/
static QString randomString(int length);
static int execDialog( QDialog* );
static void showLicence();
+ static void testCoords( int* x, int* y, int* wid, int * hei );
static void showFile(QString caption, QString file);
static void showText(QString caption, QString text);
static bool convert2latin1(QString file);
};
#endif
diff --git a/microkde/kresources/factory.cpp b/microkde/kresources/factory.cpp
index 3d1889f..a3b7fff 100644
--- a/microkde/kresources/factory.cpp
+++ b/microkde/kresources/factory.cpp
@@ -75,29 +75,29 @@ Factory::Factory( const QString& resourceFamily) :
mTypeMap.insert( type.toString(), *it );
}
*/
//US new
PluginInfo* info = new PluginInfo;
info->library = "microkabc_file";
info->nameLabel = i18n( "file" );
- info->descriptionLabel = i18n( "Choose one file" );
+ info->descriptionLabel = i18n( "One file" );
mTypeMap.insert( "file", info );
info = new PluginInfo;
info->library = "microkabc_dir";
info->nameLabel = i18n( "dir" );
- info->descriptionLabel = i18n( "Choose a directory with may files" );
+ info->descriptionLabel = i18n( "A directory with many files" );
mTypeMap.insert( "dir", info );
info = new PluginInfo;
info->library = "microkabc_ldap";
info->nameLabel = i18n( "ldap" );
- info->descriptionLabel = i18n( "No description available" );
+ info->descriptionLabel = i18n( "Connect to a directory server" );
mTypeMap.insert( "ldap", info );
//US add opie plugin only, if the library exists.
/*US
QString libname = "microkabc_opie";
QString path = KLibLoader::findLibrary( QFile::encodeName( libname ) );
if ( !path.isEmpty() )
{