author | zautrix <zautrix> | 2005-02-05 12:03:42 (UTC) |
---|---|---|
committer | zautrix <zautrix> | 2005-02-05 12:03:42 (UTC) |
commit | f5902d0e08e0b10321c555e8846a8a8ce2087d30 (patch) (side-by-side diff) | |
tree | 5aeaa9689b3161867fb0c8707adc5908b5072f06 | |
parent | 86c0d35262454a31ed7d50d3e20cbdace954ebdf (diff) | |
download | kdepimpi-f5902d0e08e0b10321c555e8846a8a8ce2087d30.zip kdepimpi-f5902d0e08e0b10321c555e8846a8a8ce2087d30.tar.gz kdepimpi-f5902d0e08e0b10321c555e8846a8a8ce2087d30.tar.bz2 |
file selector fix
-rw-r--r-- | bin/kdepim/WhatsNew.txt | 5 | ||||
-rw-r--r-- | korganizer/kolistview.cpp | 2 | ||||
-rw-r--r-- | microkde/kfiledialog.cpp | 2 | ||||
-rw-r--r-- | microkde/ofileselector_p.cpp | 28 | ||||
-rw-r--r-- | microkde/ofileselector_p.h | 1 |
5 files changed, 35 insertions, 3 deletions
diff --git a/bin/kdepim/WhatsNew.txt b/bin/kdepim/WhatsNew.txt index 9ba4f3e..4421e61 100644 --- a/bin/kdepim/WhatsNew.txt +++ b/bin/kdepim/WhatsNew.txt @@ -10,25 +10,28 @@ the popup menu: Set alarm for selected... Added to the event/todo viewer the option to send an email to all attendees or all selected (with RSVP) attendees. Made the week-month mode changing in month view faster. Made month view better useable with keyboard. Now TAB key jumps to next cell with an event/todo. Scroll in cell with coursor keys, scroll in time (next week) with Shift/Control + coursorkeys. Fixed bug that the todo view flat mode was reset after first view update. -If a todo is displayed closed in the todo view, it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. +If a todo is displayed closed in the todo view, +it is now displayed in overdue/due today color depending on the subtodos overdue/due today properties. + +Added info about the numbers of years to the caption (title) information about a birthday event. ********** VERSION 2.0.2 ************ KO/Pi: Fixed the layout problem of the day label buttons of the agenda view introduced in version 2.0.1. Added WhatsThis support for the todo view and the list view. Added a quite useful feature to the montview. Just click on the week numbers on the left. And in the top right corner of month view/agenda view diff --git a/korganizer/kolistview.cpp b/korganizer/kolistview.cpp index d0dbb47..acd9265 100644 --- a/korganizer/kolistview.cpp +++ b/korganizer/kolistview.cpp @@ -511,25 +511,25 @@ void KOListView::beamSelected() } void KOListView::beamDone( Ir *ir ) { #ifndef DESKTOP_VERSION delete ir; #endif topLevelWidget()->setCaption(i18n("KO/Pi:Beaming done")); } void KOListView::saveDescriptionToFile() { - int result = QMessageBox::warning( this, i18n("KO/Pi: Warning!"), + int result = QMessageBox::warning( this, i18n("KO/Pi: Information!"), i18n("This saves the text/details of selected\nJournals and Events/Todos\nto a text file."), i18n("Continue"), i18n("Cancel"), 0, 0, 1 ); if ( result != 0 ) { return; } int icount = 0; QPtrList<Incidence> delSel ; QListViewItem *item = mListView->firstChild (); while ( item ) { if ( item->isSelected() ) { delSel.append(((KOListViewItem *)item)->data()); diff --git a/microkde/kfiledialog.cpp b/microkde/kfiledialog.cpp index 977499e..309f8dc 100644 --- a/microkde/kfiledialog.cpp +++ b/microkde/kfiledialog.cpp @@ -13,24 +13,25 @@ QString KFileDialog::getSaveFileName( const QString & fn, { QString retfile = ""; QDialog dia ( par, "input-dialog", true ); QVBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); dia.setCaption( cap ); QString file = fn; if ( file.isEmpty() ) file = QDir::homeDirPath()+"/*"; QFileInfo fi ( file ); OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Save, fi.dirPath(true), fi.fileName() ); + QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); lay.addWidget( &o); // o.setNewVisible( true ); // o.setNameVisible( true ); dia.showMaximized(); int res = dia.exec(); if ( res ) retfile = o.selectedName(); return retfile; } QString KFileDialog::getOpenFileName( const QString & fn, const QString & cap, QWidget * par ) @@ -38,24 +39,25 @@ QString KFileDialog::getOpenFileName( const QString & fn, QString retfile = ""; QDialog dia ( par, "input-dialog", true ); // QLineEdit lab ( &dia ); QVBoxLayout lay( &dia ); lay.setMargin(7); lay.setSpacing(7); dia.setCaption( cap ); QString file = fn; if ( file.isEmpty() ) file = QDir::homeDirPath()+"/*";; QFileInfo fi ( file ); OFileSelector o ( &dia,OFileSelector::FileSelector, OFileSelector::Open, fi.dirPath(true), fi.fileName() ); + QObject::connect ( &o, SIGNAL( ok() ), &dia, SLOT ( accept () ) ); lay.addWidget( &o); dia.showMaximized(); int res = dia.exec(); if ( res ) retfile = o.selectedName(); return retfile; } #else #include <qfiledialog.h> diff --git a/microkde/ofileselector_p.cpp b/microkde/ofileselector_p.cpp index fd5f965..f85f8f4 100644 --- a/microkde/ofileselector_p.cpp +++ b/microkde/ofileselector_p.cpp @@ -376,75 +376,101 @@ void OFileViewFileListView::reread( bool all ) { } int OFileViewFileListView::fileCount()const{ return m_view->childCount(); } QString OFileViewFileListView::currentDir()const{ return m_currentDir; } OFileSelector* OFileViewFileListView::selector() { return m_sel; } bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) { +#if 0 if ( e->type() == QEvent::KeyPress ) { QKeyEvent *k = (QKeyEvent *)e; if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) { slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0); return true; } } +#endif return false; } void OFileViewFileListView::connectSlots() { connect(m_view, SIGNAL(clicked(QListViewItem*) ), this, SLOT(slotCurrentChanged(QListViewItem*) ) ); connect(m_view, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint&, int ) ), this, SLOT(slotClicked(int, QListViewItem*, const QPoint&, int ) ) ); + connect(m_view, SIGNAL(doubleClicked( QListViewItem* )), + this, SLOT(slotDoubleClicked(QListViewItem* ) ) ); + connect(m_view, SIGNAL(returnPressed( QListViewItem* )), + this, SLOT(slotDoubleClicked(QListViewItem* ) ) ); } void OFileViewFileListView::slotCurrentChanged( QListViewItem* item) { if (!item) return; #if 0 OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); if (!sel->isDir() ) { selector()->m_lneEdit->setText( sel->text(1) ); // if in fileselector mode we will emit selected if ( selector()->mode() == OFileSelector::FileSelector ) { qWarning("slot Current Changed"); QStringList str = QStringList::split("->", sel->text(1) ); QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); emit selector()->fileSelected( path ); DocLnk lnk( path ); emit selector()->fileSelected( lnk ); } } #endif } +void OFileViewFileListView::slotDoubleClicked(QListViewItem* item ) { + if (!item ) return; + OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); + if (!sel->isLocked() ) { + QStringList str = QStringList::split("->", sel->text(1) ); + if (sel->isDir() ) { + m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace(); + emit selector()->dirSelected( m_currentDir ); + reread( m_all ); + }else { // file + //qWarning("slot Clicked"); + selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); + QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); + emit selector()->fileSelected( path ); + DocLnk lnk( path ); + emit selector()->fileSelected( lnk ); + emit selector()->ok(); + } + } // not locked +} void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const QPoint&, int ) { if (!item || ( button != Qt::LeftButton) ) return; OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); if (!sel->isLocked() ) { QStringList str = QStringList::split("->", sel->text(1) ); if (sel->isDir() ) { m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace(); emit selector()->dirSelected( m_currentDir ); reread( m_all ); }else { // file - qWarning("slot Clicked"); + //qWarning("slot Clicked"); selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); emit selector()->fileSelected( path ); DocLnk lnk( path ); emit selector()->fileSelected( lnk ); } } // not locked } void OFileViewFileListView::addFile( QFileInfo* info, bool symlink ) { MimeType type( info->absFilePath() ); if (!compliesMime( type.id() ) ) return; diff --git a/microkde/ofileselector_p.h b/microkde/ofileselector_p.h index b371806..834fd70 100644 --- a/microkde/ofileselector_p.h +++ b/microkde/ofileselector_p.h @@ -117,24 +117,25 @@ public: int fileCount()const; QString currentDir()const; protected: bool eventFilter (QObject *o, QEvent *e); private slots: void slotNew(); // will emit newSelected void cdUP(); void cdHome(); void cdDoc(); void changeDir( const QString& ); void slotCurrentChanged( QListViewItem* ); void slotClicked(int, QListViewItem*, const QPoint&, int ); + void slotDoubleClicked(QListViewItem*); void slotFSActivated(int); protected: OFileSelector* selector(); private: QMap<QString, QString> m_dev; bool m_all : 1; OFileSelector* m_sel; QPopupMenu* m_fsPop; bool compliesMime( const QString& ); |