summaryrefslogtreecommitdiff
authorzecke <zecke>2002-04-18 15:12:39 (UTC)
committer zecke <zecke>2002-04-18 15:12:39 (UTC)
commit800b7e7721bdb154abc5d8bf71297087224d04f1 (patch) (unidiff)
tree973744c7c9ad9ab189c7f945afd554dcbd15f40e
parent3e39f0951c44769c00918faefffca77823eb2e8a (diff)
downloadopie-800b7e7721bdb154abc5d8bf71297087224d04f1.zip
opie-800b7e7721bdb154abc5d8bf71297087224d04f1.tar.gz
opie-800b7e7721bdb154abc5d8bf71297087224d04f1.tar.bz2
Harlekin does this fix the problems?
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/launcher/launcher.cpp8
-rw-r--r--core/launcher/mediummountgui.cpp12
2 files changed, 8 insertions, 12 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 979eee6..d1df4cc 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -27,141 +27,141 @@
27#include <qpe/qcopenvelope_qws.h> 27#include <qpe/qcopenvelope_qws.h>
28#include <qpe/resource.h> 28#include <qpe/resource.h>
29#include <qpe/applnk.h> 29#include <qpe/applnk.h>
30#include <qpe/config.h> 30#include <qpe/config.h>
31#include <qpe/global.h> 31#include <qpe/global.h>
32#include <qpe/qpeapplication.h> 32#include <qpe/qpeapplication.h>
33#include <qpe/mimetype.h> 33#include <qpe/mimetype.h>
34#include <qpe/storage.h> 34#include <qpe/storage.h>
35#include <qpe/palmtoprecord.h> 35#include <qpe/palmtoprecord.h>
36 36
37#include <qdatetime.h> 37#include <qdatetime.h>
38#include <qdir.h> 38#include <qdir.h>
39#include <qwindowsystem_qws.h> 39#include <qwindowsystem_qws.h>
40#include <qtimer.h> 40#include <qtimer.h>
41#include <qcombobox.h> 41#include <qcombobox.h>
42#include <qvbox.h> 42#include <qvbox.h>
43#include <qlayout.h> 43#include <qlayout.h>
44#include <qstyle.h> 44#include <qstyle.h>
45#include <qpushbutton.h> 45#include <qpushbutton.h>
46#include <qtabbar.h> 46#include <qtabbar.h>
47#include <qwidgetstack.h> 47#include <qwidgetstack.h>
48#include <qlayout.h> 48#include <qlayout.h>
49#include <qregexp.h> 49#include <qregexp.h>
50#include <qmessagebox.h> 50#include <qmessagebox.h>
51#include <qframe.h> 51#include <qframe.h>
52#include <qpainter.h> 52#include <qpainter.h>
53#include <qlabel.h> 53#include <qlabel.h>
54#include <qtextstream.h> 54#include <qtextstream.h>
55 55
56#include "launcherview.h" 56#include "launcherview.h"
57#include "launcher.h" 57#include "launcher.h"
58#include "syncdialog.h" 58#include "syncdialog.h"
59#include "desktop.h" 59#include "desktop.h"
60#include <qpe/lnkproperties.h> 60#include <qpe/lnkproperties.h>
61#include "mrulist.h" 61#include "mrulist.h"
62#include "qrsync.h" 62#include "qrsync.h"
63#include <stdlib.h> 63#include <stdlib.h>
64#include <unistd.h> 64#include <unistd.h>
65 65
66#if defined(_OS_LINUX_) || defined(Q_OS_LINUX) 66#if defined(_OS_LINUX_) || defined(Q_OS_LINUX)
67#include <stdio.h> 67#include <stdio.h>
68#include <sys/vfs.h> 68#include <sys/vfs.h>
69#include <mntent.h> 69#include <mntent.h>
70#endif 70#endif
71 71
72#include <qpe/storage.h> 72#include <qpe/storage.h>
73#include "mediummountgui.h" 73#include "mediummountgui.h"
74//#define SHOW_ALL 74//#define SHOW_ALL
75 75
76// uidGen 76// uidGen
77 77
78// uidGen 78// uidGen
79namespace { 79namespace {
80 QStringList configToMime( Config *cfg ){ 80 QStringList configToMime( Config *cfg ){
81 QStringList mimes; 81 QStringList mimes;
82 bool tmpMime; 82 bool tmpMime;
83 cfg->setGroup("mimetypes" ); 83 cfg->setGroup("mimetypes" );
84 tmpMime = cfg->readBoolEntry("all" ,false); 84 tmpMime = cfg->readBoolEntry("all" ,false);
85 if( tmpMime ){ 85 if( tmpMime ){
86 mimes << QString::null; 86 mimes << QString::null;
87 return mimes; 87 return mimes;
88 }else{ 88 }else{
89 tmpMime = cfg->readBoolEntry("audio", true ); 89 tmpMime = cfg->readBoolEntry("audio", true );
90 if(tmpMime ) 90 if(tmpMime )
91 mimes.append("audio//*" ); 91 mimes.append("audio/*" );
92 92
93 tmpMime = cfg->readBoolEntry("image", true ); 93 tmpMime = cfg->readBoolEntry("image", true );
94 if(tmpMime ) 94 if(tmpMime )
95 mimes.append("image//*" ); 95 mimes.append("image/*" );
96 96
97 tmpMime = cfg->readBoolEntry("text", true ); 97 tmpMime = cfg->readBoolEntry("text", true );
98 if(tmpMime ) 98 if(tmpMime )
99 mimes.append("text//*"); 99 mimes.append("text/*");
100 100
101 tmpMime = cfg->readBoolEntry("video", true ); 101 tmpMime = cfg->readBoolEntry("video", true );
102 if(tmpMime ) 102 if(tmpMime )
103 mimes.append("video//*" ); 103 mimes.append("video/*" );
104 } 104 }
105 return mimes; 105 return mimes;
106 } 106 }
107 107
108} 108}
109 109
110 110
111CategoryTabWidget::CategoryTabWidget( QWidget* parent ) : 111CategoryTabWidget::CategoryTabWidget( QWidget* parent ) :
112 QVBox( parent ) 112 QVBox( parent )
113{ 113{
114 categoryBar = 0; 114 categoryBar = 0;
115 stack = 0; 115 stack = 0;
116} 116}
117 117
118void CategoryTabWidget::prevTab() 118void CategoryTabWidget::prevTab()
119{ 119{
120 if ( categoryBar ) { 120 if ( categoryBar ) {
121 int n = categoryBar->count(); 121 int n = categoryBar->count();
122 int tab = categoryBar->currentTab(); 122 int tab = categoryBar->currentTab();
123 if ( tab >= 0 ) 123 if ( tab >= 0 )
124 categoryBar->setCurrentTab( (tab - 1 + n)%n ); 124 categoryBar->setCurrentTab( (tab - 1 + n)%n );
125 } 125 }
126} 126}
127 127
128void CategoryTabWidget::nextTab() 128void CategoryTabWidget::nextTab()
129{ 129{
130 if ( categoryBar ) { 130 if ( categoryBar ) {
131 int n = categoryBar->count(); 131 int n = categoryBar->count();
132 int tab = categoryBar->currentTab(); 132 int tab = categoryBar->currentTab();
133 categoryBar->setCurrentTab( (tab + 1)%n ); 133 categoryBar->setCurrentTab( (tab + 1)%n );
134 } 134 }
135} 135}
136 136
137void CategoryTabWidget::addItem( const QString& linkfile ) 137void CategoryTabWidget::addItem( const QString& linkfile )
138{ 138{
139 int i=0; 139 int i=0;
140 AppLnk *app = new AppLnk(linkfile); 140 AppLnk *app = new AppLnk(linkfile);
141 if ( !app->isValid() ) { 141 if ( !app->isValid() ) {
142 delete app; 142 delete app;
143 return; 143 return;
144 } 144 }
145 if ( !app->file().isEmpty() ) { 145 if ( !app->file().isEmpty() ) {
146 // A document 146 // A document
147 delete app; 147 delete app;
148 app = new DocLnk(linkfile); 148 app = new DocLnk(linkfile);
149 ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app); 149 ((LauncherView*)(stack->widget(ids.count()-1)))->addItem(app);
150 return; 150 return;
151 } 151 }
152 for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) { 152 for ( QStringList::Iterator it=ids.begin(); it!=ids.end(); ++it) {
153 if ( !(*it).isEmpty() ) { 153 if ( !(*it).isEmpty() ) {
154 QRegExp tf(*it,FALSE,TRUE); 154 QRegExp tf(*it,FALSE,TRUE);
155 if ( tf.match(app->type()) >= 0 ) { 155 if ( tf.match(app->type()) >= 0 ) {
156 ((LauncherView*)stack->widget(i))->addItem(app); 156 ((LauncherView*)stack->widget(i))->addItem(app);
157 return; 157 return;
158 } 158 }
159 i++; 159 i++;
160 } 160 }
161 } 161 }
162} 162}
163 163
164void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder, 164void CategoryTabWidget::initializeCategories(AppLnkSet* rootFolder,
165 AppLnkSet* docFolder, const QList<FileSystem> &fs) 165 AppLnkSet* docFolder, const QList<FileSystem> &fs)
166{ 166{
167 delete categoryBar; 167 delete categoryBar;
diff --git a/core/launcher/mediummountgui.cpp b/core/launcher/mediummountgui.cpp
index f0de85b..e0acf4e 100644
--- a/core/launcher/mediummountgui.cpp
+++ b/core/launcher/mediummountgui.cpp
@@ -25,142 +25,138 @@ MediumMountGui::MediumMountGui( const QString &path ,QWidget* parent, const cha
25 25
26 26
27 QWidget *d = QApplication::desktop(); 27 QWidget *d = QApplication::desktop();
28 int w=d->width(); 28 int w=d->width();
29 int h=d->height(); 29 int h=d->height();
30 resize( w , h ); 30 resize( w , h );
31 setCaption( tr( "Medium inserted" ) ); 31 setCaption( tr( "Medium inserted" ) );
32 32
33 mediumPath = path; 33 mediumPath = path;
34 readConfig(); 34 readConfig();
35 startGui(); 35 startGui();
36} 36}
37 37
38void MediumMountGui::readConfig(){ 38void MediumMountGui::readConfig(){
39 39
40 OConfig cfg (mediumPath +"/.opiestorage.cf"); 40 OConfig cfg (mediumPath +"/.opiestorage.cf");
41 cfg.setGroup("main"); 41 cfg.setGroup("main");
42 checkagain = cfg.readBoolEntry("check", false); 42 checkagain = cfg.readBoolEntry("check", false);
43 43
44 cfg.setGroup("mimetypes"); 44 cfg.setGroup("mimetypes");
45 checkmimeaudio = cfg.readBoolEntry("audio", true); 45 checkmimeaudio = cfg.readBoolEntry("audio", true);
46 checkmimeimage = cfg.readBoolEntry("image", true); 46 checkmimeimage = cfg.readBoolEntry("image", true);
47 checkmimetext = cfg.readBoolEntry("text", true); 47 checkmimetext = cfg.readBoolEntry("text", true);
48 checkmimevideo = cfg.readBoolEntry("video", true); 48 checkmimevideo = cfg.readBoolEntry("video", true);
49 checkmimeall = cfg.readBoolEntry("all", true); 49 checkmimeall = cfg.readBoolEntry("all", true);
50 50
51 cfg.setGroup("dirs"); 51 cfg.setGroup("dirs");
52 limittodirs = cfg.readEntry("dirs", ""); 52 limittodirs = cfg.readEntry("dirs", "");
53} 53}
54 54
55bool MediumMountGui::check() { 55bool MediumMountGui::check() {
56 return !checkagain; 56 return !checkagain;
57} 57}
58 58
59QStringList MediumMountGui::dirs() { 59QStringList MediumMountGui::dirs() {
60 QStringList list = QStringList::split(",", limittodirs ); 60 QStringList list = QStringList::split(",", limittodirs );
61 return list; 61 return list;
62} 62}
63 63
64void MediumMountGui::writeConfig(bool autocheck) { 64void MediumMountGui::writeConfig(bool autocheck) {
65 65
66 OConfig cfg (mediumPath +"/.opiestorage.cf"); 66 OConfig cfg (mediumPath +"/.opiestorage.cf");
67 cfg.setGroup("main"); 67 cfg.setGroup("main");
68 cfg.writeEntry("check", AskBox->isChecked() ); 68 cfg.writeEntry("check", AskBox->isChecked() );
69 cfg.writeEntry("autocheck", autocheck ); 69 cfg.writeEntry("autocheck", autocheck );
70 70
71 cfg.setGroup("mimetypes"); 71 cfg.setGroup("mimetypes");
72 72
73 cfg.writeEntry("audio", CheckBoxAudio->isChecked() ); 73 cfg.writeEntry("audio", CheckBoxAudio->isChecked() );
74 cfg.writeEntry("image",CheckBoxImage->isChecked() ); 74 cfg.writeEntry("image",CheckBoxImage->isChecked() );
75 cfg.writeEntry("text",CheckBoxImage->isChecked() ); 75 cfg.writeEntry("text",CheckBoxImage->isChecked() );
76 cfg.writeEntry("video",CheckBoxVideo->isChecked() ); 76 cfg.writeEntry("video",CheckBoxVideo->isChecked() );
77 cfg.writeEntry("all",CheckBoxAll->isChecked() ); 77 cfg.writeEntry("all",CheckBoxAll->isChecked() );
78 78
79 cfg.setGroup("dirs"); 79 cfg.setGroup("dirs");
80 cfg.writeEntry("dirs", ""); 80 cfg.writeEntry("dirs", "");
81 81
82 82
83 // if all is checked then add only "QString::null" to the list. 83 // if all is checked then add only "QString::null" to the list.
84 if (checkmimeall) { 84 if (checkmimeall) {
85 mimeTypeList.clear(); 85 mimeTypeList.clear();
86 mimeTypeList += QString::null; 86 mimeTypeList += QString::null;
87 } else { 87 } else {
88 if (checkmimeaudio) { 88 if (checkmimeaudio) {
89 mimeTypeList += ("audio//*"); 89 mimeTypeList += ("audio/*");
90 } 90 }
91 if (checkmimetext) { 91 if (checkmimetext) {
92 mimeTypeList += ("text//*"); 92 mimeTypeList += ("text/*");
93 } 93 }
94 if (checkmimevideo) { 94 if (checkmimevideo) {
95 mimeTypeList += ("video//*"); 95 mimeTypeList += ("video/*");
96 } 96 }
97 if (checkmimeimage) { 97 if (checkmimeimage) {
98 mimeTypeList += ("image//*"); 98 mimeTypeList += ("image/*");
99 }
100 if (checkmimeall) {
101 mimeTypeList.clear();
102 mimeTypeList << QString::null;
103 } 99 }
104 } 100 }
105 cfg.write(); // not really needed here but just to be sure 101 cfg.write(); // not really needed here but just to be sure
106} 102}
107 103
108void MediumMountGui::startGui() { 104void MediumMountGui::startGui() {
109 105
110 QPixmap image = Resource::loadPixmap( "HelpBrowser"); 106 QPixmap image = Resource::loadPixmap( "HelpBrowser");
111 107
112 Text_2 = new QLabel( this ); 108 Text_2 = new QLabel( this );
113 Text_2->setGeometry( QRect( 10, 15, 40, 40 ) ); 109 Text_2->setGeometry( QRect( 10, 15, 40, 40 ) );
114 Text_2->setPixmap( image ); 110 Text_2->setPixmap( image );
115 111
116 Text = new QLabel( this, "Text" ); 112 Text = new QLabel( this, "Text" );
117 Text->setGeometry( QRect( 55, 11, this->width()-50, 50 ) ); 113 Text->setGeometry( QRect( 55, 11, this->width()-50, 50 ) );
118 Text->setText( tr( "A <b>storage medium</b> was inserted. Should it be scanned for media files?" ) ); 114 Text->setText( tr( "A <b>storage medium</b> was inserted. Should it be scanned for media files?" ) );
119 115
120 // media box 116 // media box
121 GroupBox1 = new QGroupBox( this, "GroupBox1" ); 117 GroupBox1 = new QGroupBox( this, "GroupBox1" );
122 GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 80 ) ); 118 GroupBox1->setGeometry( QRect( 10, 80, (this->width())-25, 80 ) );
123 GroupBox1->setTitle( tr( "Which media files" ) ); 119 GroupBox1->setTitle( tr( "Which media files" ) );
124 120
125 CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" ); 121 CheckBoxAudio = new QCheckBox( GroupBox1, "CheckBoxAudio" );
126 CheckBoxAudio->setGeometry( QRect( 10, 15, (GroupBox1->width()/2)-15 , 15 ) ); 122 CheckBoxAudio->setGeometry( QRect( 10, 15, (GroupBox1->width()/2)-15 , 15 ) );
127 CheckBoxAudio->setText( tr( "Audio" ) ); 123 CheckBoxAudio->setText( tr( "Audio" ) );
128 124
129 CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" ); 125 CheckBoxImage = new QCheckBox( GroupBox1, "CheckBoxImage" );
130 CheckBoxImage->setGeometry( QRect( 10, 35,(GroupBox1->width()/2)-15, 15 ) ); 126 CheckBoxImage->setGeometry( QRect( 10, 35,(GroupBox1->width()/2)-15, 15 ) );
131 CheckBoxImage->setText( tr( "Image" ) ); 127 CheckBoxImage->setText( tr( "Image" ) );
132 128
133 CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" ); 129 CheckBoxText = new QCheckBox( GroupBox1, "CheckBoxText" );
134 CheckBoxText->setGeometry( QRect((GroupBox1->width()/2) , 15, (GroupBox1->width()/2)-15, 15 ) ); 130 CheckBoxText->setGeometry( QRect((GroupBox1->width()/2) , 15, (GroupBox1->width()/2)-15, 15 ) );
135 CheckBoxText->setText( tr( "Text" ) ); 131 CheckBoxText->setText( tr( "Text" ) );
136 132
137 CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" ); 133 CheckBoxVideo = new QCheckBox( GroupBox1, "CheckBoxVideo" );
138 CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) ); 134 CheckBoxVideo->setGeometry( QRect( (GroupBox1->width()/2), 35, (GroupBox1->width()/2)-15, 15 ) );
139 CheckBoxVideo->setText( tr( "Video" ) ); 135 CheckBoxVideo->setText( tr( "Video" ) );
140 136
141 CheckBoxAll = new QCheckBox ( GroupBox1); 137 CheckBoxAll = new QCheckBox ( GroupBox1);
142 CheckBoxAll->setGeometry( QRect( 10, 55, (GroupBox1->width()/2)-15, 15 ) ); 138 CheckBoxAll->setGeometry( QRect( 10, 55, (GroupBox1->width()/2)-15, 15 ) );
143 CheckBoxAll->setText( tr( "All" ) ); 139 CheckBoxAll->setText( tr( "All" ) );
144 QObject::connect( (QObject*)CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers()) ); 140 QObject::connect( (QObject*)CheckBoxAll, SIGNAL( clicked() ), this, SLOT( deactivateOthers()) );
145 141
146 142
147 143
148 CheckBoxLink = new QCheckBox ( GroupBox1); 144 CheckBoxLink = new QCheckBox ( GroupBox1);
149 CheckBoxLink->setGeometry( QRect( (GroupBox1->width()/2), 55, (GroupBox1->width()/2)-15, 15 ) ); 145 CheckBoxLink->setGeometry( QRect( (GroupBox1->width()/2), 55, (GroupBox1->width()/2)-15, 15 ) );
150 CheckBoxLink->setText( tr( "Link apps" ) ); 146 CheckBoxLink->setText( tr( "Link apps" ) );
151 // as long as the feature is not supported 147 // as long as the feature is not supported
152 CheckBoxLink->setEnabled(false); 148 CheckBoxLink->setEnabled(false);
153 149
154 150
155 // select dirs 151 // select dirs
156 152
157 DirSelectText = new QLabel( this, "DirSelectText" ); 153 DirSelectText = new QLabel( this, "DirSelectText" );
158 DirSelectText->setGeometry( QRect( 10, 160,this->width() , 20 ) ); 154 DirSelectText->setGeometry( QRect( 10, 160,this->width() , 20 ) );
159 DirSelectText->setText( tr( "Limit search to dir: (not used yet)" ) ); 155 DirSelectText->setText( tr( "Limit search to dir: (not used yet)" ) );
160 156
161 LineEdit1 = new QLineEdit( this ); 157 LineEdit1 = new QLineEdit( this );
162 LineEdit1->setGeometry( QRect( 10, 180, (this->width())-60, 20 ) ); 158 LineEdit1->setGeometry( QRect( 10, 180, (this->width())-60, 20 ) );
163 159
164 PushButton3 = new QPushButton( this ); 160 PushButton3 = new QPushButton( this );
165 PushButton3->setGeometry( QRect( (this->width())-40, 180, 30, 20 ) ); 161 PushButton3->setGeometry( QRect( (this->width())-40, 180, 30, 20 ) );
166 PushButton3->setText( tr( "Add" ) ); 162 PushButton3->setText( tr( "Add" ) );