summaryrefslogtreecommitdiff
path: root/core/pim
Side-by-side diff
Diffstat (limited to 'core/pim') (more/less context) (ignore whitespace changes)
-rw-r--r--core/pim/addressbook/contacteditor.cpp2
-rw-r--r--core/pim/osearch/mainwindow.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/core/pim/addressbook/contacteditor.cpp b/core/pim/addressbook/contacteditor.cpp
index 9c13017..312c663 100644
--- a/core/pim/addressbook/contacteditor.cpp
+++ b/core/pim/addressbook/contacteditor.cpp
@@ -173,193 +173,193 @@ void ContactEditor::init() {
cmbChooserField1->setMaximumWidth( 90 );
gl->addWidget( cmbChooserField1, 4, 0 );
// Textfield for chooser 1.
// Now use Widgetstack to contain the textfield and the default-email combo !
m_widgetStack1 = new QWidgetStack( container );
txtChooserField1 = new QLineEdit( m_widgetStack1 );
m_widgetStack1 -> addWidget( txtChooserField1, TextField );
gl->addWidget( m_widgetStack1, 4, 1 );
m_widgetStack1 -> raiseWidget( TextField );
// Chooser 2
cmbChooserField2 = new QComboBox( FALSE, container );
QWhatsThis::add( cmbChooserField2, tr( "Press to select attribute to change" ) );
cmbChooserField2->setMaximumWidth( 90 );
gl->addWidget( cmbChooserField2, 5, 0 );
// Textfield for chooser 2
// Now use WidgetStack to contain the textfield and the default-email combo!
m_widgetStack2 = new QWidgetStack( container );
txtChooserField2 = new QLineEdit( m_widgetStack2 );
m_widgetStack2 -> addWidget( txtChooserField2, TextField );
gl->addWidget( m_widgetStack2, 5, 1 );
m_widgetStack2 -> raiseWidget( TextField );
// Chooser 3
cmbChooserField3 = new QComboBox( FALSE, container );
QWhatsThis::add( cmbChooserField3, tr( "Press to select attribute to change" ) );
cmbChooserField3->setMaximumWidth( 90 );
gl->addWidget( cmbChooserField3, 6, 0 );
// Textfield for chooser 2
// Now use WidgetStack to contain the textfield and the default-email combo!
m_widgetStack3 = new QWidgetStack( container );
txtChooserField3 = new QLineEdit( m_widgetStack3 );
m_widgetStack3 -> addWidget( txtChooserField3, TextField );
gl->addWidget( m_widgetStack3, 6, 1 );
m_widgetStack3 -> raiseWidget( TextField );
l = new QLabel( tr( "File As" ), container );
QWhatsThis::add( l, tr( "Press to select how to store the name (and howto show it in the listview)" ) );
gl->addWidget( l, 7, 0 );
cmbFileAs = new QComboBox( TRUE, container );
gl->addWidget( cmbFileAs, 7, 1 );
labCat = new QLabel( tr( "Category" ), container );
gl->addWidget( labCat, 8, 0 );
cmbCat = new CategorySelect( container );
gl->addWidget( cmbCat, 8, 1 );
labCat->show();
cmbCat->show();
btnNote = new QPushButton( tr( "Notes..." ), container );
gl->addWidget( btnNote, 9, 1 );
tabMain->insertTab( tabViewport, tr( "General" ) );
tabViewport = new QWidget ( tabMain );
vb = new QVBoxLayout( tabViewport );
svAddress = new QScrollView( tabViewport );
vb->addWidget( svAddress, 0, 0 );
svAddress->setResizePolicy( QScrollView::AutoOneFit );
svAddress->setFrameStyle( QFrame::NoFrame );
container = new QWidget( svAddress->viewport() );
svAddress->addChild( container );
gl = new QGridLayout( container, 8, 3, 2, 4 ); // row 7 QSpacerItem
cmbAddress = new QComboBox( FALSE, container );
cmbAddress->insertItem( tr( "Business" ) );
cmbAddress->insertItem( tr( "Home" ) );
gl->addMultiCellWidget( cmbAddress, 0, 0, 0, 1 );
l = new QLabel( tr( "Address" ), container );
gl->addWidget( l, 1, 0 );
txtAddress = new QLineEdit( container );
gl->addMultiCellWidget( txtAddress, 1, 1, 1, 2 );
l = new QLabel( tr( "City" ), container );
gl->addWidget( l, 2, 0 );
txtCity = new QLineEdit( container );
gl->addMultiCellWidget( txtCity, 2, 2, 1, 2 );
l = new QLabel( tr( "State" ), container );
gl->addWidget( l, 3, 0 );
txtState = new QLineEdit( container );
gl->addMultiCellWidget( txtState, 3, 3, 1, 2 );
l = new QLabel( tr( "Zip Code" ), container );
gl->addWidget( l, 4, 0 );
txtZip = new QLineEdit( container );
gl->addMultiCellWidget( txtZip, 4, 4, 1, 2 );
l = new QLabel( tr( "Country" ), container );
gl->addWidget( l, 5, 0 );
cmbCountry = new QComboBox( TRUE, container );
- cmbCountry->insertItem( tr( "" ) );
+ cmbCountry->insertItem( "" );
cmbCountry->insertItem( tr ( "United States" ) );
cmbCountry->insertItem( tr ( "United Kingdom" ) );
cmbCountry->insertItem( tr ( "Afghanistan" ) );
cmbCountry->insertItem( tr ( "Albania" ) );
cmbCountry->insertItem( tr ( "Algeria" ) );
cmbCountry->insertItem( tr ( "American Samoa" ) );
cmbCountry->insertItem( tr ( "Andorra" ) );
cmbCountry->insertItem( tr ( "Angola" ) );
cmbCountry->insertItem( tr ( "Anguilla" ) );
cmbCountry->insertItem( tr ( "Antarctica" ) );
cmbCountry->insertItem( tr ( "Argentina" ) );
cmbCountry->insertItem( tr ( "Armenia" ) );
cmbCountry->insertItem( tr ( "Aruba" ) );
cmbCountry->insertItem( tr ( "Australia" ) );
cmbCountry->insertItem( tr ( "Austria" ) );
cmbCountry->insertItem( tr ( "Azerbaijan" ) );
cmbCountry->insertItem( tr ( "Bahamas" ) );
cmbCountry->insertItem( tr ( "Bahrain" ) );
cmbCountry->insertItem( tr ( "Bangladesh" ) );
cmbCountry->insertItem( tr ( "Barbados" ) );
cmbCountry->insertItem( tr ( "Belarus" ) );
cmbCountry->insertItem( tr ( "Belgium" ) );
cmbCountry->insertItem( tr ( "Belize" ) );
cmbCountry->insertItem( tr ( "Benin" ) );
cmbCountry->insertItem( tr ( "Bermuda" ) );
cmbCountry->insertItem( tr ( "Bhutan" ) );
cmbCountry->insertItem( tr ( "Bolivia" ) );
cmbCountry->insertItem( tr ( "Botswana" ) );
cmbCountry->insertItem( tr ( "Bouvet Island" ) );
cmbCountry->insertItem( tr ( "Brazil" ) );
cmbCountry->insertItem( tr ( "Brunei Darussalam" ) );
cmbCountry->insertItem( tr ( "Bulgaria" ) );
cmbCountry->insertItem( tr ( "Burkina Faso" ) );
cmbCountry->insertItem( tr ( "Burundi" ) );
cmbCountry->insertItem( tr ( "Cambodia" ) );
cmbCountry->insertItem( tr ( "Cameroon" ) );
cmbCountry->insertItem( tr ( "Canada" ) );
cmbCountry->insertItem( tr ( "Cape Verde" ) );
cmbCountry->insertItem( tr ( "Cayman Islands" ) );
cmbCountry->insertItem( tr ( "Chad" ) );
cmbCountry->insertItem( tr ( "Chile" ) );
cmbCountry->insertItem( tr ( "China" ) );
cmbCountry->insertItem( tr ( "Christmas Island" ) );
cmbCountry->insertItem( tr ( "Colombia" ) );
cmbCountry->insertItem( tr ( "Comoros" ) );
cmbCountry->insertItem( tr ( "Congo" ) );
cmbCountry->insertItem( tr ( "Cook Island" ) );
cmbCountry->insertItem( tr ( "Costa Rica" ) );
cmbCountry->insertItem( tr ( "Cote d'Ivoire" ) );
cmbCountry->insertItem( tr ( "Croatia" ) );
cmbCountry->insertItem( tr ( "Cuba" ) );
cmbCountry->insertItem( tr ( "Cyprus" ) );
cmbCountry->insertItem( tr ( "Czech Republic" ) );
cmbCountry->insertItem( tr ( "Denmark" ) );
cmbCountry->insertItem( tr ( "Djibouti" ) );
cmbCountry->insertItem( tr ( "Dominica" ) );
cmbCountry->insertItem( tr ( "Dominican Republic" ) );
cmbCountry->insertItem( tr ( "East Timor" ) );
cmbCountry->insertItem( tr ( "Ecuador" ) );
cmbCountry->insertItem( tr ( "Egypt" ) );
cmbCountry->insertItem( tr ( "El Salvador" ) );
cmbCountry->insertItem( tr ( "Equatorial Guinea" ) );
cmbCountry->insertItem( tr ( "Eritrea" ) );
cmbCountry->insertItem( tr ( "Estonia" ) );
cmbCountry->insertItem( tr ( "Ethiopia" ) );
cmbCountry->insertItem( tr ( "Falkland Islands" ) );
cmbCountry->insertItem( tr ( "Faroe Islands" ) );
cmbCountry->insertItem( tr ( "Fiji" ) );
cmbCountry->insertItem( tr ( "Finland" ) );
cmbCountry->insertItem( tr ( "France" ) );
cmbCountry->insertItem( tr ( "French Guiana" ) );
cmbCountry->insertItem( tr ( "French Polynesia" ) );
cmbCountry->insertItem( tr ( "Gabon" ) );
cmbCountry->insertItem( tr ( "Gambia" ) );
cmbCountry->insertItem( tr ( "Georgia" ) );
cmbCountry->insertItem( tr ( "Germany" ) );
cmbCountry->insertItem( tr ( "Ghana" ) );
cmbCountry->insertItem( tr ( "Gibraltar" ) );
cmbCountry->insertItem( tr ( "Greece" ) );
cmbCountry->insertItem( tr ( "Greenland" ) );
cmbCountry->insertItem( tr ( "Grenada" ) );
cmbCountry->insertItem( tr ( "Guadeloupe" ) );
cmbCountry->insertItem( tr ( "Guam" ) );
cmbCountry->insertItem( tr ( "Guatemala" ) );
cmbCountry->insertItem( tr ( "Guinea" ) );
cmbCountry->insertItem( tr ( "Guinea-Bissau" ) );
cmbCountry->insertItem( tr ( "Guyana" ) );
cmbCountry->insertItem( tr ( "Haiti" ) );
cmbCountry->insertItem( tr ( "Holy See" ) );
cmbCountry->insertItem( tr ( "Honduras" ) );
cmbCountry->insertItem( tr ( "Hong Kong" ) );
cmbCountry->insertItem( tr ( "Hungary" ) );
cmbCountry->insertItem( tr ( "Iceland" ) );
cmbCountry->insertItem( tr ( "India" ) );
cmbCountry->insertItem( tr ( "Indonesia" ) );
cmbCountry->insertItem( tr ( "Ireland" ) );
diff --git a/core/pim/osearch/mainwindow.cpp b/core/pim/osearch/mainwindow.cpp
index 798e1f1..4589c9d 100644
--- a/core/pim/osearch/mainwindow.cpp
+++ b/core/pim/osearch/mainwindow.cpp
@@ -106,193 +106,193 @@ MainWindow::MainWindow( QWidget *parent, const char *name, WFlags f ) :
mainLayout->addWidget( detailsFrame );
mainLayout->addWidget( buttonBox );
detailsFrame->hide();
buttonBox->hide();
searches.append( new AppLnkSearch( resultsList, tr("Applications") ) );
searches.append( new DocLnkSearch( resultsList, tr("Documents") ) );
searches.append( new TodoSearch( resultsList, tr("Todo List") ) );
searches.append( new DatebookSearch( resultsList, tr("Calendar") ) );
searches.append( new AdressSearch( resultsList, tr("Contacts") ) );
setCentralWidget( mainFrame );
popupTimer = new QTimer();
searchTimer = new QTimer();
connect(popupTimer, SIGNAL(timeout()), SLOT(showPopup()));
connect(searchTimer, SIGNAL(timeout()), SLOT(searchStringChanged()));
connect(resultsList, SIGNAL(pressed(QListViewItem*)), SLOT(setCurrent(QListViewItem*)));
connect(resultsList, SIGNAL(clicked(QListViewItem*)), SLOT(stopTimer(QListViewItem*)));
signalMapper = new QSignalMapper( this );
connect(signalMapper, SIGNAL(mapped(int)), SLOT( slotAction(int) ) );
makeMenu();
Config cfg( "osearch", Config::User );
cfg.setGroup( "search_settings" );
actionCaseSensitiv->setOn( cfg.readBoolEntry( "caseSensitiv", false ) );
actionWildcards->setOn( cfg.readBoolEntry( "wildcards", false ) );
// actionWholeWordsOnly->setOn( cfg.readBoolEntry( "whole_words_only", false ) );
}
void MainWindow::makeMenu()
{
QToolBar *toolBar = new QToolBar( this );
QToolBar *searchBar = new QToolBar(this);
QMenuBar *menuBar = new QMenuBar( toolBar );
QPopupMenu *searchMenu = new QPopupMenu( menuBar );
// QPopupMenu *viewMenu = new QPopupMenu( menuBar );
QPopupMenu *cfgMenu = new QPopupMenu( menuBar );
QPopupMenu *searchOptions = new QPopupMenu( cfgMenu );
setToolBarsMovable( false );
toolBar->setHorizontalStretchable( true );
menuBar->insertItem( tr( "Search" ), searchMenu );
menuBar->insertItem( tr( "Settings" ), cfgMenu );
//SETTINGS MENU
cfgMenu->insertItem( tr( "Search" ), searchOptions );
QPopupMenu *pop;
for (SearchGroup *s = searches.first(); s != 0; s = searches.next() ){
pop = s->popupMenu();
if (pop){
cfgMenu->insertItem( s->text(0), pop );
}
}
//SEARCH
SearchAllAction = new QAction( tr("Search all"),QString::null, 0, this, 0 );
SearchAllAction->setIconSet( Resource::loadIconSet( "find" ) );
// QWhatsThis::add( SearchAllAction, tr("Search everything...") );
connect( SearchAllAction, SIGNAL(activated()), this, SLOT(searchAll()) );
SearchAllAction->addTo( searchMenu );
searchMenu->insertItem( tr( "Options" ), searchOptions );
//SEARCH OPTIONS
//actionWholeWordsOnly = new QAction( tr("Whole words only"),QString::null, 0, this, 0, true );
//actionWholeWordsOnly->addTo( searchOptions );
actionCaseSensitiv = new QAction( tr("Case sensitive"),QString::null, 0, this, 0, true );
actionCaseSensitiv->addTo( searchOptions );
actionWildcards = new QAction( tr("Use wildcards"),QString::null, 0, this, 0, true );
actionWildcards->addTo( searchOptions );
//SEARCH BAR
LabelEnterText = new QLabel( searchBar, "Label" );
LabelEnterText->setAutoMask( FALSE );
LabelEnterText->setText( tr( "Search for: " ) );
addToolBar( searchBar, "Search", QMainWindow::Top, TRUE );
QLineEdit *searchEdit = new QLineEdit( searchBar, "seachEdit" );
QWhatsThis::add( searchEdit, tr("Enter your search terms here") );
searchEdit->setFocus();
searchBar->setHorizontalStretchable( TRUE );
searchBar->setStretchableWidget( searchEdit );
//Search button
SearchAllAction->addTo( searchBar );
//image ripped of off opie-login/loginwindow.cpp
QPixmap image1( ( const char** ) image1_data );
//Clear text
ClearSearchText = new QToolButton( searchBar, "ClearSearchText");
- ClearSearchText->setText( tr( "" ) );
+ ClearSearchText->setText( "" );
ClearSearchText->setPixmap( image1 );
connect( searchEdit, SIGNAL( textChanged(const QString&) ),this, SLOT( setSearch(const QString&) ) );
connect( ClearSearchText, SIGNAL( clicked() ), searchEdit, SLOT( clear() ) );
}
MainWindow::~MainWindow()
{
Config cfg( "osearch", Config::User );
cfg.setGroup( "search_settings" );
cfg.writeEntry( "caseSensitiv", actionCaseSensitiv->isOn() );
cfg.writeEntry( "wildcards", actionWildcards->isOn() );
//cfg.writeEntry( "whole_words_only", actionWholeWordsOnly->isOn() );
}
void MainWindow::setCurrent(QListViewItem *item)
{
if (!item) return;
_currentItem = (OListViewItem*)item;
// _currentItem = dynamic_cast<OListViewItem*>(item);
if (_currentItem->rtti() == OListViewItem::Result){
ResultItem *res = (ResultItem*)item;
// ResultItem *res = dynamic_cast<ResultItem*>(item);
richEdit->setText( res->toRichText() );
QIntDict<QString> acts = res->actions();
QButton *button;
for (uint i = 0; i < acts.count(); i++){
button = buttonMap[i];
if (!button) {
owarn << " no button for " << *acts[i] << oendl;
button = new QPushButton( buttonBox );
buttonMap.insert( i, button );
signalMapper->setMapping(button, i );
connect(button, SIGNAL(clicked() ), signalMapper, SLOT(map() ) );
}
button->setText( *acts[i] );
button->show();
}
for (uint i = acts.count(); i < _buttonCount; i++){
button = buttonMap[i];
if (button) button->hide();
}
_buttonCount = acts.count();
detailsFrame->show();
buttonBox->show();
}else {
detailsFrame->hide();
buttonBox->hide();
}
popupTimer->start( 300, true );
}
void MainWindow::stopTimer(QListViewItem*)
{
popupTimer->stop();
}
void MainWindow::showPopup()
{
popupTimer->stop();
if (!_currentItem) return;
QPopupMenu *pop = _currentItem->popupMenu();
if (pop) pop->popup( QCursor::pos() );
}
void MainWindow::setSearch( const QString &key )
{
searchTimer->stop();
_searchString = key;
searchTimer->start( 300 );
}
void MainWindow::searchStringChanged()
{
#ifdef NEW_OWAIT
OWait("setting search string");
#endif
searchTimer->stop();
QString ss = _searchString;
//ss = Global::stringQuote( _searchString );
// if (actionWholeWordsOnly->isOn())
// ss = "\\s"+_searchString+"\\s";
// Opie:Core::odebug << " set searchString >" << ss << "<" << oendl;
QRegExp re( ss );
re.setCaseSensitive( actionCaseSensitiv->isOn() );
re.setWildcard( actionWildcards->isOn() );
for (SearchGroup *s = searches.first(); s != 0; s = searches.next() )
s->setSearch( re );
}
void MainWindow::searchAll()
{
#ifdef NEW_OWAIT
OWait("searching...");