-rw-r--r-- | korganizer/koprefs.cpp | 1 | ||||
-rw-r--r-- | korganizer/koprefs.h | 1 | ||||
-rw-r--r-- | korganizer/mainwindow.cpp | 26 | ||||
-rw-r--r-- | korganizer/searchdialog.cpp | 72 | ||||
-rw-r--r-- | korganizer/searchdialog.h | 7 |
5 files changed, 58 insertions, 49 deletions
diff --git a/korganizer/koprefs.cpp b/korganizer/koprefs.cpp index a91074f..7e3deff 100644 --- a/korganizer/koprefs.cpp +++ b/korganizer/koprefs.cpp @@ -84,8 +84,9 @@ KOPrefs::KOPrefs() : addItemBool("ShowIconToday",&mShowIconToday,true); addItemBool("ShowIconForward",&mShowIconForward,true); addItemBool("ShowIconForwardFast",&mShowIconForwardFast,true); addItemBool("ShowIconWhatsThis",&mShowIconWhatsThis,true); + addItemBool("ShowIconWeekNum",&mShowIconWeekNum,true); addItemBool("ShowIconNextDays",&mShowIconNextDays,true); addItemBool("ShowIconNext",&mShowIconNext,true); addItemBool("ShowIconJournal",&mShowIconJournal,true); addItemBool("ShowIconStretch",&mShowIconStretch,true); diff --git a/korganizer/koprefs.h b/korganizer/koprefs.h index e4e3dd7..09a0dce 100644 --- a/korganizer/koprefs.h +++ b/korganizer/koprefs.h @@ -180,8 +180,9 @@ class KOPrefs : public KPimPrefs bool mShowIconToday; bool mShowIconForward; bool mShowIconForwardFast; bool mShowIconWhatsThis; + bool mShowIconWeekNum; bool mShowIconNextDays; bool mShowIconNext; bool mShowIconJournal; diff --git a/korganizer/mainwindow.cpp b/korganizer/mainwindow.cpp index a164fa4..4f2cccf 100644 --- a/korganizer/mainwindow.cpp +++ b/korganizer/mainwindow.cpp @@ -570,9 +570,10 @@ void MainWindow::initActions() mWeekPixmap.resize( pixWid , pixHei ); mWeekPixmap.fill( mWeekBgColor ); icon = mWeekPixmap; mWeekAction = new QAction( i18n("Select week number"),icon, i18n("Select week number"), 0, this ); - mWeekAction->addTo( iconToolBar ); + if ( p-> mShowIconWeekNum ) + mWeekAction->addTo( iconToolBar ); mWeekFont = font(); int fontPoint = mWeekFont.pointSize(); QFontMetrics f( mWeekFont ); @@ -622,8 +623,9 @@ void MainWindow::initActions() icon = loadPixmap( pathString + "newevent" ); configureToolBarMenu->insertItem(i18n("Stretched TB"), 5 ); configureToolBarMenu->insertSeparator(); + configureToolBarMenu->insertItem(i18n("Week Number"), 400); configureToolBarMenu->insertItem(icon, i18n("New Event..."), 10 ); QAction* ne_action = new QAction( i18n("New Event..."), icon, i18n("New Event..."), 0, this ); ne_action->addTo( actionMenu ); connect( ne_action, SIGNAL( activated() ), @@ -705,23 +707,23 @@ void MainWindow::initActions() QAction* day7_action = new QAction( i18n("Week"), icon, i18n("Week"), 0, this ); day7_action->addTo( viewMenu ); connect( day7_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showWeekView() ) ); + + icon = loadPixmap( pathString + "workweek2" ); + configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); + QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); + day6_action->addTo( viewMenu ); + connect( day6_action, SIGNAL( activated() ), + mView->viewManager(), SLOT( showMonthViewWeek() ) ); icon = loadPixmap( pathString + "month" ); configureToolBarMenu->insertItem(icon, i18n("Month"), 70 ); QAction* month_action = new QAction( i18n("Month"), icon, i18n("Month"), 0, this ); month_action->addTo( viewMenu ); connect( month_action, SIGNAL( activated() ), mView->viewManager(), SLOT( showMonthView() ) ); - icon = loadPixmap( pathString + "workweek2" ); - configureToolBarMenu->insertItem(icon, i18n("List week view"), 75 ); - QAction* day6_action = new QAction( i18n("List week"), icon, i18n("List week"), 0, this ); - day6_action->addTo( viewMenu ); - connect( day6_action, SIGNAL( activated() ), - mView->viewManager(), SLOT( showMonthViewWeek() ) ); - 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 ); @@ -1000,12 +1002,12 @@ void MainWindow::initActions() if (p-> mShowIconDay5) day5_action->addTo( iconToolBar ); if (p-> mShowIconDay7) day7_action->addTo( iconToolBar ); - if (p-> mShowIconMonth) - month_action->addTo( iconToolBar ); if (p-> mShowIconDay6) day6_action->addTo( iconToolBar ); + if (p-> mShowIconMonth) + month_action->addTo( iconToolBar ); if (p-> mShowIconTodoview) todoview_action->addTo( iconToolBar ); if (p-> mShowIconJournal) viewjournal_action->addTo( iconToolBar ); @@ -1086,9 +1088,10 @@ void MainWindow::initActions() if (p-> mShowIconJournal) configureToolBarMenu->setItemChecked( 90, true ); if (p-> mShowIconWhatsThis) configureToolBarMenu->setItemChecked( 300, true ); - + if (p-> mShowIconWeekNum) + configureToolBarMenu->setItemChecked( 400, true ); QLabel* dummy = new QLabel( iconToolBar ); dummy->setBackgroundColor( iconToolBar->backgroundColor() ); if (!p-> mShowIconStretch) iconToolBar->setStretchableWidget ( dummy ) ; @@ -1827,8 +1830,9 @@ void MainWindow::configureToolBar( int item ) p-> mShowIconNextDays= configureToolBarMenu->isItemChecked( 100 ); p-> mShowIconNext= configureToolBarMenu->isItemChecked( 110 ); p-> mShowIconJournal= configureToolBarMenu->isItemChecked( 90 ); p-> mShowIconWhatsThis= configureToolBarMenu->isItemChecked( 300 ); + p-> mShowIconWeekNum= configureToolBarMenu->isItemChecked( 400 ); // initActions(); } void MainWindow::setCaptionToDates() diff --git a/korganizer/searchdialog.cpp b/korganizer/searchdialog.cpp index 3fd9740..aa1b244 100644 --- a/korganizer/searchdialog.cpp +++ b/korganizer/searchdialog.cpp @@ -25,8 +25,9 @@ #include <qlayout.h> #include <qcheckbox.h> #include <qgroupbox.h> #include <qlabel.h> +#include <qwhatsthis.h> #include <qlineedit.h> #include <qpushbutton.h> #include <klocale.h> @@ -41,35 +42,36 @@ #include "koviewmanager.h" #include "searchdialog.h" SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) - : KDialogBase(Plain,i18n("KO/Pi Find "),User1|Close,User1,parent,0,false,false, - i18n("&Find")) + : QVBox( 0 ) + { mCalendar = calendar; - QFrame *topFrame = plainPage(); - QVBoxLayout *layout = new QVBoxLayout(topFrame,0,spacingHint()); + QFrame *topFrame = new QFrame( this ) ;//plainPage(); + QVBoxLayout *layout = new QVBoxLayout(topFrame,KDialog::marginHint(),KDialog::spacingHint()); // Search expression QHBoxLayout *subLayout = new QHBoxLayout(); layout->addLayout(subLayout); - searchLabel = new QLabel(topFrame); searchLabel->setText(i18n("Search for:")); subLayout->addWidget(searchLabel); searchEdit = new QLineEdit(topFrame); subLayout->addWidget(searchEdit); + QPushButton *OkButton = new QPushButton( i18n("&Find"), topFrame ); + //OkButton->setDefault( true ); + connect(OkButton,SIGNAL(clicked()),SLOT(doSearch())); + subLayout->addWidget(OkButton); searchEdit->setText("*"); // Find all events by default searchEdit->setFocus(); connect(searchEdit, SIGNAL(textChanged ( const QString & )),this,SLOT(searchTextChanged( const QString & ))); connect(searchEdit, SIGNAL( returnPressed () ),this,SLOT(doSearch())); // 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); @@ -95,44 +97,29 @@ SearchDialog::SearchDialog(Calendar *calendar,CalendarView *parent) // topFrame); // layout->addWidget(rangeGroup); QWidget *rangeWidget = new QWidget(topFrame); - QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,spacingHint()); - + QHBoxLayout *rangeLayout = new QHBoxLayout(rangeWidget,0,KDialog::spacingHint()); rangeLayout->addWidget(new QLabel(i18n("From:"),rangeWidget)); mStartDate = new KDateEdit(rangeWidget); rangeLayout->addWidget(mStartDate); rangeLayout->addWidget(new QLabel(i18n("To:"),rangeWidget)); mEndDate = new KDateEdit(rangeWidget); mEndDate->setDate(QDate::currentDate().addDays(365)); rangeLayout->addWidget(mEndDate); - - // mInclusiveCheck = new QCheckBox(i18n("Events have to be completely included"), topFrame); - //mInclusiveCheck->setChecked(false); + QToolButton *wt = QWhatsThis::whatsThisButton ( rangeWidget ); + rangeLayout->addWidget( (QWidget*)wt ); layout->addWidget(rangeWidget); - //layout->addWidget(mInclusiveCheck); - // Subjects to search - - // Results list view listView = new KOListView(mCalendar,topFrame); - //listView->showDates(); - - layout->addWidget(listView); - // if ( KOPrefs::instance()->mCompactDialogs ) { - // KOGlobals::fitDialogToScreen( this, true ); - // } - listView->readSettings(KOGlobals::config(),"SearchListView Layout"); - connect(this,SIGNAL(user1Clicked()),SLOT(doSearch())); - QPushButton *CloseButton = findButton( Close ); - //connect(CloseButton,SIGNAL(clicked()),listView, SLOT(clear())); -#ifndef DESKTOP_VERSION - setCaption(i18n("Click OK to search ->")); - hideButtons(); + setCaption( i18n("KO/Pi Find: ")); +#ifdef DESKTOP_VERSION + OkButton = new QPushButton( i18n("Close"), this ); + connect(OkButton,SIGNAL(clicked()),SLOT(hide())); #endif } SearchDialog::~SearchDialog() @@ -157,9 +144,11 @@ void SearchDialog::updateList() } } void SearchDialog::searchTextChanged( const QString &_text ) { +#if 0 enableButton( KDialogBase::User1, !_text.isEmpty() ); +#endif } void SearchDialog::doSearch() { @@ -389,13 +378,28 @@ void SearchDialog::search(const QRegExp &re) } } } -/* + void SearchDialog::keyPressEvent ( QKeyEvent *e) { - - e->ignore(); - + switch ( e->key() ) { + case Qt::Key_Escape: + hide(); + break; + case Qt::Key_F: + if ( e->state() == Qt::ControlButton ) { + qDebug("full "); + + } + break; + case Qt::Key_Return: + case Qt::Key_Enter: + doSearch(); + break; + + default: + e->ignore(); + } } -*/ + //mMatchedJournals; diff --git a/korganizer/searchdialog.h b/korganizer/searchdialog.h index ebcff7a..f4aad9e 100644 --- a/korganizer/searchdialog.h +++ b/korganizer/searchdialog.h @@ -26,8 +26,9 @@ #include <qregexp.h> #include <kdialogbase.h> +#include <qvbox.h> #include <libkcal/calendar.h> #include "kolistview.h" @@ -38,10 +39,9 @@ class QLineEdit; class QLabel; class CalendarView; using namespace KCal; - -class SearchDialog : public KDialogBase +class SearchDialog : public QVBox { Q_OBJECT public: SearchDialog(Calendar *calendar,CalendarView *parent=0); @@ -77,17 +77,16 @@ class SearchDialog : public KDialogBase KOListView *listView; KDateEdit *mStartDate; KDateEdit *mEndDate; - // QCheckBox *mInclusiveCheck; QCheckBox *mSummaryCheck; QCheckBox *mDescriptionCheck; QCheckBox *mCategoryCheck; QCheckBox *mSearchEvent; QCheckBox *mSearchTodo; QCheckBox *mSearchJournal; QCheckBox *mSearchAName; QCheckBox *mSearchAEmail; - //void keyPressEvent ( QKeyEvent *e) ; + void keyPressEvent ( QKeyEvent *e) ; }; #endif |