author | alwin <alwin> | 2004-03-02 12:14:15 (UTC) |
---|---|---|
committer | alwin <alwin> | 2004-03-02 12:14:15 (UTC) |
commit | 0d59c780513da78033f4d9040475dee9db0256d4 (patch) (unidiff) | |
tree | 503d320b4aa3daae9982082e7b34e3e2c48bdfb7 /libopie2 | |
parent | a0981652d61776d70f25980f035748b21339e946 (diff) | |
download | opie-0d59c780513da78033f4d9040475dee9db0256d4.zip opie-0d59c780513da78033f4d9040475dee9db0256d4.tar.gz opie-0d59c780513da78033f4d9040475dee9db0256d4.tar.bz2 |
run the optimize_connect script
the whole cvs is tagged with "before_optimize_connect" if there are problems you
can check the diff (but it had compiled and run here)
-rw-r--r-- | libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp | 4 | ||||
-rw-r--r-- | libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp | 2 | ||||
-rw-r--r-- | libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp | 20 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_ipaq.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_simpad.cpp | 2 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_yopy.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/device/odevice_zaurus.cpp | 4 | ||||
-rw-r--r-- | libopie2/opiecore/oprocess.cpp | 12 | ||||
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.cpp | 8 | ||||
-rw-r--r-- | libopie2/opiepim/ui/opimmainwindow.cpp | 8 | ||||
-rw-r--r-- | libopie2/opiepim/ui/opimrecurrencewidget.cpp | 4 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofiledialog.cpp | 4 | ||||
-rw-r--r-- | libopie2/opieui/fileselector/ofileselector.cpp | 14 | ||||
-rw-r--r-- | libopie2/opieui/ofontselector.cpp | 8 | ||||
-rw-r--r-- | libopie2/opieui/otabwidget.cpp | 4 | ||||
-rw-r--r-- | libopie2/opieui/otimepicker.cpp | 12 | ||||
-rw-r--r-- | libopie2/opieui/oversatileview.cpp | 40 |
18 files changed, 77 insertions, 77 deletions
diff --git a/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp b/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp index a75f9dc..789496c 100644 --- a/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp +++ b/libopie2/examples/opieui/osplitter_example/osplitter_mail.cpp | |||
@@ -1,77 +1,77 @@ | |||
1 | 1 | ||
2 | #include <qstring.h> | 2 | #include <qstring.h> |
3 | #include <qlabel.h> | 3 | #include <qlabel.h> |
4 | #include <qheader.h> | 4 | #include <qheader.h> |
5 | #include <qlayout.h> | 5 | #include <qlayout.h> |
6 | 6 | ||
7 | #include <qpe/qpeapplication.h> | 7 | #include <qpe/qpeapplication.h> |
8 | 8 | ||
9 | #include <opie2/oapplicationfactory.h> | 9 | #include <opie2/oapplicationfactory.h> |
10 | #include "osplitter_mail.h" | 10 | #include "osplitter_mail.h" |
11 | 11 | ||
12 | OPIE_EXPORT_APP( OApplicationFactory<ListViews> ) | 12 | OPIE_EXPORT_APP( OApplicationFactory<ListViews> ) |
13 | 13 | ||
14 | class Folder { | 14 | class Folder { |
15 | int dummy; | 15 | int dummy; |
16 | }; | 16 | }; |
17 | 17 | ||
18 | // ----------------------------------------------------------------- | 18 | // ----------------------------------------------------------------- |
19 | 19 | ||
20 | ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) | 20 | ListViews::ListViews( QWidget* p, const char* name, WFlags fl ) |
21 | : QWidget( p, name, fl ) { | 21 | : QWidget( p, name, fl ) { |
22 | qApp->installEventFilter( this ); | 22 | qApp->installEventFilter( this ); |
23 | m_lstFolders.setAutoDelete( true ); | 23 | m_lstFolders.setAutoDelete( true ); |
24 | QHBoxLayout *lay = new QHBoxLayout(this); | 24 | QHBoxLayout *lay = new QHBoxLayout(this); |
25 | 25 | ||
26 | m_splitter = new OSplitter( Horizontal, this, "SPlitter 1" ); | 26 | m_splitter = new OSplitter( Horizontal, this, "SPlitter 1" ); |
27 | lay->addWidget( m_splitter ); | 27 | lay->addWidget( m_splitter ); |
28 | connect(m_splitter, SIGNAL(sizeChange(bool, const QSize& ) ), | 28 | connect(m_splitter, SIGNAL(sizeChange(bool,const QSize&) ), |
29 | this, SLOT(slotSizeChange(bool, const QSize& ) ) ); | 29 | this, SLOT(slotSizeChange(bool,const QSize&) ) ); |
30 | 30 | ||
31 | m_overview = new QListView( m_splitter ); | 31 | m_overview = new QListView( m_splitter ); |
32 | m_overview->header()->setClickEnabled( FALSE ); | 32 | m_overview->header()->setClickEnabled( FALSE ); |
33 | m_overview->addColumn( tr("Folder") ); | 33 | m_overview->addColumn( tr("Folder") ); |
34 | m_overview->setMaximumWidth( 200 ); | 34 | m_overview->setMaximumWidth( 200 ); |
35 | m_splitter->addWidget( m_overview, "zoom", tr("Folder Overview") ); | 35 | m_splitter->addWidget( m_overview, "zoom", tr("Folder Overview") ); |
36 | m_splitter->setSizeChange( 300 ); | 36 | m_splitter->setSizeChange( 300 ); |
37 | 37 | ||
38 | /* OSplitter starts with the small mode */ | 38 | /* OSplitter starts with the small mode */ |
39 | m_messages = 0; | 39 | m_messages = 0; |
40 | m_message = m_attach = 0; | 40 | m_message = m_attach = 0; |
41 | 41 | ||
42 | splitti = new OSplitter( Vertical, m_splitter, "Splitti2" ); | 42 | splitti = new OSplitter( Vertical, m_splitter, "Splitti2" ); |
43 | splitti->setSizeChange( 300 ); | 43 | splitti->setSizeChange( 300 ); |
44 | splitti->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); | 44 | splitti->setSizePolicy( QSizePolicy(QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding ) ); |
45 | 45 | ||
46 | QLabel *lbl = new QLabel(splitti); | 46 | QLabel *lbl = new QLabel(splitti); |
47 | lbl->setTextFormat ( Qt::RichText ); | 47 | lbl->setTextFormat ( Qt::RichText ); |
48 | lbl->setText("<br><br><b>Test Test Test</b><br><br><p>Fooooo hjhh</p>"); | 48 | lbl->setText("<br><br><b>Test Test Test</b><br><br><p>Fooooo hjhh</p>"); |
49 | 49 | ||
50 | m_messages = new QListView( splitti ); | 50 | m_messages = new QListView( splitti ); |
51 | m_messages->addColumn(" Messages "); | 51 | m_messages->addColumn(" Messages "); |
52 | 52 | ||
53 | folder1 = new QListView( splitti ); | 53 | folder1 = new QListView( splitti ); |
54 | folder1->addColumn( "Messages 2 " ); | 54 | folder1->addColumn( "Messages 2 " ); |
55 | 55 | ||
56 | splitti->addWidget(m_messages, "mail", tr("Mails") ); | 56 | splitti->addWidget(m_messages, "mail", tr("Mails") ); |
57 | splitti->addWidget(folder1, "folder", tr("Folder") ); | 57 | splitti->addWidget(folder1, "folder", tr("Folder") ); |
58 | splitti->addWidget( lbl, "logo", tr("Label") ); | 58 | splitti->addWidget( lbl, "logo", tr("Label") ); |
59 | m_message = lbl; | 59 | m_message = lbl; |
60 | 60 | ||
61 | m_splitter->addWidget( splitti ); | 61 | m_splitter->addWidget( splitti ); |
62 | 62 | ||
63 | } | 63 | } |
64 | 64 | ||
65 | 65 | ||
66 | ListViews::~ListViews() { | 66 | ListViews::~ListViews() { |
67 | 67 | ||
68 | } | 68 | } |
69 | 69 | ||
70 | 70 | ||
71 | bool ListViews::eventFilter( QObject* obj, QEvent* ev ) { | 71 | bool ListViews::eventFilter( QObject* obj, QEvent* ev ) { |
72 | if (!obj->isWidgetType() ) | 72 | if (!obj->isWidgetType() ) |
73 | return false; | 73 | return false; |
74 | if ( ev->type() == QEvent::MouseButtonRelease ) { | 74 | if ( ev->type() == QEvent::MouseButtonRelease ) { |
75 | qWarning(" name %s, class %s", obj->name(), obj->className() ); | 75 | qWarning(" name %s, class %s", obj->name(), obj->className() ); |
76 | } | 76 | } |
77 | 77 | ||
diff --git a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp index f62729c..0d8bc9f 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp +++ b/libopie2/examples/opieui/oversatileviewdemo/opieuidemo.cpp | |||
@@ -65,97 +65,97 @@ OpieUIDemo::OpieUIDemo( QWidget* parent, const char* name, WFlags fl ) | |||
65 | demo->setItemParameter( demo->insertItem( "OComboBox", this, SLOT( demo(int) ) ), ocombobox ); | 65 | demo->setItemParameter( demo->insertItem( "OComboBox", this, SLOT( demo(int) ) ), ocombobox ); |
66 | demo->setItemParameter( demo->insertItem( "OEditListBox", this, SLOT( demo(int) ) ), oeditlistbox ); | 66 | demo->setItemParameter( demo->insertItem( "OEditListBox", this, SLOT( demo(int) ) ), oeditlistbox ); |
67 | demo->setItemParameter( demo->insertItem( "OSelector", this, SLOT( demo(int) ) ), oselector ); | 67 | demo->setItemParameter( demo->insertItem( "OSelector", this, SLOT( demo(int) ) ), oselector ); |
68 | mbar->insertItem( "Demonstrate", demo ); | 68 | mbar->insertItem( "Demonstrate", demo ); |
69 | 69 | ||
70 | build(); | 70 | build(); |
71 | 71 | ||
72 | } | 72 | } |
73 | 73 | ||
74 | OpieUIDemo::~OpieUIDemo() | 74 | OpieUIDemo::~OpieUIDemo() |
75 | { | 75 | { |
76 | } | 76 | } |
77 | 77 | ||
78 | void OpieUIDemo::build() | 78 | void OpieUIDemo::build() |
79 | { | 79 | { |
80 | main = new QTabWidget( this, "tabwidget" ); | 80 | main = new QTabWidget( this, "tabwidget" ); |
81 | setCentralWidget( main ); | 81 | setCentralWidget( main ); |
82 | main->show(); | 82 | main->show(); |
83 | 83 | ||
84 | main->addTab( new OVersatileViewDemo( main ), "VersatileView" ); | 84 | main->addTab( new OVersatileViewDemo( main ), "VersatileView" ); |
85 | } | 85 | } |
86 | 86 | ||
87 | 87 | ||
88 | void OpieUIDemo::demo( int d ) | 88 | void OpieUIDemo::demo( int d ) |
89 | { | 89 | { |
90 | switch (d) | 90 | switch (d) |
91 | { | 91 | { |
92 | case ocompletionbox: demoOCompletionBox(); break; | 92 | case ocompletionbox: demoOCompletionBox(); break; |
93 | case olineedit: demoOLineEdit(); break; | 93 | case olineedit: demoOLineEdit(); break; |
94 | case ocombobox: demoOComboBox(); break; | 94 | case ocombobox: demoOComboBox(); break; |
95 | case oeditlistbox: demoOEditListBox(); break; | 95 | case oeditlistbox: demoOEditListBox(); break; |
96 | case oselector: demoOSelector(); break; | 96 | case oselector: demoOSelector(); break; |
97 | 97 | ||
98 | } | 98 | } |
99 | 99 | ||
100 | } | 100 | } |
101 | 101 | ||
102 | void OpieUIDemo::demoOCompletionBox() | 102 | void OpieUIDemo::demoOCompletionBox() |
103 | { | 103 | { |
104 | qDebug( "ocompletionbox" ); | 104 | qDebug( "ocompletionbox" ); |
105 | 105 | ||
106 | OCompletionBox* box = new OCompletionBox( 0 ); | 106 | OCompletionBox* box = new OCompletionBox( 0 ); |
107 | box->insertItem( "This CompletionBox" ); | 107 | box->insertItem( "This CompletionBox" ); |
108 | box->insertItem( "Says 'Hello World'" ); | 108 | box->insertItem( "Says 'Hello World'" ); |
109 | box->insertItem( "Here are some" ); | 109 | box->insertItem( "Here are some" ); |
110 | box->insertItem( "Additional Items" ); | 110 | box->insertItem( "Additional Items" ); |
111 | box->insertItem( "Complete Completion Box" ); | 111 | box->insertItem( "Complete Completion Box" ); |
112 | 112 | ||
113 | connect( box, SIGNAL( activated( const QString& ) ), this, SLOT( messageBox( const QString& ) ) ); | 113 | connect( box, SIGNAL( activated(const QString&) ), this, SLOT( messageBox(const QString&) ) ); |
114 | box->popup(); | 114 | box->popup(); |
115 | 115 | ||
116 | } | 116 | } |
117 | 117 | ||
118 | void OpieUIDemo::demoOLineEdit() | 118 | void OpieUIDemo::demoOLineEdit() |
119 | { | 119 | { |
120 | qDebug( "olineedit" ); | 120 | qDebug( "olineedit" ); |
121 | 121 | ||
122 | OLineEdit *edit = new OLineEdit( 0, "lineedit" ); | 122 | OLineEdit *edit = new OLineEdit( 0, "lineedit" ); |
123 | 123 | ||
124 | edit->setCompletionMode( OGlobalSettings::CompletionPopup ); | 124 | edit->setCompletionMode( OGlobalSettings::CompletionPopup ); |
125 | OCompletion* comp = edit->completionObject(); | 125 | OCompletion* comp = edit->completionObject(); |
126 | 126 | ||
127 | QStringList list; | 127 | QStringList list; |
128 | list << "mickeyl@handhelds.org"; | 128 | list << "mickeyl@handhelds.org"; |
129 | list << "mickey@tm.informatik.uni-frankfurt.de"; | 129 | list << "mickey@tm.informatik.uni-frankfurt.de"; |
130 | list << "mickey@vanille.de"; | 130 | list << "mickey@vanille.de"; |
131 | 131 | ||
132 | comp->setItems( list ); | 132 | comp->setItems( list ); |
133 | 133 | ||
134 | edit->show(); | 134 | edit->show(); |
135 | 135 | ||
136 | } | 136 | } |
137 | 137 | ||
138 | void OpieUIDemo::demoOComboBox() | 138 | void OpieUIDemo::demoOComboBox() |
139 | { | 139 | { |
140 | qDebug( "ocombobox" ); | 140 | qDebug( "ocombobox" ); |
141 | 141 | ||
142 | OComboBox *combo = new OComboBox( true, 0, "combobox" ); | 142 | OComboBox *combo = new OComboBox( true, 0, "combobox" ); |
143 | 143 | ||
144 | combo->setCompletionMode( OGlobalSettings::CompletionPopup ); | 144 | combo->setCompletionMode( OGlobalSettings::CompletionPopup ); |
145 | OCompletion* comp = combo->completionObject(); | 145 | OCompletion* comp = combo->completionObject(); |
146 | 146 | ||
147 | QStringList ilist; | 147 | QStringList ilist; |
148 | ilist << "kergoth@handhelds.org"; | 148 | ilist << "kergoth@handhelds.org"; |
149 | ilist << "harlekin@handhelds.org"; | 149 | ilist << "harlekin@handhelds.org"; |
150 | ilist << "groucho@handhelds.org"; | 150 | ilist << "groucho@handhelds.org"; |
151 | combo->insertStringList( ilist ); | 151 | combo->insertStringList( ilist ); |
152 | 152 | ||
153 | QStringList clist; | 153 | QStringList clist; |
154 | clist << "mickeyl@handhelds.org"; | 154 | clist << "mickeyl@handhelds.org"; |
155 | clist << "mickey@tm.informatik.uni-frankfurt.de"; | 155 | clist << "mickey@tm.informatik.uni-frankfurt.de"; |
156 | clist << "mickey@vanille.de"; | 156 | clist << "mickey@vanille.de"; |
157 | comp->setItems( clist ); | 157 | comp->setItems( clist ); |
158 | 158 | ||
159 | combo->show(); | 159 | combo->show(); |
160 | 160 | ||
161 | } | 161 | } |
diff --git a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp index cf1e443..9db4e62 100644 --- a/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp +++ b/libopie2/examples/opieui/oversatileviewdemo/oversatileviewdemo.cpp | |||
@@ -29,113 +29,113 @@ | |||
29 | Boston, MA 02111-1307, USA. | 29 | Boston, MA 02111-1307, USA. |
30 | 30 | ||
31 | */ | 31 | */ |
32 | 32 | ||
33 | #include "oversatileviewdemo.h" | 33 | #include "oversatileviewdemo.h" |
34 | #include <opie2/oversatileview.h> | 34 | #include <opie2/oversatileview.h> |
35 | #include <opie2/oversatileviewitem.h> | 35 | #include <opie2/oversatileviewitem.h> |
36 | 36 | ||
37 | #include <qstring.h> | 37 | #include <qstring.h> |
38 | #include <qpixmap.h> | 38 | #include <qpixmap.h> |
39 | #include <qlistview.h> | 39 | #include <qlistview.h> |
40 | 40 | ||
41 | OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) | 41 | OVersatileViewDemo::OVersatileViewDemo( QWidget* parent, const char* name, WFlags f ) |
42 | :QVBox( parent, name, f ) | 42 | :QVBox( parent, name, f ) |
43 | { | 43 | { |
44 | vv = new OVersatileView( this ); | 44 | vv = new OVersatileView( this ); |
45 | 45 | ||
46 | vv->addColumn( "First" ); | 46 | vv->addColumn( "First" ); |
47 | vv->addColumn( "2nd" ); | 47 | vv->addColumn( "2nd" ); |
48 | vv->addColumn( "IIIrd" ); | 48 | vv->addColumn( "IIIrd" ); |
49 | 49 | ||
50 | QString counter; | 50 | QString counter; |
51 | 51 | ||
52 | QPixmap leaf( "leaf.png" ); | 52 | QPixmap leaf( "leaf.png" ); |
53 | QPixmap opened( "folder_opened.png" ); | 53 | QPixmap opened( "folder_opened.png" ); |
54 | QPixmap closed( "folder_closed.png" ); | 54 | QPixmap closed( "folder_closed.png" ); |
55 | 55 | ||
56 | QPixmap leaf32( "leaf32.png" ); | 56 | QPixmap leaf32( "leaf32.png" ); |
57 | QPixmap opened32( "folder_opened32.png" ); | 57 | QPixmap opened32( "folder_opened32.png" ); |
58 | QPixmap closed32( "folder_closed32.png" ); | 58 | QPixmap closed32( "folder_closed32.png" ); |
59 | 59 | ||
60 | vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed ); | 60 | vv->setDefaultPixmaps( OVersatileView::Tree, leaf, opened, closed ); |
61 | vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 ); | 61 | vv->setDefaultPixmaps( OVersatileView::Icons, leaf32, opened32, closed32 ); |
62 | 62 | ||
63 | OVersatileViewItem* item; | 63 | OVersatileViewItem* item; |
64 | OVersatileViewItem* item2; | 64 | OVersatileViewItem* item2; |
65 | 65 | ||
66 | for ( int i = 0; i < 5; ++i ) | 66 | for ( int i = 0; i < 5; ++i ) |
67 | { | 67 | { |
68 | counter.sprintf( "%d", i ); | 68 | counter.sprintf( "%d", i ); |
69 | item = new OVersatileViewItem( vv, "Item", "Text", "Some more", counter ); | 69 | item = new OVersatileViewItem( vv, "Item", "Text", "Some more", counter ); |
70 | item->setRenameEnabled( true ); | 70 | item->setRenameEnabled( true ); |
71 | item2 = new OVersatileViewItem( item, "OSubitem", "123", "...", counter ); | 71 | item2 = new OVersatileViewItem( item, "OSubitem", "123", "...", counter ); |
72 | item2->setRenameEnabled( true ); | 72 | item2->setRenameEnabled( true ); |
73 | 73 | ||
74 | } | 74 | } |
75 | 75 | ||
76 | connect( vv, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) ); | 76 | connect( vv, SIGNAL( selectionChanged() ), this, SLOT( selectionChanged() ) ); |
77 | connect( vv, SIGNAL( selectionChanged( OVersatileViewItem * ) ), this, SLOT( selectionChanged( OVersatileViewItem * ) ) ); | 77 | connect( vv, SIGNAL( selectionChanged(OVersatileViewItem*) ), this, SLOT( selectionChanged(OVersatileViewItem*) ) ); |
78 | connect( vv, SIGNAL( currentChanged( OVersatileViewItem * ) ), this, SLOT( currentChanged( OVersatileViewItem * ) ) ); | 78 | connect( vv, SIGNAL( currentChanged(OVersatileViewItem*) ), this, SLOT( currentChanged(OVersatileViewItem*) ) ); |
79 | connect( vv, SIGNAL( clicked( OVersatileViewItem * ) ), this, SLOT( clicked( OVersatileViewItem * ) ) ); | 79 | connect( vv, SIGNAL( clicked(OVersatileViewItem*) ), this, SLOT( clicked(OVersatileViewItem*) ) ); |
80 | connect( vv, SIGNAL( pressed( OVersatileViewItem * ) ), this, SLOT( pressed( OVersatileViewItem * ) ) ); | 80 | connect( vv, SIGNAL( pressed(OVersatileViewItem*) ), this, SLOT( pressed(OVersatileViewItem*) ) ); |
81 | 81 | ||
82 | connect( vv, SIGNAL( doubleClicked( OVersatileViewItem * ) ), this, SLOT( doubleClicked( OVersatileViewItem * ) ) ); | 82 | connect( vv, SIGNAL( doubleClicked(OVersatileViewItem*) ), this, SLOT( doubleClicked(OVersatileViewItem*) ) ); |
83 | connect( vv, SIGNAL( returnPressed( OVersatileViewItem * ) ), this, SLOT( returnPressed( OVersatileViewItem * ) ) ); | 83 | connect( vv, SIGNAL( returnPressed(OVersatileViewItem*) ), this, SLOT( returnPressed(OVersatileViewItem*) ) ); |
84 | 84 | ||
85 | connect( vv, SIGNAL( onItem( OVersatileViewItem * ) ), this, SLOT( onItem( OVersatileViewItem * ) ) ); | 85 | connect( vv, SIGNAL( onItem(OVersatileViewItem*) ), this, SLOT( onItem(OVersatileViewItem*) ) ); |
86 | connect( vv, SIGNAL( onViewport() ), this, SLOT( onViewport() ) ); | 86 | connect( vv, SIGNAL( onViewport() ), this, SLOT( onViewport() ) ); |
87 | 87 | ||
88 | connect( vv, SIGNAL( expanded( OVersatileViewItem * ) ), this, SLOT( expanded( OVersatileViewItem * ) ) ); | 88 | connect( vv, SIGNAL( expanded(OVersatileViewItem*) ), this, SLOT( expanded(OVersatileViewItem*) ) ); |
89 | connect( vv, SIGNAL( collapsed( OVersatileViewItem * ) ), this, SLOT( collapsed( OVersatileViewItem * ) ) ); | 89 | connect( vv, SIGNAL( collapsed(OVersatileViewItem*) ), this, SLOT( collapsed(OVersatileViewItem*) ) ); |
90 | 90 | ||
91 | connect( vv, SIGNAL( moved() ), this, SLOT( moved() ) ); | 91 | connect( vv, SIGNAL( moved() ), this, SLOT( moved() ) ); |
92 | 92 | ||
93 | connect( vv, SIGNAL( contextMenuRequested( OVersatileViewItem *, const QPoint&, int ) ), this, SLOT( contextMenuRequested( OVersatileViewItem *, const QPoint&, int ) ) ); | 93 | connect( vv, SIGNAL( contextMenuRequested(OVersatileViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(OVersatileViewItem*,const QPoint&,int) ) ); |
94 | 94 | ||
95 | } | 95 | } |
96 | 96 | ||
97 | OVersatileViewDemo::~OVersatileViewDemo() | 97 | OVersatileViewDemo::~OVersatileViewDemo() |
98 | { | 98 | { |
99 | } | 99 | } |
100 | 100 | ||
101 | void OVersatileViewDemo::selectionChanged() | 101 | void OVersatileViewDemo::selectionChanged() |
102 | { | 102 | { |
103 | qDebug( "received signal selectionChanged()" ); | 103 | qDebug( "received signal selectionChanged()" ); |
104 | } | 104 | } |
105 | void OVersatileViewDemo::selectionChanged( OVersatileViewItem * item ) | 105 | void OVersatileViewDemo::selectionChanged( OVersatileViewItem * item ) |
106 | { | 106 | { |
107 | qDebug( "received signal selectionChanged(OVersatileViewItem*)" ); | 107 | qDebug( "received signal selectionChanged(OVersatileViewItem*)" ); |
108 | } | 108 | } |
109 | void OVersatileViewDemo::currentChanged( OVersatileViewItem * item ) | 109 | void OVersatileViewDemo::currentChanged( OVersatileViewItem * item ) |
110 | { | 110 | { |
111 | qDebug( "received signal currentChanged( OVersatileViewItem * )" ); | 111 | qDebug( "received signal currentChanged( OVersatileViewItem * )" ); |
112 | } | 112 | } |
113 | void OVersatileViewDemo::clicked( OVersatileViewItem * item ) | 113 | void OVersatileViewDemo::clicked( OVersatileViewItem * item ) |
114 | { | 114 | { |
115 | qDebug( "received signal clicked( OVersatileViewItem * )" ); | 115 | qDebug( "received signal clicked( OVersatileViewItem * )" ); |
116 | } | 116 | } |
117 | void OVersatileViewDemo::pressed( OVersatileViewItem * item ) | 117 | void OVersatileViewDemo::pressed( OVersatileViewItem * item ) |
118 | { | 118 | { |
119 | qDebug( "received signal pressed( OVersatileViewItem * )" ); | 119 | qDebug( "received signal pressed( OVersatileViewItem * )" ); |
120 | } | 120 | } |
121 | 121 | ||
122 | void OVersatileViewDemo::doubleClicked( OVersatileViewItem *item ) | 122 | void OVersatileViewDemo::doubleClicked( OVersatileViewItem *item ) |
123 | { | 123 | { |
124 | qDebug( "received signal doubleClicked( OVersatileViewItem *item )" ); | 124 | qDebug( "received signal doubleClicked( OVersatileViewItem *item )" ); |
125 | } | 125 | } |
126 | void OVersatileViewDemo::returnPressed( OVersatileViewItem *item ) | 126 | void OVersatileViewDemo::returnPressed( OVersatileViewItem *item ) |
127 | { | 127 | { |
128 | qDebug( "received signal returnPressed( OVersatileViewItem *item )" ); | 128 | qDebug( "received signal returnPressed( OVersatileViewItem *item )" ); |
129 | } | 129 | } |
130 | 130 | ||
131 | void OVersatileViewDemo::onItem( OVersatileViewItem *item ) | 131 | void OVersatileViewDemo::onItem( OVersatileViewItem *item ) |
132 | { | 132 | { |
133 | qDebug( "received signal onItem( OVersatileViewItem *item )" ); | 133 | qDebug( "received signal onItem( OVersatileViewItem *item )" ); |
134 | } | 134 | } |
135 | void OVersatileViewDemo::onViewport() | 135 | void OVersatileViewDemo::onViewport() |
136 | { | 136 | { |
137 | qDebug( "received signal onViewport()" ); | 137 | qDebug( "received signal onViewport()" ); |
138 | } | 138 | } |
139 | 139 | ||
140 | void OVersatileViewDemo::expanded( OVersatileViewItem *item ) | 140 | void OVersatileViewDemo::expanded( OVersatileViewItem *item ) |
141 | { | 141 | { |
diff --git a/libopie2/opiecore/device/odevice.cpp b/libopie2/opiecore/device/odevice.cpp index b8d48fe..27b0e53 100644 --- a/libopie2/opiecore/device/odevice.cpp +++ b/libopie2/opiecore/device/odevice.cpp | |||
@@ -100,97 +100,97 @@ ODevice *ODevice::inst() | |||
100 | } | 100 | } |
101 | return dev; | 101 | return dev; |
102 | } | 102 | } |
103 | 103 | ||
104 | ODevice::ODevice() | 104 | ODevice::ODevice() |
105 | { | 105 | { |
106 | d = new ODeviceData; | 106 | d = new ODeviceData; |
107 | 107 | ||
108 | d->m_modelstr = "Unknown"; | 108 | d->m_modelstr = "Unknown"; |
109 | d->m_model = Model_Unknown; | 109 | d->m_model = Model_Unknown; |
110 | d->m_vendorstr = "Unknown"; | 110 | d->m_vendorstr = "Unknown"; |
111 | d->m_vendor = Vendor_Unknown; | 111 | d->m_vendor = Vendor_Unknown; |
112 | d->m_systemstr = "Unknown"; | 112 | d->m_systemstr = "Unknown"; |
113 | d->m_system = System_Unknown; | 113 | d->m_system = System_Unknown; |
114 | d->m_sysverstr = "0.0"; | 114 | d->m_sysverstr = "0.0"; |
115 | d->m_rotation = Rot0; | 115 | d->m_rotation = Rot0; |
116 | d->m_direction = CW; | 116 | d->m_direction = CW; |
117 | 117 | ||
118 | d->m_holdtime = 1000; // 1000ms | 118 | d->m_holdtime = 1000; // 1000ms |
119 | d->m_buttons = 0; | 119 | d->m_buttons = 0; |
120 | d->m_cpu_frequencies = new QStrList; | 120 | d->m_cpu_frequencies = new QStrList; |
121 | } | 121 | } |
122 | 122 | ||
123 | void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) | 123 | void ODevice::systemMessage ( const QCString &msg, const QByteArray & ) |
124 | { | 124 | { |
125 | if ( msg == "deviceButtonMappingChanged()" ) { | 125 | if ( msg == "deviceButtonMappingChanged()" ) { |
126 | reloadButtonMapping(); | 126 | reloadButtonMapping(); |
127 | } | 127 | } |
128 | } | 128 | } |
129 | 129 | ||
130 | void ODevice::init() | 130 | void ODevice::init() |
131 | { | 131 | { |
132 | } | 132 | } |
133 | 133 | ||
134 | /** | 134 | /** |
135 | * This method initialises the button mapping | 135 | * This method initialises the button mapping |
136 | */ | 136 | */ |
137 | void ODevice::initButtons() | 137 | void ODevice::initButtons() |
138 | { | 138 | { |
139 | if ( d->m_buttons ) | 139 | if ( d->m_buttons ) |
140 | return; | 140 | return; |
141 | 141 | ||
142 | qDebug ( "init Buttons" ); | 142 | qDebug ( "init Buttons" ); |
143 | d->m_buttons = new QValueList <ODeviceButton>; | 143 | d->m_buttons = new QValueList <ODeviceButton>; |
144 | 144 | ||
145 | reloadButtonMapping(); | 145 | reloadButtonMapping(); |
146 | 146 | ||
147 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 147 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
148 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); | 148 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
149 | } | 149 | } |
150 | 150 | ||
151 | ODevice::~ODevice() | 151 | ODevice::~ODevice() |
152 | { | 152 | { |
153 | // we leak m_devicebuttons and m_cpu_frequency | 153 | // we leak m_devicebuttons and m_cpu_frequency |
154 | // but it's a singleton and it is not so importantant | 154 | // but it's a singleton and it is not so importantant |
155 | // -zecke | 155 | // -zecke |
156 | delete d; | 156 | delete d; |
157 | } | 157 | } |
158 | 158 | ||
159 | bool ODevice::setSoftSuspend ( bool /*soft*/ ) | 159 | bool ODevice::setSoftSuspend ( bool /*soft*/ ) |
160 | { | 160 | { |
161 | return false; | 161 | return false; |
162 | } | 162 | } |
163 | 163 | ||
164 | //#include <linux/apm_bios.h> | 164 | //#include <linux/apm_bios.h> |
165 | 165 | ||
166 | #define APM_IOC_SUSPEND OD_IO( 'A', 2 ) | 166 | #define APM_IOC_SUSPEND OD_IO( 'A', 2 ) |
167 | 167 | ||
168 | /** | 168 | /** |
169 | * This method will try to suspend the device | 169 | * This method will try to suspend the device |
170 | * It only works if the user is the QWS Server and the apm application | 170 | * It only works if the user is the QWS Server and the apm application |
171 | * is installed. | 171 | * is installed. |
172 | * It tries to suspend and then waits some time cause some distributions | 172 | * It tries to suspend and then waits some time cause some distributions |
173 | * do have asynchronus apm implementations. | 173 | * do have asynchronus apm implementations. |
174 | * This method will either fail and return false or it'll suspend the | 174 | * This method will either fail and return false or it'll suspend the |
175 | * device and return once the device got woken up | 175 | * device and return once the device got woken up |
176 | * | 176 | * |
177 | * @return if the device got suspended | 177 | * @return if the device got suspended |
178 | */ | 178 | */ |
179 | bool ODevice::suspend() | 179 | bool ODevice::suspend() |
180 | { | 180 | { |
181 | qDebug("ODevice::suspend"); | 181 | qDebug("ODevice::suspend"); |
182 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend | 182 | if ( !isQWS( ) ) // only qwsserver is allowed to suspend |
183 | return false; | 183 | return false; |
184 | 184 | ||
185 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices | 185 | if ( d->m_model == Model_Unknown ) // better don't suspend in qvfb / on unkown devices |
186 | return false; | 186 | return false; |
187 | 187 | ||
188 | bool res = false; | 188 | bool res = false; |
189 | ODevice::sendSuspendmsg(); | 189 | ODevice::sendSuspendmsg(); |
190 | 190 | ||
191 | struct timeval tvs, tvn; | 191 | struct timeval tvs, tvn; |
192 | ::gettimeofday ( &tvs, 0 ); | 192 | ::gettimeofday ( &tvs, 0 ); |
193 | 193 | ||
194 | ::sync(); // flush fs caches | 194 | ::sync(); // flush fs caches |
195 | res = ( ::system ( "apm --suspend" ) == 0 ); | 195 | res = ( ::system ( "apm --suspend" ) == 0 ); |
196 | 196 | ||
diff --git a/libopie2/opiecore/device/odevice_ipaq.cpp b/libopie2/opiecore/device/odevice_ipaq.cpp index cc4b01a..8ecea1b 100644 --- a/libopie2/opiecore/device/odevice_ipaq.cpp +++ b/libopie2/opiecore/device/odevice_ipaq.cpp | |||
@@ -167,97 +167,97 @@ void iPAQ::init() | |||
167 | f. close(); | 167 | f. close(); |
168 | } else { | 168 | } else { |
169 | f. setName ( "/etc/oz_version" ); | 169 | f. setName ( "/etc/oz_version" ); |
170 | 170 | ||
171 | if ( f. open ( IO_ReadOnly )) { | 171 | if ( f. open ( IO_ReadOnly )) { |
172 | d->m_systemstr = "OpenEmbedded/iPaq"; | 172 | d->m_systemstr = "OpenEmbedded/iPaq"; |
173 | d->m_system = System_Familiar; | 173 | d->m_system = System_Familiar; |
174 | 174 | ||
175 | QTextStream ts ( &f ); | 175 | QTextStream ts ( &f ); |
176 | ts.setDevice ( &f ); | 176 | ts.setDevice ( &f ); |
177 | d->m_sysverstr = ts. readLine(); | 177 | d->m_sysverstr = ts. readLine(); |
178 | f. close(); | 178 | f. close(); |
179 | } | 179 | } |
180 | } | 180 | } |
181 | 181 | ||
182 | m_leds [0] = m_leds [1] = Led_Off; | 182 | m_leds [0] = m_leds [1] = Led_Off; |
183 | 183 | ||
184 | m_power_timer = 0; | 184 | m_power_timer = 0; |
185 | 185 | ||
186 | } | 186 | } |
187 | 187 | ||
188 | void iPAQ::initButtons() | 188 | void iPAQ::initButtons() |
189 | { | 189 | { |
190 | if ( d->m_buttons ) | 190 | if ( d->m_buttons ) |
191 | return; | 191 | return; |
192 | 192 | ||
193 | if ( isQWS( ) ) | 193 | if ( isQWS( ) ) |
194 | QWSServer::setKeyboardFilter ( this ); | 194 | QWSServer::setKeyboardFilter ( this ); |
195 | 195 | ||
196 | d->m_buttons = new QValueList <ODeviceButton>; | 196 | d->m_buttons = new QValueList <ODeviceButton>; |
197 | 197 | ||
198 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { | 198 | for ( uint i = 0; i < ( sizeof( ipaq_buttons ) / sizeof( i_button )); i++ ) { |
199 | i_button *ib = ipaq_buttons + i; | 199 | i_button *ib = ipaq_buttons + i; |
200 | ODeviceButton b; | 200 | ODeviceButton b; |
201 | 201 | ||
202 | if (( ib->model & d->m_model ) == d->m_model ) { | 202 | if (( ib->model & d->m_model ) == d->m_model ) { |
203 | b. setKeycode ( ib->code ); | 203 | b. setKeycode ( ib->code ); |
204 | b. setUserText ( QObject::tr ( "Button", ib->utext )); | 204 | b. setUserText ( QObject::tr ( "Button", ib->utext )); |
205 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); | 205 | b. setPixmap ( Resource::loadPixmap ( ib->pix )); |
206 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); | 206 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( ib->fpressedservice ), ib->fpressedaction )); |
207 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); | 207 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( ib->fheldservice ), ib->fheldaction )); |
208 | 208 | ||
209 | d->m_buttons->append ( b ); | 209 | d->m_buttons->append ( b ); |
210 | } | 210 | } |
211 | } | 211 | } |
212 | reloadButtonMapping(); | 212 | reloadButtonMapping(); |
213 | 213 | ||
214 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 214 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
215 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); | 215 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
216 | } | 216 | } |
217 | 217 | ||
218 | QValueList <OLed> iPAQ::ledList() const | 218 | QValueList <OLed> iPAQ::ledList() const |
219 | { | 219 | { |
220 | QValueList <OLed> vl; | 220 | QValueList <OLed> vl; |
221 | vl << Led_Power; | 221 | vl << Led_Power; |
222 | 222 | ||
223 | if ( d->m_model == Model_iPAQ_H38xx ) | 223 | if ( d->m_model == Model_iPAQ_H38xx ) |
224 | vl << Led_BlueTooth; | 224 | vl << Led_BlueTooth; |
225 | return vl; | 225 | return vl; |
226 | } | 226 | } |
227 | 227 | ||
228 | QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const | 228 | QValueList <OLedState> iPAQ::ledStateList ( OLed l ) const |
229 | { | 229 | { |
230 | QValueList <OLedState> vl; | 230 | QValueList <OLedState> vl; |
231 | 231 | ||
232 | if ( l == Led_Power ) | 232 | if ( l == Led_Power ) |
233 | vl << Led_Off << Led_On << Led_BlinkSlow << Led_BlinkFast; | 233 | vl << Led_Off << Led_On << Led_BlinkSlow << Led_BlinkFast; |
234 | else if ( l == Led_BlueTooth && d->m_model == Model_iPAQ_H38xx ) | 234 | else if ( l == Led_BlueTooth && d->m_model == Model_iPAQ_H38xx ) |
235 | vl << Led_Off; // << Led_On << ??? | 235 | vl << Led_Off; // << Led_On << ??? |
236 | 236 | ||
237 | return vl; | 237 | return vl; |
238 | } | 238 | } |
239 | 239 | ||
240 | OLedState iPAQ::ledState ( OLed l ) const | 240 | OLedState iPAQ::ledState ( OLed l ) const |
241 | { | 241 | { |
242 | switch ( l ) { | 242 | switch ( l ) { |
243 | case Led_Power: | 243 | case Led_Power: |
244 | return m_leds [0]; | 244 | return m_leds [0]; |
245 | case Led_BlueTooth: | 245 | case Led_BlueTooth: |
246 | return m_leds [1]; | 246 | return m_leds [1]; |
247 | default: | 247 | default: |
248 | return Led_Off; | 248 | return Led_Off; |
249 | } | 249 | } |
250 | } | 250 | } |
251 | 251 | ||
252 | bool iPAQ::setLedState ( OLed l, OLedState st ) | 252 | bool iPAQ::setLedState ( OLed l, OLedState st ) |
253 | { | 253 | { |
254 | static int fd = ::open ( "/dev/touchscreen/0", O_RDWR | O_NONBLOCK ); | 254 | static int fd = ::open ( "/dev/touchscreen/0", O_RDWR | O_NONBLOCK ); |
255 | 255 | ||
256 | if ( l == Led_Power ) { | 256 | if ( l == Led_Power ) { |
257 | if ( fd >= 0 ) { | 257 | if ( fd >= 0 ) { |
258 | LED_IN leds; | 258 | LED_IN leds; |
259 | ::memset ( &leds, 0, sizeof( leds )); | 259 | ::memset ( &leds, 0, sizeof( leds )); |
260 | leds. TotalTime = 0; | 260 | leds. TotalTime = 0; |
261 | leds. OnTime = 0; | 261 | leds. OnTime = 0; |
262 | leds. OffTime = 1; | 262 | leds. OffTime = 1; |
263 | leds. OffOnBlink = 2; | 263 | leds. OffOnBlink = 2; |
diff --git a/libopie2/opiecore/device/odevice_simpad.cpp b/libopie2/opiecore/device/odevice_simpad.cpp index 31b9297..90aca2f 100644 --- a/libopie2/opiecore/device/odevice_simpad.cpp +++ b/libopie2/opiecore/device/odevice_simpad.cpp | |||
@@ -144,97 +144,97 @@ void SIMpad::init() | |||
144 | f. close(); | 144 | f. close(); |
145 | } else { | 145 | } else { |
146 | f. setName ( "/etc/oz_version" ); | 146 | f. setName ( "/etc/oz_version" ); |
147 | 147 | ||
148 | if ( f. open ( IO_ReadOnly )) { | 148 | if ( f. open ( IO_ReadOnly )) { |
149 | d->m_systemstr = "OpenEmbedded/SIMpad"; | 149 | d->m_systemstr = "OpenEmbedded/SIMpad"; |
150 | d->m_system = System_OpenZaurus; | 150 | d->m_system = System_OpenZaurus; |
151 | 151 | ||
152 | QTextStream ts ( &f ); | 152 | QTextStream ts ( &f ); |
153 | ts.setDevice ( &f ); | 153 | ts.setDevice ( &f ); |
154 | d->m_sysverstr = ts. readLine(); | 154 | d->m_sysverstr = ts. readLine(); |
155 | f. close(); | 155 | f. close(); |
156 | } | 156 | } |
157 | } | 157 | } |
158 | 158 | ||
159 | m_leds [0] = m_leds [1] = Led_Off; | 159 | m_leds [0] = m_leds [1] = Led_Off; |
160 | 160 | ||
161 | m_power_timer = 0; | 161 | m_power_timer = 0; |
162 | 162 | ||
163 | } | 163 | } |
164 | 164 | ||
165 | void SIMpad::initButtons() | 165 | void SIMpad::initButtons() |
166 | { | 166 | { |
167 | if ( d->m_buttons ) | 167 | if ( d->m_buttons ) |
168 | return; | 168 | return; |
169 | 169 | ||
170 | if ( isQWS( ) ) | 170 | if ( isQWS( ) ) |
171 | QWSServer::setKeyboardFilter ( this ); | 171 | QWSServer::setKeyboardFilter ( this ); |
172 | 172 | ||
173 | d->m_buttons = new QValueList <ODeviceButton>; | 173 | d->m_buttons = new QValueList <ODeviceButton>; |
174 | 174 | ||
175 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { | 175 | for ( uint i = 0; i < ( sizeof( simpad_buttons ) / sizeof( s_button )); i++ ) { |
176 | s_button *sb = simpad_buttons + i; | 176 | s_button *sb = simpad_buttons + i; |
177 | ODeviceButton b; | 177 | ODeviceButton b; |
178 | 178 | ||
179 | if (( sb->model & d->m_model ) == d->m_model ) { | 179 | if (( sb->model & d->m_model ) == d->m_model ) { |
180 | b. setKeycode ( sb->code ); | 180 | b. setKeycode ( sb->code ); |
181 | b. setUserText ( QObject::tr ( "Button", sb->utext )); | 181 | b. setUserText ( QObject::tr ( "Button", sb->utext )); |
182 | b. setPixmap ( Resource::loadPixmap ( sb->pix )); | 182 | b. setPixmap ( Resource::loadPixmap ( sb->pix )); |
183 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb->fpressedservice ), sb->fpressedaction )); | 183 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( sb->fpressedservice ), sb->fpressedaction )); |
184 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb->fheldservice ), sb->fheldaction )); | 184 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( sb->fheldservice ), sb->fheldaction )); |
185 | 185 | ||
186 | d->m_buttons->append ( b ); | 186 | d->m_buttons->append ( b ); |
187 | } | 187 | } |
188 | } | 188 | } |
189 | reloadButtonMapping(); | 189 | reloadButtonMapping(); |
190 | 190 | ||
191 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 191 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
192 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); | 192 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
193 | } | 193 | } |
194 | 194 | ||
195 | // SIMpad boardcontrol register CS3 | 195 | // SIMpad boardcontrol register CS3 |
196 | #define SIMPAD_BOARDCONTROL "/proc/cs3" | 196 | #define SIMPAD_BOARDCONTROL "/proc/cs3" |
197 | #define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA | 197 | #define SIMPAD_VCC_5V_EN 0x0001 // For 5V PCMCIA |
198 | #define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA | 198 | #define SIMPAD_VCC_3V_EN 0x0002 // FOR 3.3V PCMCIA |
199 | #define SIMPAD_EN1 0x0004 // This is only for EPROM's | 199 | #define SIMPAD_EN1 0x0004 // This is only for EPROM's |
200 | #define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V | 200 | #define SIMPAD_EN0 0x0008 // Both should be enable for 3.3V or 5V |
201 | #define SIMPAD_DISPLAY_ON 0x0010 | 201 | #define SIMPAD_DISPLAY_ON 0x0010 |
202 | #define SIMPAD_PCMCIA_BUFF_DIS 0x0020 | 202 | #define SIMPAD_PCMCIA_BUFF_DIS 0x0020 |
203 | #define SIMPAD_MQ_RESET 0x0040 | 203 | #define SIMPAD_MQ_RESET 0x0040 |
204 | #define SIMPAD_PCMCIA_RESET 0x0080 | 204 | #define SIMPAD_PCMCIA_RESET 0x0080 |
205 | #define SIMPAD_DECT_POWER_ON 0x0100 | 205 | #define SIMPAD_DECT_POWER_ON 0x0100 |
206 | #define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave | 206 | #define SIMPAD_IRDA_SD 0x0200 // Shutdown for powersave |
207 | #define SIMPAD_RS232_ON 0x0400 | 207 | #define SIMPAD_RS232_ON 0x0400 |
208 | #define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave | 208 | #define SIMPAD_SD_MEDIAQ 0x0800 // Shutdown for powersave |
209 | #define SIMPAD_LED2_ON 0x1000 | 209 | #define SIMPAD_LED2_ON 0x1000 |
210 | #define SIMPAD_IRDA_MODE 0x2000 // Fast/Slow IrDA mode | 210 | #define SIMPAD_IRDA_MODE 0x2000 // Fast/Slow IrDA mode |
211 | #define SIMPAD_ENABLE_5V 0x4000 // Enable 5V circuit | 211 | #define SIMPAD_ENABLE_5V 0x4000 // Enable 5V circuit |
212 | #define SIMPAD_RESET_SIMCARD 0x8000 | 212 | #define SIMPAD_RESET_SIMCARD 0x8000 |
213 | 213 | ||
214 | //SIMpad touchscreen backlight strength control | 214 | //SIMpad touchscreen backlight strength control |
215 | #define SIMPAD_BACKLIGHT_CONTROL "/proc/driver/mq200/registers/PWM_CONTROL" | 215 | #define SIMPAD_BACKLIGHT_CONTROL "/proc/driver/mq200/registers/PWM_CONTROL" |
216 | #define SIMPAD_BACKLIGHT_MASK 0x00a10044 | 216 | #define SIMPAD_BACKLIGHT_MASK 0x00a10044 |
217 | 217 | ||
218 | QValueList <OLed> SIMpad::ledList() const | 218 | QValueList <OLed> SIMpad::ledList() const |
219 | { | 219 | { |
220 | QValueList <OLed> vl; | 220 | QValueList <OLed> vl; |
221 | vl << Led_Power; //FIXME which LED is LED2 ? The green one or the amber one? | 221 | vl << Led_Power; //FIXME which LED is LED2 ? The green one or the amber one? |
222 | //vl << Led_Mail; //TODO find out if LED1 is accessible anyway | 222 | //vl << Led_Mail; //TODO find out if LED1 is accessible anyway |
223 | return vl; | 223 | return vl; |
224 | } | 224 | } |
225 | 225 | ||
226 | QValueList <OLedState> SIMpad::ledStateList ( OLed l ) const | 226 | QValueList <OLedState> SIMpad::ledStateList ( OLed l ) const |
227 | { | 227 | { |
228 | QValueList <OLedState> vl; | 228 | QValueList <OLedState> vl; |
229 | 229 | ||
230 | if ( l == Led_Power ) //FIXME which LED is LED2 ? The green one or the amber one? | 230 | if ( l == Led_Power ) //FIXME which LED is LED2 ? The green one or the amber one? |
231 | vl << Led_Off << Led_On; | 231 | vl << Led_Off << Led_On; |
232 | //else if ( l == Led_Mail ) //TODO find out if LED1 is accessible anyway | 232 | //else if ( l == Led_Mail ) //TODO find out if LED1 is accessible anyway |
233 | //vl << Led_Off; | 233 | //vl << Led_Off; |
234 | return vl; | 234 | return vl; |
235 | } | 235 | } |
236 | 236 | ||
237 | OLedState SIMpad::ledState ( OLed l ) const | 237 | OLedState SIMpad::ledState ( OLed l ) const |
238 | { | 238 | { |
239 | switch ( l ) { | 239 | switch ( l ) { |
240 | case Led_Power: | 240 | case Led_Power: |
diff --git a/libopie2/opiecore/device/odevice_yopy.cpp b/libopie2/opiecore/device/odevice_yopy.cpp index a76f90b..d241db8 100644 --- a/libopie2/opiecore/device/odevice_yopy.cpp +++ b/libopie2/opiecore/device/odevice_yopy.cpp | |||
@@ -74,90 +74,90 @@ void Yopy::init() | |||
74 | { | 74 | { |
75 | d->m_vendorstr = "G.Mate"; | 75 | d->m_vendorstr = "G.Mate"; |
76 | d->m_vendor = Vendor_GMate; | 76 | d->m_vendor = Vendor_GMate; |
77 | d->m_modelstr = "Yopy3700"; | 77 | d->m_modelstr = "Yopy3700"; |
78 | d->m_model = Model_Yopy_3700; | 78 | d->m_model = Model_Yopy_3700; |
79 | d->m_rotation = Rot0; | 79 | d->m_rotation = Rot0; |
80 | 80 | ||
81 | d->m_systemstr = "Linupy"; | 81 | d->m_systemstr = "Linupy"; |
82 | d->m_system = System_Linupy; | 82 | d->m_system = System_Linupy; |
83 | 83 | ||
84 | QFile f ( "/etc/issue" ); | 84 | QFile f ( "/etc/issue" ); |
85 | if ( f. open ( IO_ReadOnly ) ) | 85 | if ( f. open ( IO_ReadOnly ) ) |
86 | { | 86 | { |
87 | QTextStream ts ( &f ); | 87 | QTextStream ts ( &f ); |
88 | ts.readLine(); | 88 | ts.readLine(); |
89 | d->m_sysverstr = ts. readLine(); | 89 | d->m_sysverstr = ts. readLine(); |
90 | f. close(); | 90 | f. close(); |
91 | } | 91 | } |
92 | } | 92 | } |
93 | 93 | ||
94 | 94 | ||
95 | void Yopy::initButtons() | 95 | void Yopy::initButtons() |
96 | { | 96 | { |
97 | if ( d->m_buttons ) | 97 | if ( d->m_buttons ) |
98 | return ; | 98 | return ; |
99 | 99 | ||
100 | d->m_buttons = new QValueList <ODeviceButton>; | 100 | d->m_buttons = new QValueList <ODeviceButton>; |
101 | 101 | ||
102 | for ( uint i = 0; i < ( sizeof( yopy_buttons ) / sizeof( yopy_button ) ); i++ ) | 102 | for ( uint i = 0; i < ( sizeof( yopy_buttons ) / sizeof( yopy_button ) ); i++ ) |
103 | { | 103 | { |
104 | 104 | ||
105 | yopy_button *ib = yopy_buttons + i; | 105 | yopy_button *ib = yopy_buttons + i; |
106 | 106 | ||
107 | ODeviceButton b; | 107 | ODeviceButton b; |
108 | 108 | ||
109 | b. setKeycode ( ib->code ); | 109 | b. setKeycode ( ib->code ); |
110 | b. setUserText ( QObject::tr ( "Button", ib->utext ) ); | 110 | b. setUserText ( QObject::tr ( "Button", ib->utext ) ); |
111 | b. setPixmap ( Resource::loadPixmap ( ib->pix ) ); | 111 | b. setPixmap ( Resource::loadPixmap ( ib->pix ) ); |
112 | b. setFactoryPresetPressedAction | 112 | b. setFactoryPresetPressedAction |
113 | ( OQCopMessage( makeChannel( ib->fpressedservice ), ib->fpressedaction ) ); | 113 | ( OQCopMessage( makeChannel( ib->fpressedservice ), ib->fpressedaction ) ); |
114 | b. setFactoryPresetHeldAction | 114 | b. setFactoryPresetHeldAction |
115 | ( OQCopMessage( makeChannel( ib->fheldservice ), ib->fheldaction ) ); | 115 | ( OQCopMessage( makeChannel( ib->fheldservice ), ib->fheldaction ) ); |
116 | 116 | ||
117 | d->m_buttons->append ( b ); | 117 | d->m_buttons->append ( b ); |
118 | } | 118 | } |
119 | reloadButtonMapping(); | 119 | reloadButtonMapping(); |
120 | 120 | ||
121 | QCopChannel *sysch = new QCopChannel( "QPE/System", this ); | 121 | QCopChannel *sysch = new QCopChannel( "QPE/System", this ); |
122 | connect( sysch, SIGNAL( received( const QCString &, const QByteArray & ) ), | 122 | connect( sysch, SIGNAL( received(const QCString&,const QByteArray&) ), |
123 | this, SLOT( systemMessage( const QCString &, const QByteArray & ) ) ); | 123 | this, SLOT( systemMessage(const QCString&,const QByteArray&) ) ); |
124 | } | 124 | } |
125 | 125 | ||
126 | 126 | ||
127 | bool Yopy::suspend() | 127 | bool Yopy::suspend() |
128 | { | 128 | { |
129 | /* Opie for Yopy does not implement its own power management at the | 129 | /* Opie for Yopy does not implement its own power management at the |
130 | moment. The public version runs parallel to X, and relies on the | 130 | moment. The public version runs parallel to X, and relies on the |
131 | existing power management features. */ | 131 | existing power management features. */ |
132 | return false; | 132 | return false; |
133 | } | 133 | } |
134 | 134 | ||
135 | 135 | ||
136 | bool Yopy::setDisplayBrightness( int bright ) | 136 | bool Yopy::setDisplayBrightness( int bright ) |
137 | { | 137 | { |
138 | /* The code here works, but is disabled as the current version runs | 138 | /* The code here works, but is disabled as the current version runs |
139 | parallel to X, and relies on the existing backlight demon. */ | 139 | parallel to X, and relies on the existing backlight demon. */ |
140 | #if 0 | 140 | #if 0 |
141 | if ( QFile::exists( "/proc/sys/pm/light" ) ) | 141 | if ( QFile::exists( "/proc/sys/pm/light" ) ) |
142 | { | 142 | { |
143 | int fd = ::open( "/proc/sys/pm/light", O_WRONLY ); | 143 | int fd = ::open( "/proc/sys/pm/light", O_WRONLY ); |
144 | if ( fd >= 0 ) | 144 | if ( fd >= 0 ) |
145 | { | 145 | { |
146 | if ( bright ) | 146 | if ( bright ) |
147 | ::write( fd, "1\n", 2 ); | 147 | ::write( fd, "1\n", 2 ); |
148 | else | 148 | else |
149 | ::write( fd, "0\n", 2 ); | 149 | ::write( fd, "0\n", 2 ); |
150 | ::close( fd ); | 150 | ::close( fd ); |
151 | return true; | 151 | return true; |
152 | } | 152 | } |
153 | } | 153 | } |
154 | #endif | 154 | #endif |
155 | return false; | 155 | return false; |
156 | } | 156 | } |
157 | 157 | ||
158 | 158 | ||
159 | int Yopy::displayBrightnessResolution() const | 159 | int Yopy::displayBrightnessResolution() const |
160 | { | 160 | { |
161 | return 2; | 161 | return 2; |
162 | } | 162 | } |
163 | 163 | ||
diff --git a/libopie2/opiecore/device/odevice_zaurus.cpp b/libopie2/opiecore/device/odevice_zaurus.cpp index 9d23a12..8ab3cbe 100644 --- a/libopie2/opiecore/device/odevice_zaurus.cpp +++ b/libopie2/opiecore/device/odevice_zaurus.cpp | |||
@@ -207,98 +207,98 @@ void Zaurus::init() | |||
207 | case Model_Zaurus_SLB600: | 207 | case Model_Zaurus_SLB600: |
208 | case Model_Zaurus_SL5500: | 208 | case Model_Zaurus_SL5500: |
209 | case Model_Zaurus_SL5000: | 209 | case Model_Zaurus_SL5000: |
210 | default: | 210 | default: |
211 | d->m_rotation = Rot270; | 211 | d->m_rotation = Rot270; |
212 | break; | 212 | break; |
213 | } | 213 | } |
214 | m_leds [0] = Led_Off; | 214 | m_leds [0] = Led_Off; |
215 | } | 215 | } |
216 | 216 | ||
217 | void Zaurus::initButtons() | 217 | void Zaurus::initButtons() |
218 | { | 218 | { |
219 | if ( d->m_buttons ) | 219 | if ( d->m_buttons ) |
220 | return; | 220 | return; |
221 | 221 | ||
222 | d->m_buttons = new QValueList <ODeviceButton>; | 222 | d->m_buttons = new QValueList <ODeviceButton>; |
223 | 223 | ||
224 | struct z_button * pz_buttons; | 224 | struct z_button * pz_buttons; |
225 | int buttoncount; | 225 | int buttoncount; |
226 | switch ( d->m_model ) { | 226 | switch ( d->m_model ) { |
227 | case Model_Zaurus_SLC7x0: | 227 | case Model_Zaurus_SLC7x0: |
228 | pz_buttons = z_buttons_c700; | 228 | pz_buttons = z_buttons_c700; |
229 | buttoncount = ARRAY_SIZE(z_buttons_c700); | 229 | buttoncount = ARRAY_SIZE(z_buttons_c700); |
230 | break; | 230 | break; |
231 | default: | 231 | default: |
232 | pz_buttons = z_buttons; | 232 | pz_buttons = z_buttons; |
233 | buttoncount = ARRAY_SIZE(z_buttons); | 233 | buttoncount = ARRAY_SIZE(z_buttons); |
234 | break; | 234 | break; |
235 | } | 235 | } |
236 | 236 | ||
237 | for ( int i = 0; i < buttoncount; i++ ) { | 237 | for ( int i = 0; i < buttoncount; i++ ) { |
238 | struct z_button *zb = pz_buttons + i; | 238 | struct z_button *zb = pz_buttons + i; |
239 | ODeviceButton b; | 239 | ODeviceButton b; |
240 | 240 | ||
241 | b. setKeycode ( zb->code ); | 241 | b. setKeycode ( zb->code ); |
242 | b. setUserText ( QObject::tr ( "Button", zb->utext )); | 242 | b. setUserText ( QObject::tr ( "Button", zb->utext )); |
243 | b. setPixmap ( Resource::loadPixmap ( zb->pix )); | 243 | b. setPixmap ( Resource::loadPixmap ( zb->pix )); |
244 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb->fpressedservice ), | 244 | b. setFactoryPresetPressedAction ( OQCopMessage ( makeChannel ( zb->fpressedservice ), |
245 | zb->fpressedaction )); | 245 | zb->fpressedaction )); |
246 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb->fheldservice ), | 246 | b. setFactoryPresetHeldAction ( OQCopMessage ( makeChannel ( zb->fheldservice ), |
247 | zb->fheldaction )); | 247 | zb->fheldaction )); |
248 | 248 | ||
249 | d->m_buttons->append ( b ); | 249 | d->m_buttons->append ( b ); |
250 | } | 250 | } |
251 | 251 | ||
252 | reloadButtonMapping(); | 252 | reloadButtonMapping(); |
253 | 253 | ||
254 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); | 254 | QCopChannel *sysch = new QCopChannel ( "QPE/System", this ); |
255 | connect ( sysch, SIGNAL( received( const QCString &, const QByteArray & )), | 255 | connect ( sysch, SIGNAL( received(const QCString&,const QByteArray&)), |
256 | this, SLOT( systemMessage ( const QCString &, const QByteArray & ))); | 256 | this, SLOT( systemMessage(const QCString&,const QByteArray&))); |
257 | } | 257 | } |
258 | 258 | ||
259 | #include <unistd.h> | 259 | #include <unistd.h> |
260 | #include <fcntl.h> | 260 | #include <fcntl.h> |
261 | #include <sys/ioctl.h> | 261 | #include <sys/ioctl.h> |
262 | 262 | ||
263 | //#include <asm/sharp_char.h> // including kernel headers is evil ... | 263 | //#include <asm/sharp_char.h> // including kernel headers is evil ... |
264 | 264 | ||
265 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 | 265 | #define SHARP_DEV_IOCTL_COMMAND_START 0x5680 |
266 | 266 | ||
267 | #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 267 | #defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
268 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) | 268 | #define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) |
269 | 269 | ||
270 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ | 270 | #define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ |
271 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ | 271 | #define SHARP_BUZ_KEYSOUND 2 /* key sound */ |
272 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ | 272 | #define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ |
273 | 273 | ||
274 | /* --- for SHARP_BUZZER device --- */ | 274 | /* --- for SHARP_BUZZER device --- */ |
275 | 275 | ||
276 | //#defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 276 | //#defineSHARP_BUZZER_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
277 | //#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) | 277 | //#define SHARP_BUZZER_MAKESOUND (SHARP_BUZZER_IOCTL_START) |
278 | 278 | ||
279 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) | 279 | #define SHARP_BUZZER_SETVOLUME (SHARP_BUZZER_IOCTL_START+1) |
280 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) | 280 | #define SHARP_BUZZER_GETVOLUME (SHARP_BUZZER_IOCTL_START+2) |
281 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) | 281 | #define SHARP_BUZZER_ISSUPPORTED (SHARP_BUZZER_IOCTL_START+3) |
282 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) | 282 | #define SHARP_BUZZER_SETMUTE (SHARP_BUZZER_IOCTL_START+4) |
283 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) | 283 | #define SHARP_BUZZER_STOPSOUND (SHARP_BUZZER_IOCTL_START+5) |
284 | 284 | ||
285 | //#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ | 285 | //#define SHARP_BUZ_TOUCHSOUND 1 /* touch panel sound */ |
286 | //#define SHARP_BUZ_KEYSOUND 2 /* key sound */ | 286 | //#define SHARP_BUZ_KEYSOUND 2 /* key sound */ |
287 | 287 | ||
288 | //#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */ | 288 | //#define SHARP_PDA_ILLCLICKSOUND 3 /* illegal click */ |
289 | //#define SHARP_PDA_WARNSOUND 4 /* warning occurred */ | 289 | //#define SHARP_PDA_WARNSOUND 4 /* warning occurred */ |
290 | //#define SHARP_PDA_ERRORSOUND 5 /* error occurred */ | 290 | //#define SHARP_PDA_ERRORSOUND 5 /* error occurred */ |
291 | //#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */ | 291 | //#define SHARP_PDA_CRITICALSOUND 6 /* critical error occurred */ |
292 | //#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */ | 292 | //#define SHARP_PDA_SYSSTARTSOUND 7 /* system start */ |
293 | //#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */ | 293 | //#define SHARP_PDA_SYSTEMENDSOUND 8 /* system shutdown */ |
294 | //#define SHARP_PDA_APPSTART 9 /* application start */ | 294 | //#define SHARP_PDA_APPSTART 9 /* application start */ |
295 | //#define SHARP_PDA_APPQUIT 10 /* application ends */ | 295 | //#define SHARP_PDA_APPQUIT 10 /* application ends */ |
296 | 296 | ||
297 | //#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ | 297 | //#define SHARP_BUZ_SCHEDULE_ALARM 11 /* schedule alarm */ |
298 | //#define SHARP_BUZ_DAILY_ALARM 12 /* daily alarm */ | 298 | //#define SHARP_BUZ_DAILY_ALARM 12 /* daily alarm */ |
299 | //#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */ | 299 | //#define SHARP_BUZ_GOT_PHONE_CALL 13 /* phone call sound */ |
300 | //#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */ | 300 | //#define SHARP_BUZ_GOT_MAIL 14 /* mail sound */ |
301 | // | 301 | // |
302 | 302 | ||
303 | #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) | 303 | #defineSHARP_LED_IOCTL_START (SHARP_DEV_IOCTL_COMMAND_START) |
304 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) | 304 | #define SHARP_LED_SETSTATUS (SHARP_LED_IOCTL_START+1) |
diff --git a/libopie2/opiecore/oprocess.cpp b/libopie2/opiecore/oprocess.cpp index 0a361a1..6349c83 100644 --- a/libopie2/opiecore/oprocess.cpp +++ b/libopie2/opiecore/oprocess.cpp | |||
@@ -627,118 +627,118 @@ int OProcess::childError( int fdno ) | |||
627 | if ( 0 < len ) | 627 | if ( 0 < len ) |
628 | emit receivedStderr( this, buffer, len ); | 628 | emit receivedStderr( this, buffer, len ); |
629 | return len; | 629 | return len; |
630 | } | 630 | } |
631 | 631 | ||
632 | int OProcess::setupCommunication( Communication comm ) | 632 | int OProcess::setupCommunication( Communication comm ) |
633 | { | 633 | { |
634 | int ok; | 634 | int ok; |
635 | 635 | ||
636 | communication = comm; | 636 | communication = comm; |
637 | 637 | ||
638 | ok = 1; | 638 | ok = 1; |
639 | if ( comm & Stdin ) | 639 | if ( comm & Stdin ) |
640 | ok &= socketpair( AF_UNIX, SOCK_STREAM, 0, in ) >= 0; | 640 | ok &= socketpair( AF_UNIX, SOCK_STREAM, 0, in ) >= 0; |
641 | 641 | ||
642 | if ( comm & Stdout ) | 642 | if ( comm & Stdout ) |
643 | ok &= socketpair( AF_UNIX, SOCK_STREAM, 0, out ) >= 0; | 643 | ok &= socketpair( AF_UNIX, SOCK_STREAM, 0, out ) >= 0; |
644 | 644 | ||
645 | if ( comm & Stderr ) | 645 | if ( comm & Stderr ) |
646 | ok &= socketpair( AF_UNIX, SOCK_STREAM, 0, err ) >= 0; | 646 | ok &= socketpair( AF_UNIX, SOCK_STREAM, 0, err ) >= 0; |
647 | 647 | ||
648 | return ok; | 648 | return ok; |
649 | } | 649 | } |
650 | 650 | ||
651 | int OProcess::commSetupDoneP() | 651 | int OProcess::commSetupDoneP() |
652 | { | 652 | { |
653 | int ok = 1; | 653 | int ok = 1; |
654 | 654 | ||
655 | if ( communication != NoCommunication ) | 655 | if ( communication != NoCommunication ) |
656 | { | 656 | { |
657 | if ( communication & Stdin ) | 657 | if ( communication & Stdin ) |
658 | close( in[ 0 ] ); | 658 | close( in[ 0 ] ); |
659 | if ( communication & Stdout ) | 659 | if ( communication & Stdout ) |
660 | close( out[ 1 ] ); | 660 | close( out[ 1 ] ); |
661 | if ( communication & Stderr ) | 661 | if ( communication & Stderr ) |
662 | close( err[ 1 ] ); | 662 | close( err[ 1 ] ); |
663 | 663 | ||
664 | // Don't create socket notifiers and set the sockets non-blocking if | 664 | // Don't create socket notifiers and set the sockets non-blocking if |
665 | // blocking is requested. | 665 | // blocking is requested. |
666 | if ( run_mode == Block ) | 666 | if ( run_mode == Block ) |
667 | return ok; | 667 | return ok; |
668 | 668 | ||
669 | if ( communication & Stdin ) | 669 | if ( communication & Stdin ) |
670 | { | 670 | { |
671 | // ok &= (-1 != fcntl(in[1], F_SETFL, O_NONBLOCK)); | 671 | // ok &= (-1 != fcntl(in[1], F_SETFL, O_NONBLOCK)); |
672 | innot = new QSocketNotifier( in[ 1 ], QSocketNotifier::Write, this ); | 672 | innot = new QSocketNotifier( in[ 1 ], QSocketNotifier::Write, this ); |
673 | CHECK_PTR( innot ); | 673 | CHECK_PTR( innot ); |
674 | innot->setEnabled( false ); // will be enabled when data has to be sent | 674 | innot->setEnabled( false ); // will be enabled when data has to be sent |
675 | QObject::connect( innot, SIGNAL( activated( int ) ), | 675 | QObject::connect( innot, SIGNAL( activated(int) ), |
676 | this, SLOT( slotSendData( int ) ) ); | 676 | this, SLOT( slotSendData(int) ) ); |
677 | } | 677 | } |
678 | 678 | ||
679 | if ( communication & Stdout ) | 679 | if ( communication & Stdout ) |
680 | { | 680 | { |
681 | // ok &= (-1 != fcntl(out[0], F_SETFL, O_NONBLOCK)); | 681 | // ok &= (-1 != fcntl(out[0], F_SETFL, O_NONBLOCK)); |
682 | outnot = new QSocketNotifier( out[ 0 ], QSocketNotifier::Read, this ); | 682 | outnot = new QSocketNotifier( out[ 0 ], QSocketNotifier::Read, this ); |
683 | CHECK_PTR( outnot ); | 683 | CHECK_PTR( outnot ); |
684 | QObject::connect( outnot, SIGNAL( activated( int ) ), | 684 | QObject::connect( outnot, SIGNAL( activated(int) ), |
685 | this, SLOT( slotChildOutput( int ) ) ); | 685 | this, SLOT( slotChildOutput(int) ) ); |
686 | if ( communication & NoRead ) | 686 | if ( communication & NoRead ) |
687 | suspend(); | 687 | suspend(); |
688 | } | 688 | } |
689 | 689 | ||
690 | if ( communication & Stderr ) | 690 | if ( communication & Stderr ) |
691 | { | 691 | { |
692 | // ok &= (-1 != fcntl(err[0], F_SETFL, O_NONBLOCK)); | 692 | // ok &= (-1 != fcntl(err[0], F_SETFL, O_NONBLOCK)); |
693 | errnot = new QSocketNotifier( err[ 0 ], QSocketNotifier::Read, this ); | 693 | errnot = new QSocketNotifier( err[ 0 ], QSocketNotifier::Read, this ); |
694 | CHECK_PTR( errnot ); | 694 | CHECK_PTR( errnot ); |
695 | QObject::connect( errnot, SIGNAL( activated( int ) ), | 695 | QObject::connect( errnot, SIGNAL( activated(int) ), |
696 | this, SLOT( slotChildError( int ) ) ); | 696 | this, SLOT( slotChildError(int) ) ); |
697 | } | 697 | } |
698 | } | 698 | } |
699 | return ok; | 699 | return ok; |
700 | } | 700 | } |
701 | 701 | ||
702 | int OProcess::commSetupDoneC() | 702 | int OProcess::commSetupDoneC() |
703 | { | 703 | { |
704 | int ok = 1; | 704 | int ok = 1; |
705 | struct linger so; | 705 | struct linger so; |
706 | memset( &so, 0, sizeof( so ) ); | 706 | memset( &so, 0, sizeof( so ) ); |
707 | 707 | ||
708 | if ( communication & Stdin ) | 708 | if ( communication & Stdin ) |
709 | close( in[ 1 ] ); | 709 | close( in[ 1 ] ); |
710 | if ( communication & Stdout ) | 710 | if ( communication & Stdout ) |
711 | close( out[ 0 ] ); | 711 | close( out[ 0 ] ); |
712 | if ( communication & Stderr ) | 712 | if ( communication & Stderr ) |
713 | close( err[ 0 ] ); | 713 | close( err[ 0 ] ); |
714 | 714 | ||
715 | if ( communication & Stdin ) | 715 | if ( communication & Stdin ) |
716 | ok &= dup2( in[ 0 ], STDIN_FILENO ) != -1; | 716 | ok &= dup2( in[ 0 ], STDIN_FILENO ) != -1; |
717 | else | 717 | else |
718 | { | 718 | { |
719 | int null_fd = open( "/dev/null", O_RDONLY ); | 719 | int null_fd = open( "/dev/null", O_RDONLY ); |
720 | ok &= dup2( null_fd, STDIN_FILENO ) != -1; | 720 | ok &= dup2( null_fd, STDIN_FILENO ) != -1; |
721 | close( null_fd ); | 721 | close( null_fd ); |
722 | } | 722 | } |
723 | if ( communication & Stdout ) | 723 | if ( communication & Stdout ) |
724 | { | 724 | { |
725 | ok &= dup2( out[ 1 ], STDOUT_FILENO ) != -1; | 725 | ok &= dup2( out[ 1 ], STDOUT_FILENO ) != -1; |
726 | ok &= !setsockopt( out[ 1 ], SOL_SOCKET, SO_LINGER, ( char* ) & so, sizeof( so ) ); | 726 | ok &= !setsockopt( out[ 1 ], SOL_SOCKET, SO_LINGER, ( char* ) & so, sizeof( so ) ); |
727 | } | 727 | } |
728 | else | 728 | else |
729 | { | 729 | { |
730 | int null_fd = open( "/dev/null", O_WRONLY ); | 730 | int null_fd = open( "/dev/null", O_WRONLY ); |
731 | ok &= dup2( null_fd, STDOUT_FILENO ) != -1; | 731 | ok &= dup2( null_fd, STDOUT_FILENO ) != -1; |
732 | close( null_fd ); | 732 | close( null_fd ); |
733 | } | 733 | } |
734 | if ( communication & Stderr ) | 734 | if ( communication & Stderr ) |
735 | { | 735 | { |
736 | ok &= dup2( err[ 1 ], STDERR_FILENO ) != -1; | 736 | ok &= dup2( err[ 1 ], STDERR_FILENO ) != -1; |
737 | ok &= !setsockopt( err[ 1 ], SOL_SOCKET, SO_LINGER, reinterpret_cast<char *>( &so ), sizeof( so ) ); | 737 | ok &= !setsockopt( err[ 1 ], SOL_SOCKET, SO_LINGER, reinterpret_cast<char *>( &so ), sizeof( so ) ); |
738 | } | 738 | } |
739 | else | 739 | else |
740 | { | 740 | { |
741 | int null_fd = open( "/dev/null", O_WRONLY ); | 741 | int null_fd = open( "/dev/null", O_WRONLY ); |
742 | ok &= dup2( null_fd, STDERR_FILENO ) != -1; | 742 | ok &= dup2( null_fd, STDERR_FILENO ) != -1; |
743 | close( null_fd ); | 743 | close( null_fd ); |
744 | } | 744 | } |
diff --git a/libopie2/opiepim/core/ocontactaccess.cpp b/libopie2/opiepim/core/ocontactaccess.cpp index c12e138..4f9b504 100644 --- a/libopie2/opiepim/core/ocontactaccess.cpp +++ b/libopie2/opiepim/core/ocontactaccess.cpp | |||
@@ -28,102 +28,102 @@ | |||
28 | */ | 28 | */ |
29 | /* | 29 | /* |
30 | * ===================================================================== | 30 | * ===================================================================== |
31 | * ToDo: XML-Backend: Automatic reload if something was changed... | 31 | * ToDo: XML-Backend: Automatic reload if something was changed... |
32 | * | 32 | * |
33 | * | 33 | * |
34 | */ | 34 | */ |
35 | 35 | ||
36 | #include "ocontactaccess.h" | 36 | #include "ocontactaccess.h" |
37 | #include "obackendfactory.h" | 37 | #include "obackendfactory.h" |
38 | 38 | ||
39 | #include <qasciidict.h> | 39 | #include <qasciidict.h> |
40 | #include <qdatetime.h> | 40 | #include <qdatetime.h> |
41 | #include <qfile.h> | 41 | #include <qfile.h> |
42 | #include <qregexp.h> | 42 | #include <qregexp.h> |
43 | #include <qlist.h> | 43 | #include <qlist.h> |
44 | #include <qcopchannel_qws.h> | 44 | #include <qcopchannel_qws.h> |
45 | 45 | ||
46 | //#include <qpe/qcopenvelope_qws.h> | 46 | //#include <qpe/qcopenvelope_qws.h> |
47 | #include <qpe/global.h> | 47 | #include <qpe/global.h> |
48 | 48 | ||
49 | #include <errno.h> | 49 | #include <errno.h> |
50 | #include <fcntl.h> | 50 | #include <fcntl.h> |
51 | #include <unistd.h> | 51 | #include <unistd.h> |
52 | #include <stdlib.h> | 52 | #include <stdlib.h> |
53 | 53 | ||
54 | #include <opie2/ocontactaccessbackend_xml.h> | 54 | #include <opie2/ocontactaccessbackend_xml.h> |
55 | 55 | ||
56 | namespace Opie { | 56 | namespace Opie { |
57 | 57 | ||
58 | OPimContactAccess::OPimContactAccess ( const QString appname, const QString , | 58 | OPimContactAccess::OPimContactAccess ( const QString appname, const QString , |
59 | OPimContactAccessBackend* end, bool autosync ): | 59 | OPimContactAccessBackend* end, bool autosync ): |
60 | OPimAccessTemplate<OPimContact>( end ) | 60 | OPimAccessTemplate<OPimContact>( end ) |
61 | { | 61 | { |
62 | /* take care of the backend. If there is no one defined, we | 62 | /* take care of the backend. If there is no one defined, we |
63 | * will use the XML-Backend as default (until we have a cute SQL-Backend..). | 63 | * will use the XML-Backend as default (until we have a cute SQL-Backend..). |
64 | */ | 64 | */ |
65 | if( end == 0 ) { | 65 | if( end == 0 ) { |
66 | qWarning ("Using BackendFactory !"); | 66 | qWarning ("Using BackendFactory !"); |
67 | end = OBackendFactory<OPimContactAccessBackend>::Default( "contact", appname ); | 67 | end = OBackendFactory<OPimContactAccessBackend>::Default( "contact", appname ); |
68 | } | 68 | } |
69 | // Set backend locally and in template | 69 | // Set backend locally and in template |
70 | m_backEnd = end; | 70 | m_backEnd = end; |
71 | OPimAccessTemplate<OPimContact>::setBackEnd (end); | 71 | OPimAccessTemplate<OPimContact>::setBackEnd (end); |
72 | 72 | ||
73 | 73 | ||
74 | /* Connect signal of external db change to function */ | 74 | /* Connect signal of external db change to function */ |
75 | QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); | 75 | QCopChannel *dbchannel = new QCopChannel( "QPE/PIM", this ); |
76 | connect( dbchannel, SIGNAL(received(const QCString &, const QByteArray &)), | 76 | connect( dbchannel, SIGNAL(received(const QCString&,const QByteArray&)), |
77 | this, SLOT(copMessage( const QCString &, const QByteArray &)) ); | 77 | this, SLOT(copMessage(const QCString&,const QByteArray&)) ); |
78 | if ( autosync ){ | 78 | if ( autosync ){ |
79 | QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this ); | 79 | QCopChannel *syncchannel = new QCopChannel( "QPE/Sync", this ); |
80 | connect( syncchannel, SIGNAL(received(const QCString &, const QByteArray &)), | 80 | connect( syncchannel, SIGNAL(received(const QCString&,const QByteArray&)), |
81 | this, SLOT(copMessage( const QCString &, const QByteArray &)) ); | 81 | this, SLOT(copMessage(const QCString&,const QByteArray&)) ); |
82 | } | 82 | } |
83 | 83 | ||
84 | 84 | ||
85 | } | 85 | } |
86 | OPimContactAccess::~OPimContactAccess () | 86 | OPimContactAccess::~OPimContactAccess () |
87 | { | 87 | { |
88 | /* The user may forget to save the changed database, therefore try to | 88 | /* The user may forget to save the changed database, therefore try to |
89 | * do it for him.. | 89 | * do it for him.. |
90 | */ | 90 | */ |
91 | save(); | 91 | save(); |
92 | // delete m_backEnd; is done by template.. | 92 | // delete m_backEnd; is done by template.. |
93 | } | 93 | } |
94 | 94 | ||
95 | 95 | ||
96 | bool OPimContactAccess::save () | 96 | bool OPimContactAccess::save () |
97 | { | 97 | { |
98 | /* If the database was changed externally, we could not save the | 98 | /* If the database was changed externally, we could not save the |
99 | * Data. This will remove added items which is unacceptable ! | 99 | * Data. This will remove added items which is unacceptable ! |
100 | * Therefore: Reload database and merge the data... | 100 | * Therefore: Reload database and merge the data... |
101 | */ | 101 | */ |
102 | if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() ) | 102 | if ( OPimAccessTemplate<OPimContact>::wasChangedExternally() ) |
103 | reload(); | 103 | reload(); |
104 | 104 | ||
105 | bool status = OPimAccessTemplate<OPimContact>::save(); | 105 | bool status = OPimAccessTemplate<OPimContact>::save(); |
106 | if ( !status ) return false; | 106 | if ( !status ) return false; |
107 | 107 | ||
108 | /* Now tell everyone that new data is available. | 108 | /* Now tell everyone that new data is available. |
109 | */ | 109 | */ |
110 | QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); | 110 | QCopEnvelope e( "QPE/PIM", "addressbookUpdated()" ); |
111 | 111 | ||
112 | return true; | 112 | return true; |
113 | } | 113 | } |
114 | 114 | ||
115 | const uint OPimContactAccess::querySettings() | 115 | const uint OPimContactAccess::querySettings() |
116 | { | 116 | { |
117 | return ( m_backEnd->querySettings() ); | 117 | return ( m_backEnd->querySettings() ); |
118 | } | 118 | } |
119 | 119 | ||
120 | bool OPimContactAccess::hasQuerySettings ( int querySettings ) const | 120 | bool OPimContactAccess::hasQuerySettings ( int querySettings ) const |
121 | { | 121 | { |
122 | return ( m_backEnd->hasQuerySettings ( querySettings ) ); | 122 | return ( m_backEnd->hasQuerySettings ( querySettings ) ); |
123 | } | 123 | } |
124 | OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const | 124 | OPimRecordList<OPimContact> OPimContactAccess::sorted( bool ascending, int sortOrder, int sortFilter, int cat ) const |
125 | { | 125 | { |
126 | QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat ); | 126 | QArray<int> matchingContacts = m_backEnd -> sorted( ascending, sortOrder, sortFilter, cat ); |
127 | return ( OPimRecordList<OPimContact>(matchingContacts, this) ); | 127 | return ( OPimRecordList<OPimContact>(matchingContacts, this) ); |
128 | } | 128 | } |
129 | 129 | ||
diff --git a/libopie2/opiepim/ui/opimmainwindow.cpp b/libopie2/opiepim/ui/opimmainwindow.cpp index 10ed743..40dc297 100644 --- a/libopie2/opiepim/ui/opimmainwindow.cpp +++ b/libopie2/opiepim/ui/opimmainwindow.cpp | |||
@@ -2,100 +2,100 @@ | |||
2 | This file is part of the Opie Project | 2 | This file is part of the Opie Project |
3 | Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) | 3 | Copyright (C) Stefan Eilers (Eilers.Stefan@epost.de) |
4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> | 4 | =. Copyright (C) The Opie Team <opie-devel@handhelds.org> |
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #include <qapplication.h> | 29 | #include <qapplication.h> |
30 | #include <qdatetime.h> | 30 | #include <qdatetime.h> |
31 | #include <qcopchannel_qws.h> | 31 | #include <qcopchannel_qws.h> |
32 | 32 | ||
33 | #include <qpe/sound.h> | 33 | #include <qpe/sound.h> |
34 | #include <qpe/qcopenvelope_qws.h> | 34 | #include <qpe/qcopenvelope_qws.h> |
35 | #include <qpe/qpeapplication.h> | 35 | #include <qpe/qpeapplication.h> |
36 | 36 | ||
37 | #include <opie2/opimresolver.h> | 37 | #include <opie2/opimresolver.h> |
38 | #include "opimmainwindow.h" | 38 | #include "opimmainwindow.h" |
39 | 39 | ||
40 | namespace Opie { | 40 | namespace Opie { |
41 | OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, | 41 | OPimMainWindow::OPimMainWindow( const QString& service, QWidget* parent, |
42 | const char* name, WFlags flag ) | 42 | const char* name, WFlags flag ) |
43 | : QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) { | 43 | : QMainWindow( parent, name, flag ), m_rtti(-1), m_service( service ), m_fallBack(0l) { |
44 | 44 | ||
45 | /* | 45 | /* |
46 | * let's generate our QCopChannel | 46 | * let's generate our QCopChannel |
47 | */ | 47 | */ |
48 | m_str = QString("QPE/"+m_service).local8Bit(); | 48 | m_str = QString("QPE/"+m_service).local8Bit(); |
49 | m_channel= new QCopChannel(m_str, this ); | 49 | m_channel= new QCopChannel(m_str, this ); |
50 | connect(m_channel, SIGNAL(received(const QCString&, const QByteArray& ) ), | 50 | connect(m_channel, SIGNAL(received(const QCString&,const QByteArray&) ), |
51 | this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); | 51 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); |
52 | connect(qApp, SIGNAL(appMessage(const QCString&, const QByteArray& ) ), | 52 | connect(qApp, SIGNAL(appMessage(const QCString&,const QByteArray&) ), |
53 | this, SLOT( appMessage( const QCString&, const QByteArray& ) ) ); | 53 | this, SLOT( appMessage(const QCString&,const QByteArray&) ) ); |
54 | 54 | ||
55 | /* connect flush and reload */ | 55 | /* connect flush and reload */ |
56 | connect(qApp, SIGNAL(flush() ), | 56 | connect(qApp, SIGNAL(flush() ), |
57 | this, SLOT(flush() ) ); | 57 | this, SLOT(flush() ) ); |
58 | connect(qApp, SIGNAL(reload() ), | 58 | connect(qApp, SIGNAL(reload() ), |
59 | this, SLOT(reload() ) ); | 59 | this, SLOT(reload() ) ); |
60 | } | 60 | } |
61 | OPimMainWindow::~OPimMainWindow() { | 61 | OPimMainWindow::~OPimMainWindow() { |
62 | delete m_channel; | 62 | delete m_channel; |
63 | } | 63 | } |
64 | QCopChannel* OPimMainWindow::channel() { | 64 | QCopChannel* OPimMainWindow::channel() { |
65 | return m_channel; | 65 | return m_channel; |
66 | } | 66 | } |
67 | void OPimMainWindow::doSetDocument( const QString& ) { | 67 | void OPimMainWindow::doSetDocument( const QString& ) { |
68 | 68 | ||
69 | } | 69 | } |
70 | void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) { | 70 | void OPimMainWindow::appMessage( const QCString& cmd, const QByteArray& array ) { |
71 | bool needShow = false; | 71 | bool needShow = false; |
72 | /* | 72 | /* |
73 | * create demands to create | 73 | * create demands to create |
74 | * a new record... | 74 | * a new record... |
75 | */ | 75 | */ |
76 | QDataStream stream(array, IO_ReadOnly); | 76 | QDataStream stream(array, IO_ReadOnly); |
77 | if ( cmd == "create()" ) { | 77 | if ( cmd == "create()" ) { |
78 | raise(); | 78 | raise(); |
79 | int uid = create(); | 79 | int uid = create(); |
80 | QCopEnvelope e(m_str, "created(int)" ); | 80 | QCopEnvelope e(m_str, "created(int)" ); |
81 | e << uid; | 81 | e << uid; |
82 | needShow = true; | 82 | needShow = true; |
83 | }else if ( cmd == "remove(int)" ) { | 83 | }else if ( cmd == "remove(int)" ) { |
84 | int uid; | 84 | int uid; |
85 | stream >> uid; | 85 | stream >> uid; |
86 | bool rem = remove( uid ); | 86 | bool rem = remove( uid ); |
87 | QCopEnvelope e(m_str, "removed(bool)" ); | 87 | QCopEnvelope e(m_str, "removed(bool)" ); |
88 | e << rem; | 88 | e << rem; |
89 | needShow = true; | 89 | needShow = true; |
90 | }else if ( cmd == "beam(int)" ) { | 90 | }else if ( cmd == "beam(int)" ) { |
91 | int uid; | 91 | int uid; |
92 | stream >> uid; | 92 | stream >> uid; |
93 | beam( uid); | 93 | beam( uid); |
94 | }else if ( cmd == "show(int)" ) { | 94 | }else if ( cmd == "show(int)" ) { |
95 | raise(); | 95 | raise(); |
96 | int uid; | 96 | int uid; |
97 | stream >> uid; | 97 | stream >> uid; |
98 | show( uid ); | 98 | show( uid ); |
99 | needShow = true; | 99 | needShow = true; |
100 | }else if ( cmd == "edit(int)" ) { | 100 | }else if ( cmd == "edit(int)" ) { |
101 | raise(); | 101 | raise(); |
diff --git a/libopie2/opiepim/ui/opimrecurrencewidget.cpp b/libopie2/opiepim/ui/opimrecurrencewidget.cpp index 569bdd5..90c1a5f 100644 --- a/libopie2/opiepim/ui/opimrecurrencewidget.cpp +++ b/libopie2/opiepim/ui/opimrecurrencewidget.cpp | |||
@@ -507,98 +507,98 @@ void OPimRecurrenceWidget::setupWeekly() { | |||
507 | // might as well set the day too... | 507 | // might as well set the day too... |
508 | if ( startWeekOnMonday ) { | 508 | if ( startWeekOnMonday ) { |
509 | fraExtra->setButton( start.dayOfWeek() - 1 ); | 509 | fraExtra->setButton( start.dayOfWeek() - 1 ); |
510 | } else { | 510 | } else { |
511 | fraExtra->setButton( start.dayOfWeek() % 7 ); | 511 | fraExtra->setButton( start.dayOfWeek() % 7 ); |
512 | } | 512 | } |
513 | lblFreq->setText( tr("week(s)") ); | 513 | lblFreq->setText( tr("week(s)") ); |
514 | lblVar2->show(); | 514 | lblVar2->show(); |
515 | showRepeatStuff(); | 515 | showRepeatStuff(); |
516 | setupRepeatLabel( 1 ); | 516 | setupRepeatLabel( 1 ); |
517 | } | 517 | } |
518 | void OPimRecurrenceWidget::setupMonthly() { | 518 | void OPimRecurrenceWidget::setupMonthly() { |
519 | hideExtras(); | 519 | hideExtras(); |
520 | lblWeekVar->hide(); | 520 | lblWeekVar->hide(); |
521 | fraExtra->setTitle( tr("Repeat By") ); | 521 | fraExtra->setTitle( tr("Repeat By") ); |
522 | fraExtra->setExclusive( TRUE ); | 522 | fraExtra->setExclusive( TRUE ); |
523 | fraExtra->show(); | 523 | fraExtra->show(); |
524 | cmdExtra1->setText( tr("Day") ); | 524 | cmdExtra1->setText( tr("Day") ); |
525 | cmdExtra1->show(); | 525 | cmdExtra1->show(); |
526 | cmdExtra2->setText( tr("Date") ); | 526 | cmdExtra2->setText( tr("Date") ); |
527 | cmdExtra2->show(); | 527 | cmdExtra2->show(); |
528 | spinFreq->setValue( 1 ); | 528 | spinFreq->setValue( 1 ); |
529 | lblFreq->setText( tr("month(s)") ); | 529 | lblFreq->setText( tr("month(s)") ); |
530 | lblVar2->show(); | 530 | lblVar2->show(); |
531 | showRepeatStuff(); | 531 | showRepeatStuff(); |
532 | setupRepeatLabel( 1 ); | 532 | setupRepeatLabel( 1 ); |
533 | } | 533 | } |
534 | void OPimRecurrenceWidget::setupYearly() { | 534 | void OPimRecurrenceWidget::setupYearly() { |
535 | hideExtras(); | 535 | hideExtras(); |
536 | lblWeekVar->hide(); | 536 | lblWeekVar->hide(); |
537 | spinFreq->setValue( 1 ); | 537 | spinFreq->setValue( 1 ); |
538 | lblFreq->setText( tr("year(s)") ); | 538 | lblFreq->setText( tr("year(s)") ); |
539 | lblFreq->show(); | 539 | lblFreq->show(); |
540 | lblFreq->show(); | 540 | lblFreq->show(); |
541 | showRepeatStuff(); | 541 | showRepeatStuff(); |
542 | lblVar2->show(); | 542 | lblVar2->show(); |
543 | QString strEvery = strYearTemplate.arg( start.monthName(start.month()) ).arg( numberPlacing(start.day()) ); | 543 | QString strEvery = strYearTemplate.arg( start.monthName(start.month()) ).arg( numberPlacing(start.day()) ); |
544 | lblRepeat->setText( strEvery ); | 544 | lblRepeat->setText( strEvery ); |
545 | setupRepeatLabel( 1 ); | 545 | setupRepeatLabel( 1 ); |
546 | 546 | ||
547 | } | 547 | } |
548 | void OPimRecurrenceWidget::init() { | 548 | void OPimRecurrenceWidget::init() { |
549 | QPopupMenu *m1 = new QPopupMenu( this ); | 549 | QPopupMenu *m1 = new QPopupMenu( this ); |
550 | repeatPicker = new DateBookMonth( m1, 0, TRUE ); | 550 | repeatPicker = new DateBookMonth( m1, 0, TRUE ); |
551 | m1->insertItem( repeatPicker ); | 551 | m1->insertItem( repeatPicker ); |
552 | cmdEnd->setPopup( m1 ); | 552 | cmdEnd->setPopup( m1 ); |
553 | cmdEnd->setPopupDelay( 0 ); | 553 | cmdEnd->setPopupDelay( 0 ); |
554 | 554 | ||
555 | QObject::connect( repeatPicker, SIGNAL(dateClicked(int, int, int)), | 555 | QObject::connect( repeatPicker, SIGNAL(dateClicked(int,int,int)), |
556 | this, SLOT(endDateChanged(int, int, int)) ); | 556 | this, SLOT(endDateChanged(int,int,int)) ); |
557 | QObject::connect( qApp, SIGNAL(weekChanged(bool)), | 557 | QObject::connect( qApp, SIGNAL(weekChanged(bool)), |
558 | this, SLOT(slotChangeStartOfWeek(bool)) ); | 558 | this, SLOT(slotChangeStartOfWeek(bool)) ); |
559 | 559 | ||
560 | listRTypeButtons.setAutoDelete( TRUE ); | 560 | listRTypeButtons.setAutoDelete( TRUE ); |
561 | listRTypeButtons.append( cmdNone ); | 561 | listRTypeButtons.append( cmdNone ); |
562 | listRTypeButtons.append( cmdDay ); | 562 | listRTypeButtons.append( cmdDay ); |
563 | listRTypeButtons.append( cmdWeek ); | 563 | listRTypeButtons.append( cmdWeek ); |
564 | listRTypeButtons.append( cmdMonth ); | 564 | listRTypeButtons.append( cmdMonth ); |
565 | listRTypeButtons.append( cmdYear ); | 565 | listRTypeButtons.append( cmdYear ); |
566 | 566 | ||
567 | listExtra.setAutoDelete( TRUE ); | 567 | listExtra.setAutoDelete( TRUE ); |
568 | listExtra.append( cmdExtra1 ); | 568 | listExtra.append( cmdExtra1 ); |
569 | listExtra.append( cmdExtra2 ); | 569 | listExtra.append( cmdExtra2 ); |
570 | listExtra.append( cmdExtra3 ); | 570 | listExtra.append( cmdExtra3 ); |
571 | listExtra.append( cmdExtra4 ); | 571 | listExtra.append( cmdExtra4 ); |
572 | listExtra.append( cmdExtra5 ); | 572 | listExtra.append( cmdExtra5 ); |
573 | listExtra.append( cmdExtra6 ); | 573 | listExtra.append( cmdExtra6 ); |
574 | listExtra.append( cmdExtra7 ); | 574 | listExtra.append( cmdExtra7 ); |
575 | } | 575 | } |
576 | void OPimRecurrenceWidget::hideExtras() { | 576 | void OPimRecurrenceWidget::hideExtras() { |
577 | // hide the extra buttons... | 577 | // hide the extra buttons... |
578 | fraExtra->hide(); | 578 | fraExtra->hide(); |
579 | chkNoEnd->hide(); | 579 | chkNoEnd->hide(); |
580 | QListIterator<QToolButton> it( listExtra ); | 580 | QListIterator<QToolButton> it( listExtra ); |
581 | for ( ; *it; ++it ) { | 581 | for ( ; *it; ++it ) { |
582 | (*it)->hide(); | 582 | (*it)->hide(); |
583 | (*it)->setOn( FALSE ); | 583 | (*it)->setOn( FALSE ); |
584 | } | 584 | } |
585 | } | 585 | } |
586 | void OPimRecurrenceWidget::showRepeatStuff() { | 586 | void OPimRecurrenceWidget::showRepeatStuff() { |
587 | cmdEnd->show(); | 587 | cmdEnd->show(); |
588 | chkNoEnd->show(); | 588 | chkNoEnd->show(); |
589 | lblFreq->show(); | 589 | lblFreq->show(); |
590 | lblEvery->show(); | 590 | lblEvery->show(); |
591 | lblFreq->show(); | 591 | lblFreq->show(); |
592 | spinFreq->show(); | 592 | spinFreq->show(); |
593 | lblEnd->show(); | 593 | lblEnd->show(); |
594 | lblRepeat->setText( tr("Every") ); | 594 | lblRepeat->setText( tr("Every") ); |
595 | } | 595 | } |
596 | 596 | ||
597 | 597 | ||
598 | static int week( const QDate &start ) | 598 | static int week( const QDate &start ) |
599 | { | 599 | { |
600 | // figure out the week... | 600 | // figure out the week... |
601 | int stop = start.day(), | 601 | int stop = start.day(), |
602 | sentinel = start.dayOfWeek(), | 602 | sentinel = start.dayOfWeek(), |
603 | dayOfWeek = QDate( start.year(), start.month(), 1 ).dayOfWeek(), | 603 | dayOfWeek = QDate( start.year(), start.month(), 1 ).dayOfWeek(), |
604 | week = 1, | 604 | week = 1, |
diff --git a/libopie2/opieui/fileselector/ofiledialog.cpp b/libopie2/opieui/fileselector/ofiledialog.cpp index 2a89c5d..e7daead 100644 --- a/libopie2/opieui/fileselector/ofiledialog.cpp +++ b/libopie2/opieui/fileselector/ofiledialog.cpp | |||
@@ -66,98 +66,98 @@ void saveLastDir( const QString& key, const QString& file ) | |||
66 | { | 66 | { |
67 | if ( qApp->argc() < 1 ) | 67 | if ( qApp->argc() < 1 ) |
68 | return; | 68 | return; |
69 | 69 | ||
70 | Config cfg( QFileInfo(qApp->argv()[0]).fileName() ); | 70 | Config cfg( QFileInfo(qApp->argv()[0]).fileName() ); |
71 | cfg.setGroup( key ); | 71 | cfg.setGroup( key ); |
72 | QFileInfo inf( file ); | 72 | QFileInfo inf( file ); |
73 | cfg.writeEntry("LastDir", inf.dirPath( true ) ); | 73 | cfg.writeEntry("LastDir", inf.dirPath( true ) ); |
74 | } | 74 | } |
75 | }; | 75 | }; |
76 | 76 | ||
77 | /** | 77 | /** |
78 | * This constructs a modal dialog | 78 | * This constructs a modal dialog |
79 | * | 79 | * |
80 | * @param caption The caption of the dialog | 80 | * @param caption The caption of the dialog |
81 | * @param wid The parent widget | 81 | * @param wid The parent widget |
82 | * @param mode The mode of the OFileSelector @see OFileSelector | 82 | * @param mode The mode of the OFileSelector @see OFileSelector |
83 | * @param selector The selector of the OFileSelector | 83 | * @param selector The selector of the OFileSelector |
84 | * @param dirName the dir or resource to start from | 84 | * @param dirName the dir or resource to start from |
85 | * @param fileName a proposed or existing filename | 85 | * @param fileName a proposed or existing filename |
86 | * @param mimetypes The mimeTypes | 86 | * @param mimetypes The mimeTypes |
87 | */ | 87 | */ |
88 | OFileDialog::OFileDialog(const QString &caption, | 88 | OFileDialog::OFileDialog(const QString &caption, |
89 | QWidget *wid, int mode, int selector, | 89 | QWidget *wid, int mode, int selector, |
90 | const QString &dirName, | 90 | const QString &dirName, |
91 | const QString &fileName, | 91 | const QString &fileName, |
92 | const QMap<QString,QStringList>& mimetypes ) | 92 | const QMap<QString,QStringList>& mimetypes ) |
93 | : QDialog( wid, "OFileDialog", true ) | 93 | : QDialog( wid, "OFileDialog", true ) |
94 | { | 94 | { |
95 | // QVBoxLayout *lay = new QVBoxLayout(this); | 95 | // QVBoxLayout *lay = new QVBoxLayout(this); |
96 | //showMaximized(); | 96 | //showMaximized(); |
97 | QVBoxLayout *lay = new QVBoxLayout(this ); | 97 | QVBoxLayout *lay = new QVBoxLayout(this ); |
98 | file = new OFileSelector(this , mode, selector, | 98 | file = new OFileSelector(this , mode, selector, |
99 | dirName, fileName, | 99 | dirName, fileName, |
100 | mimetypes ); | 100 | mimetypes ); |
101 | lay->addWidget( file ); | 101 | lay->addWidget( file ); |
102 | 102 | ||
103 | //lay->addWidget( file ); | 103 | //lay->addWidget( file ); |
104 | //showFullScreen(); | 104 | //showFullScreen(); |
105 | setCaption( caption.isEmpty() ? tr("FileDialog") : caption ); | 105 | setCaption( caption.isEmpty() ? tr("FileDialog") : caption ); |
106 | connect(file, SIGNAL(fileSelected(const QString&) ), | 106 | connect(file, SIGNAL(fileSelected(const QString&) ), |
107 | this, SLOT(slotFileSelected(const QString&) ) ); | 107 | this, SLOT(slotFileSelected(const QString&) ) ); |
108 | connect(file, SIGNAL(ok() ), | 108 | connect(file, SIGNAL(ok() ), |
109 | this, SLOT(slotSelectorOk()) ) ; | 109 | this, SLOT(slotSelectorOk()) ) ; |
110 | 110 | ||
111 | connect(file, SIGNAL(dirSelected(const QString&) ), this, SLOT(slotDirSelected(const QString&) ) ); | 111 | connect(file, SIGNAL(dirSelected(const QString&) ), this, SLOT(slotDirSelected(const QString&) ) ); |
112 | 112 | ||
113 | #if 0 | 113 | #if 0 |
114 | connect(file, SIGNAL(dirSelected(const QString &) ), | 114 | connect(file, SIGNAL(dirSelected(const QString&) ), |
115 | this, SLOT(slotDirSelected(const QString &) ) ); | 115 | this, SLOT(slotDirSelected(const QString&) ) ); |
116 | #endif | 116 | #endif |
117 | } | 117 | } |
118 | /** | 118 | /** |
119 | * @returns the mimetype of the selected | 119 | * @returns the mimetype of the selected |
120 | * currently it return QString::null | 120 | * currently it return QString::null |
121 | */ | 121 | */ |
122 | QString OFileDialog::mimetype()const | 122 | QString OFileDialog::mimetype()const |
123 | { | 123 | { |
124 | return QString::null; | 124 | return QString::null; |
125 | } | 125 | } |
126 | 126 | ||
127 | /** | 127 | /** |
128 | * @return the fileName | 128 | * @return the fileName |
129 | */ | 129 | */ |
130 | QString OFileDialog::fileName()const | 130 | QString OFileDialog::fileName()const |
131 | { | 131 | { |
132 | return file->selectedName(); | 132 | return file->selectedName(); |
133 | } | 133 | } |
134 | 134 | ||
135 | /** | 135 | /** |
136 | * return a DocLnk to the current file | 136 | * return a DocLnk to the current file |
137 | */ | 137 | */ |
138 | DocLnk OFileDialog::selectedDocument()const | 138 | DocLnk OFileDialog::selectedDocument()const |
139 | { | 139 | { |
140 | return file->selectedDocument(); | 140 | return file->selectedDocument(); |
141 | } | 141 | } |
142 | 142 | ||
143 | /** | 143 | /** |
144 | * This opens up a filedialog in Open mode | 144 | * This opens up a filedialog in Open mode |
145 | * | 145 | * |
146 | * @param selector the Selector Mode | 146 | * @param selector the Selector Mode |
147 | * @param startDir Where to start from | 147 | * @param startDir Where to start from |
148 | * @param file A proposed filename | 148 | * @param file A proposed filename |
149 | * @param mimes A list of MimeTypes | 149 | * @param mimes A list of MimeTypes |
150 | * @param wid the parent | 150 | * @param wid the parent |
151 | * @param caption of the dialog if QString::null tr("Open") will be used | 151 | * @param caption of the dialog if QString::null tr("Open") will be used |
152 | * @return the fileName or QString::null | 152 | * @return the fileName or QString::null |
153 | */ | 153 | */ |
154 | QString OFileDialog::getOpenFileName(int selector, | 154 | QString OFileDialog::getOpenFileName(int selector, |
155 | const QString &_startDir, | 155 | const QString &_startDir, |
156 | const QString &file, | 156 | const QString &file, |
157 | const MimeTypes &mimes, | 157 | const MimeTypes &mimes, |
158 | QWidget *wid, | 158 | QWidget *wid, |
159 | const QString &caption ) | 159 | const QString &caption ) |
160 | { | 160 | { |
161 | QString ret; | 161 | QString ret; |
162 | QString startDir = _startDir; | 162 | QString startDir = _startDir; |
163 | if (startDir.isEmpty() ) | 163 | if (startDir.isEmpty() ) |
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp index 600daff..15cadd4 100644 --- a/libopie2/opieui/fileselector/ofileselector.cpp +++ b/libopie2/opieui/fileselector/ofileselector.cpp | |||
@@ -165,102 +165,102 @@ QString ODocumentFileView::selectedName()const | |||
165 | if (!m_selector) | 165 | if (!m_selector) |
166 | return QString::null; | 166 | return QString::null; |
167 | 167 | ||
168 | return m_selector->selectedDocument().file(); | 168 | return m_selector->selectedDocument().file(); |
169 | } | 169 | } |
170 | 170 | ||
171 | QString ODocumentFileView::selectedPath()const | 171 | QString ODocumentFileView::selectedPath()const |
172 | { | 172 | { |
173 | return QPEApplication::documentDir(); | 173 | return QPEApplication::documentDir(); |
174 | } | 174 | } |
175 | 175 | ||
176 | QString ODocumentFileView::directory()const | 176 | QString ODocumentFileView::directory()const |
177 | { | 177 | { |
178 | return selectedPath(); | 178 | return selectedPath(); |
179 | } | 179 | } |
180 | 180 | ||
181 | void ODocumentFileView::reread() | 181 | void ODocumentFileView::reread() |
182 | { | 182 | { |
183 | if (!m_selector) | 183 | if (!m_selector) |
184 | return; | 184 | return; |
185 | 185 | ||
186 | m_selector->setNewVisible( showNew() ); | 186 | m_selector->setNewVisible( showNew() ); |
187 | m_selector->setCloseVisible( showClose() ); | 187 | m_selector->setCloseVisible( showClose() ); |
188 | m_selector->filter = currentMimeType().join(";"); | 188 | m_selector->filter = currentMimeType().join(";"); |
189 | m_selector->reread(); | 189 | m_selector->reread(); |
190 | } | 190 | } |
191 | 191 | ||
192 | int ODocumentFileView::fileCount()const | 192 | int ODocumentFileView::fileCount()const |
193 | { | 193 | { |
194 | if (!m_selector) | 194 | if (!m_selector) |
195 | return -1; | 195 | return -1; |
196 | 196 | ||
197 | return m_selector->fileCount(); | 197 | return m_selector->fileCount(); |
198 | } | 198 | } |
199 | 199 | ||
200 | DocLnk ODocumentFileView::selectedDocument()const | 200 | DocLnk ODocumentFileView::selectedDocument()const |
201 | { | 201 | { |
202 | if (!m_selector) | 202 | if (!m_selector) |
203 | return DocLnk(); | 203 | return DocLnk(); |
204 | 204 | ||
205 | return m_selector->selectedDocument(); | 205 | return m_selector->selectedDocument(); |
206 | } | 206 | } |
207 | 207 | ||
208 | QWidget* ODocumentFileView::widget( QWidget* parent ) | 208 | QWidget* ODocumentFileView::widget( QWidget* parent ) |
209 | { | 209 | { |
210 | if (!m_selector ) | 210 | if (!m_selector ) |
211 | { | 211 | { |
212 | m_selector = new FileSelector(currentMimeType().join(";"), parent, "fileselector", showNew(), showClose() ); | 212 | m_selector = new FileSelector(currentMimeType().join(";"), parent, "fileselector", showNew(), showClose() ); |
213 | QObject::connect(m_selector, SIGNAL(fileSelected( const DocLnk& ) ), | 213 | QObject::connect(m_selector, SIGNAL(fileSelected(const DocLnk&) ), |
214 | selector(), SLOT(slotDocLnkBridge(const DocLnk&) ) ); | 214 | selector(), SLOT(slotDocLnkBridge(const DocLnk&) ) ); |
215 | QObject::connect(m_selector, SIGNAL(closeMe() ), | 215 | QObject::connect(m_selector, SIGNAL(closeMe() ), |
216 | selector(), SIGNAL(closeMe() ) ); | 216 | selector(), SIGNAL(closeMe() ) ); |
217 | QObject::connect(m_selector, SIGNAL(newSelected(const DocLnk& ) ), | 217 | QObject::connect(m_selector, SIGNAL(newSelected(const DocLnk&) ), |
218 | selector(), SIGNAL(newSelected(const DocLnk& ) ) ); | 218 | selector(), SIGNAL(newSelected(const DocLnk&) ) ); |
219 | } | 219 | } |
220 | 220 | ||
221 | return m_selector; | 221 | return m_selector; |
222 | } | 222 | } |
223 | 223 | ||
224 | /* | 224 | /* |
225 | * This is the file system view used | 225 | * This is the file system view used |
226 | * we use a QListView + QListViewItems for it | 226 | * we use a QListView + QListViewItems for it |
227 | */ | 227 | */ |
228 | 228 | ||
229 | OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap, | 229 | OFileSelectorItem::OFileSelectorItem( QListView* view, const QPixmap& pixmap, |
230 | const QString& path, const QString& date, | 230 | const QString& path, const QString& date, |
231 | const QString& size, const QString& dir, | 231 | const QString& size, const QString& dir, |
232 | bool isLocked, bool isDir ) | 232 | bool isLocked, bool isDir ) |
233 | : QListViewItem( view ) | 233 | : QListViewItem( view ) |
234 | { | 234 | { |
235 | setPixmap(0, pixmap ); | 235 | setPixmap(0, pixmap ); |
236 | setText(1, path ); | 236 | setText(1, path ); |
237 | setText(2, size ); | 237 | setText(2, size ); |
238 | setText(3, date ); | 238 | setText(3, date ); |
239 | m_isDir = isDir; | 239 | m_isDir = isDir; |
240 | m_dir = dir; | 240 | m_dir = dir; |
241 | m_locked = isLocked; | 241 | m_locked = isLocked; |
242 | } | 242 | } |
243 | 243 | ||
244 | OFileSelectorItem::~OFileSelectorItem() | 244 | OFileSelectorItem::~OFileSelectorItem() |
245 | { | 245 | { |
246 | } | 246 | } |
247 | 247 | ||
248 | bool OFileSelectorItem::isLocked()const | 248 | bool OFileSelectorItem::isLocked()const |
249 | { | 249 | { |
250 | return m_locked; | 250 | return m_locked; |
251 | } | 251 | } |
252 | 252 | ||
253 | QString OFileSelectorItem::directory()const | 253 | QString OFileSelectorItem::directory()const |
254 | { | 254 | { |
255 | return m_dir; | 255 | return m_dir; |
256 | } | 256 | } |
257 | 257 | ||
258 | bool OFileSelectorItem::isDir()const | 258 | bool OFileSelectorItem::isDir()const |
259 | { | 259 | { |
260 | return m_isDir; | 260 | return m_isDir; |
261 | } | 261 | } |
262 | 262 | ||
263 | QString OFileSelectorItem::path()const | 263 | QString OFileSelectorItem::path()const |
264 | { | 264 | { |
265 | return text( 1 ); | 265 | return text( 1 ); |
266 | } | 266 | } |
@@ -479,98 +479,98 @@ void OFileViewFileListView::reread( bool all ) | |||
479 | { // couldn't resolve symlink add it as symlink | 479 | { // couldn't resolve symlink add it as symlink |
480 | addSymlink( fi ); | 480 | addSymlink( fi ); |
481 | } | 481 | } |
482 | } // off for loop for symlink resolving | 482 | } // off for loop for symlink resolving |
483 | } | 483 | } |
484 | else if( fi->isDir() ) | 484 | else if( fi->isDir() ) |
485 | addDir( fi ); | 485 | addDir( fi ); |
486 | else if( fi->isFile() ) | 486 | else if( fi->isFile() ) |
487 | addFile( fi ); | 487 | addFile( fi ); |
488 | 488 | ||
489 | ++it; | 489 | ++it; |
490 | } // of while loop | 490 | } // of while loop |
491 | m_view->sort(); | 491 | m_view->sort(); |
492 | 492 | ||
493 | } | 493 | } |
494 | int OFileViewFileListView::fileCount()const | 494 | int OFileViewFileListView::fileCount()const |
495 | { | 495 | { |
496 | return m_view->childCount(); | 496 | return m_view->childCount(); |
497 | } | 497 | } |
498 | 498 | ||
499 | QString OFileViewFileListView::currentDir()const | 499 | QString OFileViewFileListView::currentDir()const |
500 | { | 500 | { |
501 | return m_currentDir; | 501 | return m_currentDir; |
502 | } | 502 | } |
503 | 503 | ||
504 | OFileSelector* OFileViewFileListView::selector() | 504 | OFileSelector* OFileViewFileListView::selector() |
505 | { | 505 | { |
506 | return m_sel; | 506 | return m_sel; |
507 | } | 507 | } |
508 | 508 | ||
509 | bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) | 509 | bool OFileViewFileListView::eventFilter (QObject *o, QEvent *e) |
510 | { | 510 | { |
511 | if ( e->type() == QEvent::KeyPress ) | 511 | if ( e->type() == QEvent::KeyPress ) |
512 | { | 512 | { |
513 | QKeyEvent *k = (QKeyEvent *)e; | 513 | QKeyEvent *k = (QKeyEvent *)e; |
514 | if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) | 514 | if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) |
515 | { | 515 | { |
516 | slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0); | 516 | slotClicked( Qt::LeftButton,m_view->currentItem(),QPoint(0,0),0); |
517 | return true; | 517 | return true; |
518 | } | 518 | } |
519 | } | 519 | } |
520 | return false; | 520 | return false; |
521 | } | 521 | } |
522 | 522 | ||
523 | void OFileViewFileListView::connectSlots() | 523 | void OFileViewFileListView::connectSlots() |
524 | { | 524 | { |
525 | connect(m_view, SIGNAL(clicked(QListViewItem*) ), | 525 | connect(m_view, SIGNAL(clicked(QListViewItem*) ), |
526 | this, SLOT(slotCurrentChanged(QListViewItem*) ) ); | 526 | this, SLOT(slotCurrentChanged(QListViewItem*) ) ); |
527 | connect(m_view, SIGNAL(mouseButtonClicked(int, QListViewItem*, const QPoint&, int ) ), | 527 | connect(m_view, SIGNAL(mouseButtonClicked(int,QListViewItem*,const QPoint&,int) ), |
528 | this, SLOT(slotClicked(int, QListViewItem*, const QPoint&, int ) ) ); | 528 | this, SLOT(slotClicked(int,QListViewItem*,const QPoint&,int) ) ); |
529 | } | 529 | } |
530 | 530 | ||
531 | void OFileViewFileListView::slotCurrentChanged( QListViewItem* item) | 531 | void OFileViewFileListView::slotCurrentChanged( QListViewItem* item) |
532 | { | 532 | { |
533 | if (!item) | 533 | if (!item) |
534 | return; | 534 | return; |
535 | #if 0 | 535 | #if 0 |
536 | 536 | ||
537 | OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); | 537 | OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); |
538 | 538 | ||
539 | if (!sel->isDir() ) | 539 | if (!sel->isDir() ) |
540 | { | 540 | { |
541 | selector()->m_lneEdit->setText( sel->text(1) ); | 541 | selector()->m_lneEdit->setText( sel->text(1) ); |
542 | // if in fileselector mode we will emit selected | 542 | // if in fileselector mode we will emit selected |
543 | if ( selector()->mode() == OFileSelector::FileSelector ) | 543 | if ( selector()->mode() == OFileSelector::FileSelector ) |
544 | { | 544 | { |
545 | qWarning("slot Current Changed"); | 545 | qWarning("slot Current Changed"); |
546 | QStringList str = QStringList::split("->", sel->text(1) ); | 546 | QStringList str = QStringList::split("->", sel->text(1) ); |
547 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); | 547 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); |
548 | emit selector()->fileSelected( path ); | 548 | emit selector()->fileSelected( path ); |
549 | DocLnk lnk( path ); | 549 | DocLnk lnk( path ); |
550 | emit selector()->fileSelected( lnk ); | 550 | emit selector()->fileSelected( lnk ); |
551 | } | 551 | } |
552 | } | 552 | } |
553 | #endif | 553 | #endif |
554 | } | 554 | } |
555 | 555 | ||
556 | void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const QPoint&, int ) | 556 | void OFileViewFileListView::slotClicked(int button , QListViewItem* item, const QPoint&, int ) |
557 | { | 557 | { |
558 | if (!item || ( button != Qt::LeftButton) ) | 558 | if (!item || ( button != Qt::LeftButton) ) |
559 | return; | 559 | return; |
560 | 560 | ||
561 | OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); | 561 | OFileSelectorItem *sel = static_cast<OFileSelectorItem*>(item); |
562 | if (!sel->isLocked() ) | 562 | if (!sel->isLocked() ) |
563 | { | 563 | { |
564 | QStringList str = QStringList::split("->", sel->text(1) ); | 564 | QStringList str = QStringList::split("->", sel->text(1) ); |
565 | if (sel->isDir() ) | 565 | if (sel->isDir() ) |
566 | { | 566 | { |
567 | m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace(); | 567 | m_currentDir = sel->directory() + "/" + str[0].stripWhiteSpace(); |
568 | emit selector()->dirSelected( m_currentDir ); | 568 | emit selector()->dirSelected( m_currentDir ); |
569 | reread( m_all ); | 569 | reread( m_all ); |
570 | } | 570 | } |
571 | else | 571 | else |
572 | { // file | 572 | { // file |
573 | qWarning("slot Clicked"); | 573 | qWarning("slot Clicked"); |
574 | selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); | 574 | selector()->m_lneEdit->setText( str[0].stripWhiteSpace() ); |
575 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); | 575 | QString path = sel->directory() + "/" + str[0].stripWhiteSpace(); |
576 | emit selector()->fileSelected( path ); | 576 | emit selector()->fileSelected( path ); |
@@ -934,98 +934,98 @@ void OFileSelector::initUI() | |||
934 | m_cmbView = new QComboBox( m_cmbBox ); | 934 | m_cmbView = new QComboBox( m_cmbBox ); |
935 | m_cmbMime = new QComboBox( m_cmbBox ); | 935 | m_cmbMime = new QComboBox( m_cmbBox ); |
936 | lay->addWidget( m_cmbBox ); | 936 | lay->addWidget( m_cmbBox ); |
937 | } | 937 | } |
938 | 938 | ||
939 | /* | 939 | /* |
940 | * This will make sure that the return key in the name edit causes dialogs to close | 940 | * This will make sure that the return key in the name edit causes dialogs to close |
941 | */ | 941 | */ |
942 | 942 | ||
943 | bool OFileSelector::eventFilter (QObject *o, QEvent *e) | 943 | bool OFileSelector::eventFilter (QObject *o, QEvent *e) |
944 | { | 944 | { |
945 | if ( e->type() == QEvent::KeyPress ) | 945 | if ( e->type() == QEvent::KeyPress ) |
946 | { | 946 | { |
947 | QKeyEvent *k = (QKeyEvent *)e; | 947 | QKeyEvent *k = (QKeyEvent *)e; |
948 | if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) | 948 | if ( (k->key()==Key_Enter) || (k->key()==Key_Return)) |
949 | { | 949 | { |
950 | emit ok(); | 950 | emit ok(); |
951 | return true; | 951 | return true; |
952 | } | 952 | } |
953 | } | 953 | } |
954 | return false; | 954 | return false; |
955 | } | 955 | } |
956 | 956 | ||
957 | /* | 957 | /* |
958 | * This will insert the MimeTypes into the Combo Box | 958 | * This will insert the MimeTypes into the Combo Box |
959 | * And also connect the changed signal | 959 | * And also connect the changed signal |
960 | * | 960 | * |
961 | * AutoMimeTyping is disabled for now. It used to reparse a dir and then set available mimetypes | 961 | * AutoMimeTyping is disabled for now. It used to reparse a dir and then set available mimetypes |
962 | */ | 962 | */ |
963 | void OFileSelector::initMime() | 963 | void OFileSelector::initMime() |
964 | { | 964 | { |
965 | MimeTypes::Iterator it; | 965 | MimeTypes::Iterator it; |
966 | for ( it = m_mimeType.begin(); it != m_mimeType.end(); ++it ) | 966 | for ( it = m_mimeType.begin(); it != m_mimeType.end(); ++it ) |
967 | { | 967 | { |
968 | m_cmbMime->insertItem( it.key() ); | 968 | m_cmbMime->insertItem( it.key() ); |
969 | } | 969 | } |
970 | m_cmbMime->setCurrentItem( 0 ); | 970 | m_cmbMime->setCurrentItem( 0 ); |
971 | 971 | ||
972 | connect( m_cmbMime, SIGNAL(activated(int) ), | 972 | connect( m_cmbMime, SIGNAL(activated(int) ), |
973 | this, SLOT(slotMimeTypeChanged() ) ); | 973 | this, SLOT(slotMimeTypeChanged() ) ); |
974 | 974 | ||
975 | } | 975 | } |
976 | 976 | ||
977 | void OFileSelector::initViews() | 977 | void OFileSelector::initViews() |
978 | { | 978 | { |
979 | m_cmbView->insertItem( QObject::tr("Documents") ); | 979 | m_cmbView->insertItem( QObject::tr("Documents") ); |
980 | m_cmbView->insertItem( QObject::tr("Files") ); | 980 | m_cmbView->insertItem( QObject::tr("Files") ); |
981 | m_cmbView->insertItem( QObject::tr("All Files") ); | 981 | m_cmbView->insertItem( QObject::tr("All Files") ); |
982 | connect(m_cmbView, SIGNAL(activated( const QString& ) ), | 982 | connect(m_cmbView, SIGNAL(activated(const QString&) ), |
983 | this, SLOT(slotViewChange( const QString& ) ) ); | 983 | this, SLOT(slotViewChange(const QString&) ) ); |
984 | 984 | ||
985 | 985 | ||
986 | m_views.insert( QObject::tr("Documents"), new ODocumentFileView(this) ); | 986 | m_views.insert( QObject::tr("Documents"), new ODocumentFileView(this) ); |
987 | 987 | ||
988 | /* see above why add both */ | 988 | /* see above why add both */ |
989 | OFileViewInterface* in = new OFileViewFileSystem( this ); | 989 | OFileViewInterface* in = new OFileViewFileSystem( this ); |
990 | m_views.insert( QObject::tr("Files"), in ); | 990 | m_views.insert( QObject::tr("Files"), in ); |
991 | m_views.insert( QObject::tr("All Files"), in ); | 991 | m_views.insert( QObject::tr("All Files"), in ); |
992 | } | 992 | } |
993 | 993 | ||
994 | /** | 994 | /** |
995 | * d'tor | 995 | * d'tor |
996 | */ | 996 | */ |
997 | OFileSelector::~OFileSelector() | 997 | OFileSelector::~OFileSelector() |
998 | { | 998 | { |
999 | } | 999 | } |
1000 | 1000 | ||
1001 | 1001 | ||
1002 | 1002 | ||
1003 | /** | 1003 | /** |
1004 | * Convience function for the fileselector | 1004 | * Convience function for the fileselector |
1005 | * make sure to delete the DocLnk | 1005 | * make sure to delete the DocLnk |
1006 | * | 1006 | * |
1007 | * @see DocLnk | 1007 | * @see DocLnk |
1008 | * @todo remove in ODP | 1008 | * @todo remove in ODP |
1009 | */ | 1009 | */ |
1010 | const DocLnk* OFileSelector::selected() | 1010 | const DocLnk* OFileSelector::selected() |
1011 | { | 1011 | { |
1012 | DocLnk* lnk = new DocLnk( currentView()->selectedDocument() ); | 1012 | DocLnk* lnk = new DocLnk( currentView()->selectedDocument() ); |
1013 | return lnk; | 1013 | return lnk; |
1014 | } | 1014 | } |
1015 | 1015 | ||
1016 | /** | 1016 | /** |
1017 | * | 1017 | * |
1018 | * @return the name of the selected file | 1018 | * @return the name of the selected file |
1019 | */ | 1019 | */ |
1020 | QString OFileSelector::selectedName()const | 1020 | QString OFileSelector::selectedName()const |
1021 | { | 1021 | { |
1022 | return currentView()->selectedName(); | 1022 | return currentView()->selectedName(); |
1023 | } | 1023 | } |
1024 | 1024 | ||
1025 | 1025 | ||
1026 | /** | 1026 | /** |
1027 | * @return the selected path | 1027 | * @return the selected path |
1028 | */ | 1028 | */ |
1029 | QString OFileSelector::selectedPath()const | 1029 | QString OFileSelector::selectedPath()const |
1030 | { | 1030 | { |
1031 | return currentView()->selectedPath(); | 1031 | return currentView()->selectedPath(); |
diff --git a/libopie2/opieui/ofontselector.cpp b/libopie2/opieui/ofontselector.cpp index 49ddeb6..f93781f 100644 --- a/libopie2/opieui/ofontselector.cpp +++ b/libopie2/opieui/ofontselector.cpp | |||
@@ -87,111 +87,111 @@ public: | |||
87 | 87 | ||
88 | const QValueList<int> &sizes() const | 88 | const QValueList<int> &sizes() const |
89 | { | 89 | { |
90 | return m_sizes; | 90 | return m_sizes; |
91 | } | 91 | } |
92 | 92 | ||
93 | private: | 93 | private: |
94 | QStringList m_styles; | 94 | QStringList m_styles; |
95 | QValueList<int> m_sizes; | 95 | QValueList<int> m_sizes; |
96 | QString m_name; | 96 | QString m_name; |
97 | }; | 97 | }; |
98 | 98 | ||
99 | 99 | ||
100 | static int findItemCB( QComboBox *box, const QString &str ) | 100 | static int findItemCB( QComboBox *box, const QString &str ) |
101 | { | 101 | { |
102 | for ( int i = 0; i < box->count(); i++ ) | 102 | for ( int i = 0; i < box->count(); i++ ) |
103 | { | 103 | { |
104 | if ( box->text ( i ) == str ) | 104 | if ( box->text ( i ) == str ) |
105 | return i; | 105 | return i; |
106 | } | 106 | } |
107 | return -1; | 107 | return -1; |
108 | } | 108 | } |
109 | 109 | ||
110 | } | 110 | } |
111 | /* static same as anon. namespace */ | 111 | /* static same as anon. namespace */ |
112 | static int qt_version() | 112 | static int qt_version() |
113 | { | 113 | { |
114 | const char *qver = qVersion(); | 114 | const char *qver = qVersion(); |
115 | 115 | ||
116 | return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); | 116 | return ( qver [0] - '0' ) * 100 + ( qver [2] - '0' ) * 10 + ( qver [4] - '0' ); |
117 | } | 117 | } |
118 | 118 | ||
119 | /** | 119 | /** |
120 | * Constructs the Selector object | 120 | * Constructs the Selector object |
121 | * @param withpreview If a font preview should be given | 121 | * @param withpreview If a font preview should be given |
122 | * @param parent The parent of the Font Selector | 122 | * @param parent The parent of the Font Selector |
123 | * @param name The name of the object | 123 | * @param name The name of the object |
124 | * @param fl WidgetFlags | 124 | * @param fl WidgetFlags |
125 | */ | 125 | */ |
126 | OFontSelector::OFontSelector( bool withpreview, QWidget *parent, const char *name, WFlags fl ) : QWidget ( parent, name, fl ) | 126 | OFontSelector::OFontSelector( bool withpreview, QWidget *parent, const char *name, WFlags fl ) : QWidget ( parent, name, fl ) |
127 | { | 127 | { |
128 | d = new OFontSelectorPrivate(); | 128 | d = new OFontSelectorPrivate(); |
129 | 129 | ||
130 | QGridLayout *gridLayout = new QGridLayout( this, 0, 0, 4, 4 ); | 130 | QGridLayout *gridLayout = new QGridLayout( this, 0, 0, 4, 4 ); |
131 | gridLayout->setRowStretch( 4, 10 ); | 131 | gridLayout->setRowStretch( 4, 10 ); |
132 | 132 | ||
133 | d->m_font_family_list = new QListBox( this, "FontListBox" ); | 133 | d->m_font_family_list = new QListBox( this, "FontListBox" ); |
134 | gridLayout->addMultiCellWidget( d->m_font_family_list, 0, 4, 0, 0 ); | 134 | gridLayout->addMultiCellWidget( d->m_font_family_list, 0, 4, 0, 0 ); |
135 | connect( d->m_font_family_list, SIGNAL( highlighted( int ) ), this, SLOT( fontFamilyClicked( int ) ) ); | 135 | connect( d->m_font_family_list, SIGNAL( highlighted(int) ), this, SLOT( fontFamilyClicked(int) ) ); |
136 | 136 | ||
137 | QLabel *label = new QLabel( tr( "Style" ), this ); | 137 | QLabel *label = new QLabel( tr( "Style" ), this ); |
138 | gridLayout->addWidget( label, 0, 1 ); | 138 | gridLayout->addWidget( label, 0, 1 ); |
139 | 139 | ||
140 | d->m_font_style_list = new QComboBox( this, "StyleListBox" ); | 140 | d->m_font_style_list = new QComboBox( this, "StyleListBox" ); |
141 | connect( d->m_font_style_list, SIGNAL( activated( int ) ), this, SLOT( fontStyleClicked( int ) ) ); | 141 | connect( d->m_font_style_list, SIGNAL( activated(int) ), this, SLOT( fontStyleClicked(int) ) ); |
142 | gridLayout->addWidget( d->m_font_style_list, 1, 1 ); | 142 | gridLayout->addWidget( d->m_font_style_list, 1, 1 ); |
143 | 143 | ||
144 | label = new QLabel( tr( "Size" ), this ); | 144 | label = new QLabel( tr( "Size" ), this ); |
145 | gridLayout->addWidget( label, 2, 1 ); | 145 | gridLayout->addWidget( label, 2, 1 ); |
146 | 146 | ||
147 | d->m_font_size_list = new QComboBox( this, "SizeListBox" ); | 147 | d->m_font_size_list = new QComboBox( this, "SizeListBox" ); |
148 | connect( d->m_font_size_list, SIGNAL( activated( int ) ), | 148 | connect( d->m_font_size_list, SIGNAL( activated(int) ), |
149 | this, SLOT( fontSizeClicked( int ) ) ); | 149 | this, SLOT( fontSizeClicked(int) ) ); |
150 | gridLayout->addWidget( d->m_font_size_list, 3, 1 ); | 150 | gridLayout->addWidget( d->m_font_size_list, 3, 1 ); |
151 | 151 | ||
152 | d->m_pointbug = ( qt_version() <= 233 ); | 152 | d->m_pointbug = ( qt_version() <= 233 ); |
153 | 153 | ||
154 | if ( withpreview ) | 154 | if ( withpreview ) |
155 | { | 155 | { |
156 | d->m_preview = new QMultiLineEdit ( this, "Preview" ); | 156 | d->m_preview = new QMultiLineEdit ( this, "Preview" ); |
157 | d->m_preview->setAlignment ( AlignCenter ); | 157 | d->m_preview->setAlignment ( AlignCenter ); |
158 | d->m_preview->setWordWrap ( QMultiLineEdit::WidgetWidth ); | 158 | d->m_preview->setWordWrap ( QMultiLineEdit::WidgetWidth ); |
159 | d->m_preview->setMargin ( 3 ); | 159 | d->m_preview->setMargin ( 3 ); |
160 | d->m_preview->setText ( tr( "The Quick Brown Fox Jumps Over The Lazy Dog" )); | 160 | d->m_preview->setText ( tr( "The Quick Brown Fox Jumps Over The Lazy Dog" )); |
161 | gridLayout->addRowSpacing ( 5, 4 ); | 161 | gridLayout->addRowSpacing ( 5, 4 ); |
162 | gridLayout->addMultiCellWidget ( d->m_preview, 6, 6, 0, 1 ); | 162 | gridLayout->addMultiCellWidget ( d->m_preview, 6, 6, 0, 1 ); |
163 | gridLayout->setRowStretch ( 6, 5 ); | 163 | gridLayout->setRowStretch ( 6, 5 ); |
164 | } | 164 | } |
165 | else | 165 | else |
166 | d->m_preview = 0; | 166 | d->m_preview = 0; |
167 | 167 | ||
168 | loadFonts ( d->m_font_family_list ); | 168 | loadFonts ( d->m_font_family_list ); |
169 | } | 169 | } |
170 | 170 | ||
171 | OFontSelector::~OFontSelector() | 171 | OFontSelector::~OFontSelector() |
172 | { | 172 | { |
173 | delete d; | 173 | delete d; |
174 | } | 174 | } |
175 | 175 | ||
176 | /** | 176 | /** |
177 | * This methods tries to set the font | 177 | * This methods tries to set the font |
178 | * @param f The wishes font | 178 | * @param f The wishes font |
179 | * @return success or failure | 179 | * @return success or failure |
180 | */ | 180 | */ |
181 | bool OFontSelector::setSelectedFont ( const QFont &f ) | 181 | bool OFontSelector::setSelectedFont ( const QFont &f ) |
182 | { | 182 | { |
183 | return setSelectedFont ( f. family(), d->m_fdb. styleString ( f ), f. pointSize(), QFont::encodingName ( f. charSet())); | 183 | return setSelectedFont ( f. family(), d->m_fdb. styleString ( f ), f. pointSize(), QFont::encodingName ( f. charSet())); |
184 | } | 184 | } |
185 | 185 | ||
186 | 186 | ||
187 | /** | 187 | /** |
188 | * This is an overloaded method @see setSelectedFont | 188 | * This is an overloaded method @see setSelectedFont |
189 | * @param familyStr The family of the font | 189 | * @param familyStr The family of the font |
190 | * @param styleStr The style of the font | 190 | * @param styleStr The style of the font |
191 | * @param sizeVal The size of font | 191 | * @param sizeVal The size of font |
192 | * @param charset The charset to be used. Will be deprecated by QT3 | 192 | * @param charset The charset to be used. Will be deprecated by QT3 |
193 | */ | 193 | */ |
194 | bool OFontSelector::setSelectedFont( const QString &familyStr, const QString &styleStr, int sizeVal, const QString & charset ) | 194 | bool OFontSelector::setSelectedFont( const QString &familyStr, const QString &styleStr, int sizeVal, const QString & charset ) |
195 | { | 195 | { |
196 | QString sizeStr = QString::number ( sizeVal ); | 196 | QString sizeStr = QString::number ( sizeVal ); |
197 | 197 | ||
diff --git a/libopie2/opieui/otabwidget.cpp b/libopie2/opieui/otabwidget.cpp index ec6af9d..f47c90b 100644 --- a/libopie2/opieui/otabwidget.cpp +++ b/libopie2/opieui/otabwidget.cpp | |||
@@ -29,101 +29,101 @@ | |||
29 | 29 | ||
30 | */ | 30 | */ |
31 | 31 | ||
32 | #include <opie2/otabwidget.h> | 32 | #include <opie2/otabwidget.h> |
33 | 33 | ||
34 | /* OPIE */ | 34 | /* OPIE */ |
35 | #include <qpe/applnk.h> | 35 | #include <qpe/applnk.h> |
36 | #include <qpe/config.h> | 36 | #include <qpe/config.h> |
37 | #include <qpe/resource.h> | 37 | #include <qpe/resource.h> |
38 | #include <opie2/otabbar.h> | 38 | #include <opie2/otabbar.h> |
39 | 39 | ||
40 | /* QT */ | 40 | /* QT */ |
41 | #include <qcombobox.h> | 41 | #include <qcombobox.h> |
42 | #include <qwidgetstack.h> | 42 | #include <qwidgetstack.h> |
43 | 43 | ||
44 | using namespace Opie; | 44 | using namespace Opie; |
45 | 45 | ||
46 | OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) | 46 | OTabWidget::OTabWidget( QWidget *parent, const char *name, TabStyle s, TabPosition p ) |
47 | : QWidget( parent, name ) | 47 | : QWidget( parent, name ) |
48 | { | 48 | { |
49 | if ( s == Global ) | 49 | if ( s == Global ) |
50 | { | 50 | { |
51 | Config config( "qpe" ); | 51 | Config config( "qpe" ); |
52 | config.setGroup( "Appearance" ); | 52 | config.setGroup( "Appearance" ); |
53 | s = ( TabStyle ) config.readNumEntry( "TabStyle", (int) IconTab ); | 53 | s = ( TabStyle ) config.readNumEntry( "TabStyle", (int) IconTab ); |
54 | if ( s <= Global || s > IconList) | 54 | if ( s <= Global || s > IconList) |
55 | { | 55 | { |
56 | s = IconTab; | 56 | s = IconTab; |
57 | } | 57 | } |
58 | QString pos = config.readEntry( "TabPosition", "Top"); | 58 | QString pos = config.readEntry( "TabPosition", "Top"); |
59 | if ( pos == "Bottom" ) | 59 | if ( pos == "Bottom" ) |
60 | { | 60 | { |
61 | p = Bottom; | 61 | p = Bottom; |
62 | } | 62 | } |
63 | else | 63 | else |
64 | { | 64 | { |
65 | p = Top; | 65 | p = Top; |
66 | } | 66 | } |
67 | } | 67 | } |
68 | 68 | ||
69 | widgetStack = new QWidgetStack( this, "widgetstack" ); | 69 | widgetStack = new QWidgetStack( this, "widgetstack" ); |
70 | widgetStack->setFrameStyle( QFrame::NoFrame ); | 70 | widgetStack->setFrameStyle( QFrame::NoFrame ); |
71 | widgetStack->setLineWidth( style().defaultFrameWidth() ); | 71 | widgetStack->setLineWidth( style().defaultFrameWidth() ); |
72 | 72 | ||
73 | tabBarStack = new QWidgetStack( this, "tabbarstack" ); | 73 | tabBarStack = new QWidgetStack( this, "tabbarstack" ); |
74 | 74 | ||
75 | tabBar = new OTabBar( tabBarStack, "tabbar" ); | 75 | tabBar = new OTabBar( tabBarStack, "tabbar" ); |
76 | tabBarStack->addWidget( tabBar, 0 ); | 76 | tabBarStack->addWidget( tabBar, 0 ); |
77 | connect( tabBar, SIGNAL( selected( int ) ), this, SLOT( slotTabBarSelected( int ) ) ); | 77 | connect( tabBar, SIGNAL( selected(int) ), this, SLOT( slotTabBarSelected(int) ) ); |
78 | 78 | ||
79 | tabList = new QComboBox( false, tabBarStack, "tablist" ); | 79 | tabList = new QComboBox( false, tabBarStack, "tablist" ); |
80 | tabBarStack->addWidget( tabList, 1 ); | 80 | tabBarStack->addWidget( tabList, 1 ); |
81 | connect( tabList, SIGNAL( activated( int ) ), this, SLOT( slotTabListSelected( int ) ) ); | 81 | connect( tabList, SIGNAL( activated(int) ), this, SLOT( slotTabListSelected(int) ) ); |
82 | 82 | ||
83 | tabBarPosition = p; | 83 | tabBarPosition = p; |
84 | setTabStyle( s ); | 84 | setTabStyle( s ); |
85 | setTabPosition( p ); | 85 | setTabPosition( p ); |
86 | 86 | ||
87 | currTab= 0x0; | 87 | currTab= 0x0; |
88 | } | 88 | } |
89 | 89 | ||
90 | OTabWidget::~OTabWidget() | 90 | OTabWidget::~OTabWidget() |
91 | {} | 91 | {} |
92 | 92 | ||
93 | void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &label ) | 93 | void OTabWidget::addTab( QWidget *child, const QString &icon, const QString &label ) |
94 | { | 94 | { |
95 | QPixmap iconset = loadSmooth( icon ); | 95 | QPixmap iconset = loadSmooth( icon ); |
96 | 96 | ||
97 | QTab *tab = new QTab(); | 97 | QTab *tab = new QTab(); |
98 | if ( tabBarStyle == IconTab ) | 98 | if ( tabBarStyle == IconTab ) |
99 | { | 99 | { |
100 | tab->label = QString::null; | 100 | tab->label = QString::null; |
101 | } | 101 | } |
102 | else | 102 | else |
103 | { | 103 | { |
104 | tab->label = label; | 104 | tab->label = label; |
105 | } | 105 | } |
106 | if ( tabBarStyle == IconTab || tabBarStyle == IconList ) | 106 | if ( tabBarStyle == IconTab || tabBarStyle == IconList ) |
107 | { | 107 | { |
108 | tab->iconset = new QIconSet( iconset ); | 108 | tab->iconset = new QIconSet( iconset ); |
109 | } | 109 | } |
110 | int tabid = tabBar->addTab( tab ); | 110 | int tabid = tabBar->addTab( tab ); |
111 | 111 | ||
112 | if ( tabBarStyle == IconTab || tabBarStyle == IconList ) | 112 | if ( tabBarStyle == IconTab || tabBarStyle == IconList ) |
113 | { | 113 | { |
114 | tabList->insertItem( iconset, label, -1 ); | 114 | tabList->insertItem( iconset, label, -1 ); |
115 | } | 115 | } |
116 | else | 116 | else |
117 | { | 117 | { |
118 | tabList->insertItem( label ); | 118 | tabList->insertItem( label ); |
119 | } | 119 | } |
120 | 120 | ||
121 | widgetStack->addWidget( child, tabid ); | 121 | widgetStack->addWidget( child, tabid ); |
122 | widgetStack->raiseWidget( child ); | 122 | widgetStack->raiseWidget( child ); |
123 | widgetStack->setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); | 123 | widgetStack->setFrameStyle( QFrame::StyledPanel | QFrame::Raised ); |
124 | 124 | ||
125 | OTabInfo *tabinfo = new OTabInfo( tabid, child, icon, label ); | 125 | OTabInfo *tabinfo = new OTabInfo( tabid, child, icon, label ); |
126 | tabs.append( tabinfo ); | 126 | tabs.append( tabinfo ); |
127 | selectTab( tabinfo ); | 127 | selectTab( tabinfo ); |
128 | } | 128 | } |
129 | 129 | ||
diff --git a/libopie2/opieui/otimepicker.cpp b/libopie2/opieui/otimepicker.cpp index d4712a4..66f9ce0 100644 --- a/libopie2/opieui/otimepicker.cpp +++ b/libopie2/opieui/otimepicker.cpp | |||
@@ -176,102 +176,102 @@ void OTimePicker::setTime( int h, int m ) | |||
176 | * @param m minutes | 176 | * @param m minutes |
177 | */ | 177 | */ |
178 | void OTimePicker::setMinute(int m) | 178 | void OTimePicker::setMinute(int m) |
179 | { | 179 | { |
180 | 180 | ||
181 | QString minute; | 181 | QString minute; |
182 | minute.sprintf("%.2d",m); | 182 | minute.sprintf("%.2d",m); |
183 | 183 | ||
184 | QValueListIterator<OClickableLabel *> it; | 184 | QValueListIterator<OClickableLabel *> it; |
185 | for (it=minuteLst.begin(); it!=minuteLst.end(); it++) | 185 | for (it=minuteLst.begin(); it!=minuteLst.end(); it++) |
186 | { | 186 | { |
187 | if ((*it)->text() == minute) (*it)->setOn(true); | 187 | if ((*it)->text() == minute) (*it)->setOn(true); |
188 | else (*it)->setOn(false); | 188 | else (*it)->setOn(false); |
189 | } | 189 | } |
190 | 190 | ||
191 | tm.setHMS(tm.hour(),m,0); | 191 | tm.setHMS(tm.hour(),m,0); |
192 | } | 192 | } |
193 | 193 | ||
194 | /** | 194 | /** |
195 | * Method to set the hour | 195 | * Method to set the hour |
196 | */ | 196 | */ |
197 | void OTimePicker::setHour(int h) | 197 | void OTimePicker::setHour(int h) |
198 | { | 198 | { |
199 | 199 | ||
200 | QString hour; | 200 | QString hour; |
201 | hour.sprintf("%.2d",h); | 201 | hour.sprintf("%.2d",h); |
202 | 202 | ||
203 | QValueListIterator<OClickableLabel *> it; | 203 | QValueListIterator<OClickableLabel *> it; |
204 | for (it=hourLst.begin(); it!=hourLst.end(); it++) | 204 | for (it=hourLst.begin(); it!=hourLst.end(); it++) |
205 | { | 205 | { |
206 | if ((*it)->text() == hour) (*it)->setOn(true); | 206 | if ((*it)->text() == hour) (*it)->setOn(true); |
207 | else (*it)->setOn(false); | 207 | else (*it)->setOn(false); |
208 | } | 208 | } |
209 | tm.setHMS(h,tm.minute(),0); | 209 | tm.setHMS(h,tm.minute(),0); |
210 | } | 210 | } |
211 | 211 | ||
212 | 212 | ||
213 | /** | 213 | /** |
214 | * This is a modal Dialog. | 214 | * This is a modal Dialog. |
215 | * | 215 | * |
216 | * @param parent The parent widget | 216 | * @param parent The parent widget |
217 | * @param name The name of the object | 217 | * @param name The name of the object |
218 | * @param fl Possible window flags | 218 | * @param fl Possible window flags |
219 | */ | 219 | */ |
220 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) | 220 | OTimePickerDialog::OTimePickerDialog ( QWidget* parent, const char* name, WFlags fl ) |
221 | : OTimePickerDialogBase (parent , name, true , fl) | 221 | : OTimePickerDialogBase (parent , name, true , fl) |
222 | { | 222 | { |
223 | 223 | ||
224 | connect ( m_timePicker, SIGNAL( timeChanged( const QTime& ) ), | 224 | connect ( m_timePicker, SIGNAL( timeChanged(const QTime&) ), |
225 | this, SLOT( setTime ( const QTime& ) ) ); | 225 | this, SLOT( setTime(const QTime&) ) ); |
226 | connect ( minuteField, SIGNAL( textChanged ( const QString& ) ), | 226 | connect ( minuteField, SIGNAL( textChanged(const QString&) ), |
227 | this, SLOT ( setMinute ( const QString& ) ) ); | 227 | this, SLOT ( setMinute(const QString&) ) ); |
228 | connect ( hourField, SIGNAL( textChanged ( const QString& ) ), | 228 | connect ( hourField, SIGNAL( textChanged(const QString&) ), |
229 | this, SLOT ( setHour ( const QString& ) ) ); | 229 | this, SLOT ( setHour(const QString&) ) ); |
230 | 230 | ||
231 | } | 231 | } |
232 | 232 | ||
233 | /** | 233 | /** |
234 | * @return the time | 234 | * @return the time |
235 | */ | 235 | */ |
236 | QTime OTimePickerDialog::time()const | 236 | QTime OTimePickerDialog::time()const |
237 | { | 237 | { |
238 | return m_time; | 238 | return m_time; |
239 | } | 239 | } |
240 | 240 | ||
241 | /** | 241 | /** |
242 | * Set the time to time | 242 | * Set the time to time |
243 | * @param time The time to be set | 243 | * @param time The time to be set |
244 | */ | 244 | */ |
245 | void OTimePickerDialog::setTime( const QTime& time ) | 245 | void OTimePickerDialog::setTime( const QTime& time ) |
246 | { | 246 | { |
247 | m_time = time; | 247 | m_time = time; |
248 | 248 | ||
249 | m_timePicker->setHour ( time.hour() ); | 249 | m_timePicker->setHour ( time.hour() ); |
250 | m_timePicker->setMinute( time.minute() ); | 250 | m_timePicker->setMinute( time.minute() ); |
251 | 251 | ||
252 | // Set Textfields | 252 | // Set Textfields |
253 | if ( time.hour() < 10 ) | 253 | if ( time.hour() < 10 ) |
254 | hourField->setText( "0" + QString::number( time.hour() ) ); | 254 | hourField->setText( "0" + QString::number( time.hour() ) ); |
255 | else | 255 | else |
256 | hourField->setText( QString::number( time.hour() ) ); | 256 | hourField->setText( QString::number( time.hour() ) ); |
257 | 257 | ||
258 | if ( time.minute() < 10 ) | 258 | if ( time.minute() < 10 ) |
259 | minuteField->setText( "0" + QString::number( time.minute() ) ); | 259 | minuteField->setText( "0" + QString::number( time.minute() ) ); |
260 | else | 260 | else |
261 | minuteField->setText( QString::number( time.minute() ) ); | 261 | minuteField->setText( QString::number( time.minute() ) ); |
262 | 262 | ||
263 | } | 263 | } |
264 | 264 | ||
265 | /** | 265 | /** |
266 | * This method takes the current minute and tries to set hour | 266 | * This method takes the current minute and tries to set hour |
267 | * to hour. This succeeds if the resulting date is valid | 267 | * to hour. This succeeds if the resulting date is valid |
268 | * @param hour The hour as a string | 268 | * @param hour The hour as a string |
269 | */ | 269 | */ |
270 | void OTimePickerDialog::setHour ( const QString& hour ) | 270 | void OTimePickerDialog::setHour ( const QString& hour ) |
271 | { | 271 | { |
272 | if ( QTime::isValid ( hour.toInt(), m_time.minute() , 00 ) ) | 272 | if ( QTime::isValid ( hour.toInt(), m_time.minute() , 00 ) ) |
273 | { | 273 | { |
274 | m_time.setHMS ( hour.toInt(), m_time.minute() , 00 ); | 274 | m_time.setHMS ( hour.toInt(), m_time.minute() , 00 ); |
275 | setTime ( m_time ); | 275 | setTime ( m_time ); |
276 | } | 276 | } |
277 | 277 | ||
diff --git a/libopie2/opieui/oversatileview.cpp b/libopie2/opieui/oversatileview.cpp index 8839456..78154b7 100644 --- a/libopie2/opieui/oversatileview.cpp +++ b/libopie2/opieui/oversatileview.cpp | |||
@@ -125,142 +125,142 @@ OVersatileView::OVersatileView( QWidget* parent, const char* name, int mode ) | |||
125 | 125 | ||
126 | _listview = new OListView( this, "oversatileview embedded listview" ); | 126 | _listview = new OListView( this, "oversatileview embedded listview" ); |
127 | _iconview = new QIconView( this, "oversatileview embedded iconview" ); | 127 | _iconview = new QIconView( this, "oversatileview embedded iconview" ); |
128 | 128 | ||
129 | _listview->setAllColumnsShowFocus( true ); | 129 | _listview->setAllColumnsShowFocus( true ); |
130 | _listview->setRootIsDecorated( true ); | 130 | _listview->setRootIsDecorated( true ); |
131 | _listview->setShowSortIndicator( true ); | 131 | _listview->setShowSortIndicator( true ); |
132 | _iconview->setGridX( 90 ); | 132 | _iconview->setGridX( 90 ); |
133 | _iconview->setGridY( 42 ); | 133 | _iconview->setGridY( 42 ); |
134 | _iconview->setAutoArrange( true ); | 134 | _iconview->setAutoArrange( true ); |
135 | 135 | ||
136 | #ifdef QWS // TODO: Let this depend on current geometry (rotation) | 136 | #ifdef QWS // TODO: Let this depend on current geometry (rotation) |
137 | _iconview->setArrangement( QIconView::TopToBottom ); | 137 | _iconview->setArrangement( QIconView::TopToBottom ); |
138 | #else | 138 | #else |
139 | _iconview->setArrangement( QIconView::LeftToRight ); | 139 | _iconview->setArrangement( QIconView::LeftToRight ); |
140 | #endif | 140 | #endif |
141 | 141 | ||
142 | _iconview->setResizeMode( QIconView::Adjust ); | 142 | _iconview->setResizeMode( QIconView::Adjust ); |
143 | 143 | ||
144 | // qt-embedded: map stylus right on hold to right button press | 144 | // qt-embedded: map stylus right on hold to right button press |
145 | 145 | ||
146 | #ifdef QWS | 146 | #ifdef QWS |
147 | ( (QPEApplication*) qApp)->setStylusOperation( _iconview->viewport(), QPEApplication::RightOnHold ); | 147 | ( (QPEApplication*) qApp)->setStylusOperation( _iconview->viewport(), QPEApplication::RightOnHold ); |
148 | ( (QPEApplication*) qApp)->setStylusOperation( _listview->viewport(), QPEApplication::RightOnHold ); | 148 | ( (QPEApplication*) qApp)->setStylusOperation( _listview->viewport(), QPEApplication::RightOnHold ); |
149 | #endif | 149 | #endif |
150 | 150 | ||
151 | setViewMode( mode ); // TODO: Read last style from config | 151 | setViewMode( mode ); // TODO: Read last style from config |
152 | // setSynchronization( true ); // TODO: Implement this | 152 | // setSynchronization( true ); // TODO: Implement this |
153 | 153 | ||
154 | // create context menu allowing to switch between the views | 154 | // create context menu allowing to switch between the views |
155 | 155 | ||
156 | _contextmenu = new QPopupMenu( 0, "oversatileview contextmenu" ); | 156 | _contextmenu = new QPopupMenu( 0, "oversatileview contextmenu" ); |
157 | _contextmenu->setCaption( "Style" ); | 157 | _contextmenu->setCaption( "Style" ); |
158 | _contextmenu->setCheckable( true ); | 158 | _contextmenu->setCheckable( true ); |
159 | QActionGroup* ag = new QActionGroup( _contextmenu, "style option group" ); | 159 | QActionGroup* ag = new QActionGroup( _contextmenu, "style option group" ); |
160 | QAction* a1 = new QAction( "View Items in Icon Style", QIconSet( QPixmap( view_icon_xpm ) ), | 160 | QAction* a1 = new QAction( "View Items in Icon Style", QIconSet( QPixmap( view_icon_xpm ) ), |
161 | "View Icons", 0, ag, "viewicon action", true ); | 161 | "View Icons", 0, ag, "viewicon action", true ); |
162 | QAction* a2 = new QAction( "View Items in Tree Style", QIconSet( QPixmap( view_tree_xpm ) ), | 162 | QAction* a2 = new QAction( "View Items in Tree Style", QIconSet( QPixmap( view_tree_xpm ) ), |
163 | "View Tree", 0, ag, "viewtree action", true ); | 163 | "View Tree", 0, ag, "viewtree action", true ); |
164 | ag->addTo( _contextmenu ); | 164 | ag->addTo( _contextmenu ); |
165 | if ( mode == Icons ) | 165 | if ( mode == Icons ) |
166 | a1->setOn( true ); | 166 | a1->setOn( true ); |
167 | else if ( mode == Tree ) | 167 | else if ( mode == Tree ) |
168 | a2->setOn( true ); | 168 | a2->setOn( true ); |
169 | connect( a1, SIGNAL( activated() ), this, SLOT( setIconViewMode() ) ); | 169 | connect( a1, SIGNAL( activated() ), this, SLOT( setIconViewMode() ) ); |
170 | connect( a2, SIGNAL( activated() ), this, SLOT( setTreeViewMode() ) ); | 170 | connect( a2, SIGNAL( activated() ), this, SLOT( setTreeViewMode() ) ); |
171 | 171 | ||
172 | #if (QT_VERSION >= 0x030000) | 172 | #if (QT_VERSION >= 0x030000) |
173 | connect( _listview, SIGNAL( contextMenuRequested( QListViewItem*, const QPoint&, int ) ), this, SLOT( contextMenuRequested( QListViewItem*, const QPoint&, int ) ) ); | 173 | connect( _listview, SIGNAL( contextMenuRequested(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); |
174 | connect( _iconview, SIGNAL( contextMenuRequested( QIconViewItem*, const QPoint& ) ), this, SLOT( contextMenuRequested( QIconViewItem*, const QPoint& ) ) ); | 174 | connect( _iconview, SIGNAL( contextMenuRequested(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); |
175 | #else | 175 | #else |
176 | connect( _listview, SIGNAL( rightButtonPressed( QListViewItem*, const QPoint&, int ) ), this, SLOT( contextMenuRequested( QListViewItem*, const QPoint&, int ) ) ); | 176 | connect( _listview, SIGNAL( rightButtonPressed(QListViewItem*,const QPoint&,int) ), this, SLOT( contextMenuRequested(QListViewItem*,const QPoint&,int) ) ); |
177 | connect( _iconview, SIGNAL( rightButtonPressed( QIconViewItem*, const QPoint& ) ), this, SLOT( contextMenuRequested( QIconViewItem*, const QPoint& ) ) ); | 177 | connect( _iconview, SIGNAL( rightButtonPressed(QIconViewItem*,const QPoint&) ), this, SLOT( contextMenuRequested(QIconViewItem*,const QPoint&) ) ); |
178 | #endif | 178 | #endif |
179 | 179 | ||
180 | // | 180 | // |
181 | // signal forwarders | 181 | // signal forwarders |
182 | // | 182 | // |
183 | // unfortunately we can't short-circuit all the QListView and QIconView signals | 183 | // unfortunately we can't short-circuit all the QListView and QIconView signals |
184 | // to OVersatileView signals, because the signal/slot mechanism doesn't allow | 184 | // to OVersatileView signals, because the signal/slot mechanism doesn't allow |
185 | // type-conversion :-( | 185 | // type-conversion :-( |
186 | 186 | ||
187 | // common signals for listview | 187 | // common signals for listview |
188 | 188 | ||
189 | connect( _listview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); | 189 | connect( _listview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); |
190 | connect( _listview, SIGNAL( selectionChanged( QListViewItem * ) ), this, SLOT( selectionChanged( QListViewItem * ) ) ); | 190 | connect( _listview, SIGNAL( selectionChanged(QListViewItem*) ), this, SLOT( selectionChanged(QListViewItem*) ) ); |
191 | connect( _listview, SIGNAL( currentChanged( QListViewItem * ) ), this, SLOT( currentChanged( QListViewItem * ) ) ); | 191 | connect( _listview, SIGNAL( currentChanged(QListViewItem*) ), this, SLOT( currentChanged(QListViewItem*) ) ); |
192 | connect( _listview, SIGNAL( clicked( QListViewItem * ) ), this, SLOT( clicked( QListViewItem * ) ) ); | 192 | connect( _listview, SIGNAL( clicked(QListViewItem*) ), this, SLOT( clicked(QListViewItem*) ) ); |
193 | connect( _listview, SIGNAL( pressed( QListViewItem * ) ), this, SLOT( pressed( QListViewItem * ) ) ); | 193 | connect( _listview, SIGNAL( pressed(QListViewItem*) ), this, SLOT( pressed(QListViewItem*) ) ); |
194 | 194 | ||
195 | connect( _listview, SIGNAL( doubleClicked( QListViewItem * ) ), this, SLOT( doubleClicked( QListViewItem * ) ) ); | 195 | connect( _listview, SIGNAL( doubleClicked(QListViewItem*) ), this, SLOT( doubleClicked(QListViewItem*) ) ); |
196 | connect( _listview, SIGNAL( returnPressed( QListViewItem * ) ), this, SLOT( returnPressed( QListViewItem * ) ) ); | 196 | connect( _listview, SIGNAL( returnPressed(QListViewItem*) ), this, SLOT( returnPressed(QListViewItem*) ) ); |
197 | 197 | ||
198 | connect( _listview, SIGNAL( onItem( QListViewItem * ) ), this, SLOT( onItem( QListViewItem * ) ) ); | 198 | connect( _listview, SIGNAL( onItem(QListViewItem*) ), this, SLOT( onItem(QListViewItem*) ) ); |
199 | connect( _listview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); | 199 | connect( _listview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); |
200 | 200 | ||
201 | // common signals for iconview | 201 | // common signals for iconview |
202 | 202 | ||
203 | connect( _iconview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); | 203 | connect( _iconview, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); |
204 | connect( _iconview, SIGNAL( selectionChanged( QIconViewItem * ) ), this, SLOT( selectionChanged( QIconViewItem * ) ) ); | 204 | connect( _iconview, SIGNAL( selectionChanged(QIconViewItem*) ), this, SLOT( selectionChanged(QIconViewItem*) ) ); |
205 | connect( _iconview, SIGNAL( currentChanged( QIconViewItem * ) ), this, SLOT( currentChanged( QIconViewItem * ) ) ); | 205 | connect( _iconview, SIGNAL( currentChanged(QIconViewItem*) ), this, SLOT( currentChanged(QIconViewItem*) ) ); |
206 | connect( _iconview, SIGNAL( clicked( QIconViewItem * ) ), this, SLOT( clicked( QIconViewItem * ) ) ); | 206 | connect( _iconview, SIGNAL( clicked(QIconViewItem*) ), this, SLOT( clicked(QIconViewItem*) ) ); |
207 | connect( _iconview, SIGNAL( pressed( QIconViewItem * ) ), this, SLOT( pressed( QIconViewItem * ) ) ); | 207 | connect( _iconview, SIGNAL( pressed(QIconViewItem*) ), this, SLOT( pressed(QIconViewItem*) ) ); |
208 | 208 | ||
209 | connect( _iconview, SIGNAL( doubleClicked( QIconViewItem * ) ), this, SLOT( doubleClicked( QIconViewItem * ) ) ); | 209 | connect( _iconview, SIGNAL( doubleClicked(QIconViewItem*) ), this, SLOT( doubleClicked(QIconViewItem*) ) ); |
210 | connect( _iconview, SIGNAL( returnPressed( QIconViewItem * ) ), this, SLOT( returnPressed( QIconViewItem * ) ) ); | 210 | connect( _iconview, SIGNAL( returnPressed(QIconViewItem*) ), this, SLOT( returnPressed(QIconViewItem*) ) ); |
211 | 211 | ||
212 | connect( _iconview, SIGNAL( onItem( QIconViewItem * ) ), this, SLOT( onItem( QIconViewItem * ) ) ); | 212 | connect( _iconview, SIGNAL( onItem(QIconViewItem*) ), this, SLOT( onItem(QIconViewItem*) ) ); |
213 | connect( _iconview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); | 213 | connect( _iconview, SIGNAL( onViewport() ), this, SIGNAL( onViewport() ) ); |
214 | 214 | ||
215 | // listview only signals | 215 | // listview only signals |
216 | 216 | ||
217 | connect( _listview, SIGNAL( expanded( QListViewItem * ) ), this, SLOT( expanded( QListViewItem * ) ) ); | 217 | connect( _listview, SIGNAL( expanded(QListViewItem*) ), this, SLOT( expanded(QListViewItem*) ) ); |
218 | connect( _listview, SIGNAL( collapsed( QListViewItem * ) ), this, SLOT( collapsed( QListViewItem * ) ) ); | 218 | connect( _listview, SIGNAL( collapsed(QListViewItem*) ), this, SLOT( collapsed(QListViewItem*) ) ); |
219 | 219 | ||
220 | // iconview only signals | 220 | // iconview only signals |
221 | 221 | ||
222 | connect( _iconview, SIGNAL( moved() ), this, SIGNAL( moved() ) ); | 222 | connect( _iconview, SIGNAL( moved() ), this, SIGNAL( moved() ) ); |
223 | } | 223 | } |
224 | 224 | ||
225 | OVersatileView::~OVersatileView() | 225 | OVersatileView::~OVersatileView() |
226 | { | 226 | { |
227 | } | 227 | } |
228 | 228 | ||
229 | QPopupMenu* OVersatileView::contextMenu() const | 229 | QPopupMenu* OVersatileView::contextMenu() const |
230 | { | 230 | { |
231 | return _contextmenu; | 231 | return _contextmenu; |
232 | } | 232 | } |
233 | 233 | ||
234 | void OVersatileView::contextMenuRequested( QListViewItem* item, const QPoint& pos, int col ) | 234 | void OVersatileView::contextMenuRequested( QListViewItem* item, const QPoint& pos, int col ) |
235 | { | 235 | { |
236 | // can't use QObject::inherits here, because ListViewItems, beit Q, O or K, | 236 | // can't use QObject::inherits here, because ListViewItems, beit Q, O or K, |
237 | // do not inherit from QObject - assuming here the programmer is | 237 | // do not inherit from QObject - assuming here the programmer is |
238 | // disciplined enough to only add OVersatileViewItems to an OVersatileView | 238 | // disciplined enough to only add OVersatileViewItems to an OVersatileView |
239 | popupContextMenu( static_cast<OVersatileViewItem*>( item ), pos, col ); | 239 | popupContextMenu( static_cast<OVersatileViewItem*>( item ), pos, col ); |
240 | } | 240 | } |
241 | 241 | ||
242 | void OVersatileView::contextMenuRequested( QIconViewItem* item, const QPoint& pos ) | 242 | void OVersatileView::contextMenuRequested( QIconViewItem* item, const QPoint& pos ) |
243 | { | 243 | { |
244 | // see above | 244 | // see above |
245 | popupContextMenu( static_cast<OVersatileViewItem*>( item ), pos, -1 ); | 245 | popupContextMenu( static_cast<OVersatileViewItem*>( item ), pos, -1 ); |
246 | } | 246 | } |
247 | 247 | ||
248 | void OVersatileView::popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col ) | 248 | void OVersatileView::popupContextMenu( OVersatileViewItem* item, const QPoint& pos, int col ) |
249 | { | 249 | { |
250 | if ( !item ) | 250 | if ( !item ) |
251 | _contextmenu->exec( pos ); | 251 | _contextmenu->exec( pos ); |
252 | else | 252 | else |
253 | emit( contextMenuRequested( item, pos, col ) ); | 253 | emit( contextMenuRequested( item, pos, col ) ); |
254 | } | 254 | } |
255 | 255 | ||
256 | void OVersatileView::setSynchronization( bool sync ) | 256 | void OVersatileView::setSynchronization( bool sync ) |
257 | { | 257 | { |
258 | _synchronization = sync; | 258 | _synchronization = sync; |
259 | } | 259 | } |
260 | 260 | ||
261 | bool OVersatileView::synchronization() | 261 | bool OVersatileView::synchronization() |
262 | { | 262 | { |
263 | return _synchronization; | 263 | return _synchronization; |
264 | } | 264 | } |
265 | 265 | ||
266 | void OVersatileView::setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed ) | 266 | void OVersatileView::setDefaultPixmaps( int mode, QPixmap& leaf, QPixmap& opened, QPixmap& closed ) |