summaryrefslogtreecommitdiff
authorharlekin <harlekin>2004-06-19 10:18:25 (UTC)
committer harlekin <harlekin>2004-06-19 10:18:25 (UTC)
commite05195bbaf71fbfca033bef5855085772fa586eb (patch) (unidiff)
tree2e2aaf7a200ac7f4c2e4a8a76f62fb1ed2f5e590
parent48ec0fc077b7834c49c1af1b1279f943ef58de41 (diff)
downloadopie-e05195bbaf71fbfca033bef5855085772fa586eb.zip
opie-e05195bbaf71fbfca033bef5855085772fa586eb.tar.gz
opie-e05195bbaf71fbfca033bef5855085772fa586eb.tar.bz2
BUGFIX: 0001089 - remember Browse path when selecting a tab background image
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--core/settings/launcher/tabconfig.h13
-rw-r--r--core/settings/launcher/tabdialog.cpp18
-rw-r--r--core/settings/launcher/tabssettings.cpp6
3 files changed, 26 insertions, 11 deletions
diff --git a/core/settings/launcher/tabconfig.h b/core/settings/launcher/tabconfig.h
index 9086341..84ba073 100644
--- a/core/settings/launcher/tabconfig.h
+++ b/core/settings/launcher/tabconfig.h
@@ -16,5 +16,5 @@
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General 16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
17..}^=.=       =       ; Public License for more details. 17..}^=.=       =       ; Public License for more details.
18++=   -.     .`     .: 18++=   -.     .`     .:
19 :     =  ...= . :.=- You should have received a copy of the GNU 19 :     =  ...= . :.=- You should have received a copy of the GNU
20 -.   .:....=;==+<; General Public License along with this file; 20 -.   .:....=;==+<; General Public License along with this file;
@@ -29,5 +29,5 @@
29 29
30struct TabConfig { 30struct TabConfig {
31 enum ViewMode { 31 enum ViewMode {
32 Icon, 32 Icon,
33 List 33 List
@@ -41,4 +41,5 @@ struct TabConfig {
41 ViewMode m_view; 41 ViewMode m_view;
42 BackgroundType m_bg_type; 42 BackgroundType m_bg_type;
43 QString m_last_directory;
43 QString m_bg_image; 44 QString m_bg_image;
44 QString m_bg_color; 45 QString m_bg_color;
@@ -50,13 +51,13 @@ struct TabConfig {
50 bool m_font_italic; 51 bool m_font_italic;
51 bool m_changed; 52 bool m_changed;
52 53
53 bool operator == ( const TabConfig &tc ) 54 bool operator == ( const TabConfig &tc )
54 { 55 {
55 return ( m_view == tc. m_view ) && 56 return ( m_view == tc. m_view ) &&
56 ( m_bg_type == tc. m_bg_type ) && 57 ( m_bg_type == tc. m_bg_type ) &&
57 ( m_bg_image == tc. m_bg_image ) && 58 ( m_bg_image == tc. m_bg_image ) &&
58 ( m_bg_color == tc. m_bg_color ) && 59 ( m_bg_color == tc. m_bg_color ) &&
59 ( m_text_color == tc. m_text_color ) && 60 ( m_text_color == tc. m_text_color ) &&
60 ( m_font_use == tc. m_font_use ) && 61 ( m_font_use == tc. m_font_use ) &&
61 ( m_font_use ? ( 62 ( m_font_use ? (
62 ( m_font_family == tc. m_font_family ) && 63 ( m_font_family == tc. m_font_family ) &&
@@ -65,5 +66,5 @@ struct TabConfig {
65 ( m_font_italic == tc. m_font_italic ) 66 ( m_font_italic == tc. m_font_italic )
66 ) : true ); 67 ) : true );
67 68
68 } 69 }
69}; 70};
diff --git a/core/settings/launcher/tabdialog.cpp b/core/settings/launcher/tabdialog.cpp
index 546e229..cef92d9 100644
--- a/core/settings/launcher/tabdialog.cpp
+++ b/core/settings/launcher/tabdialog.cpp
@@ -29,5 +29,5 @@
29 29
30/* OPIE */ 30/* OPIE */
31#include <qpe/resource.h> 31
32#include <opie2/ofontselector.h> 32#include <opie2/ofontselector.h>
33#include <opie2/otabwidget.h> 33#include <opie2/otabwidget.h>
@@ -36,4 +36,8 @@
36#include <opie2/odebug.h> 36#include <opie2/odebug.h>
37 37
38/* QPE */
39#include <qpe/resource.h>
40#include <qpe/qpeapplication.h>
41
38/* QT */ 42/* QT */
39#include <qlayout.h> 43#include <qlayout.h>
@@ -43,4 +47,5 @@
43#include <qapplication.h> 47#include <qapplication.h>
44#include <qlabel.h> 48#include <qlabel.h>
49#include <qfileinfo.h>
45#include <qradiobutton.h> 50#include <qradiobutton.h>
46#include <qbuttongroup.h> 51#include <qbuttongroup.h>
@@ -415,7 +420,4 @@ QWidget *TabDialog::createIconTab ( QWidget *parent )
415 connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int))); 420 connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int)));
416 421
417// vertLayout-> addSpacing ( 8 );
418
419// gridLayout = new QGridLayout ( vertLayout );
420 gridLayout-> addRowSpacing ( 2, 8 ); 422 gridLayout-> addRowSpacing ( 2, 8 );
421 423
@@ -429,4 +431,8 @@ QWidget *TabDialog::createIconTab ( QWidget *parent )
429 vertLayout-> addStretch ( 10 ); 431 vertLayout-> addStretch ( 10 );
430 432
433 if ( m_tc.m_last_directory == QString::null ) {
434 m_tc.m_last_directory = QPEApplication::documentDir();
435 }
436
431 return tab; 437 return tab;
432} 438}
@@ -481,6 +487,8 @@ void TabDialog::bgImageClicked ( )
481 types. insert ( "Images", list ); 487 types. insert ( "Images", list );
482 488
483 QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); 489 QString file = OFileDialog::getOpenFileName ( 1, m_tc.m_last_directory, QString::null, types );
490
484 if ( !file. isEmpty ( )) { 491 if ( !file. isEmpty ( )) {
492 m_tc.m_last_directory = QFileInfo( file ).dirPath();
485 m_bgimage = DocLnk ( file ). file ( ); 493 m_bgimage = DocLnk ( file ). file ( );
486 bgTypeClicked ( TabConfig::Image ); 494 bgTypeClicked ( TabConfig::Image );
diff --git a/core/settings/launcher/tabssettings.cpp b/core/settings/launcher/tabssettings.cpp
index e5a7087..5ac625b 100644
--- a/core/settings/launcher/tabssettings.cpp
+++ b/core/settings/launcher/tabssettings.cpp
@@ -144,4 +144,5 @@ void TabsSettings::readTabSettings ( Config &cfg )
144 global_def. m_changed = false; 144 global_def. m_changed = false;
145 145
146 Config cfg2 = Config( "Launchersettings" );
146 147
147 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { 148 for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) {
@@ -149,4 +150,5 @@ void TabsSettings::readTabSettings ( Config &cfg )
149 150
150 cfg. setGroup ( grp. arg ( *it )); 151 cfg. setGroup ( grp. arg ( *it ));
152 cfg2. setGroup( grp. arg ( *it ));
151 153
152 QString view = cfg. readEntry ( "View" ); 154 QString view = cfg. readEntry ( "View" );
@@ -165,4 +167,5 @@ void TabsSettings::readTabSettings ( Config &cfg )
165 167
166 tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image ); 168 tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image );
169 tc. m_last_directory = cfg2.readEntry( "DefaultDir", "" );
167 tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color ); 170 tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color );
168 tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color ); 171 tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color );
@@ -201,4 +204,5 @@ void TabsSettings::accept ( )
201{ 204{
202 Config cfg ( "Launcher" ); 205 Config cfg ( "Launcher" );
206 Config cfg2 ( "Launchersettings" );
203 207
204 // Launcher Tab 208 // Launcher Tab
@@ -212,4 +216,5 @@ void TabsSettings::accept ( )
212 216
213 cfg. setGroup ( grp. arg ( *it )); 217 cfg. setGroup ( grp. arg ( *it ));
218 cfg2. setGroup ( grp. arg ( *it ));
214 switch ( tc. m_view ) { 219 switch ( tc. m_view ) {
215 case TabConfig::Icon: 220 case TabConfig::Icon:
@@ -227,4 +232,5 @@ void TabsSettings::accept ( )
227 cfg. writeEntry ( "BackgroundColor", tc. m_bg_color ); 232 cfg. writeEntry ( "BackgroundColor", tc. m_bg_color );
228 cfg. writeEntry ( "TextColor", tc. m_text_color ); 233 cfg. writeEntry ( "TextColor", tc. m_text_color );
234 cfg2. writeEntry ( "DefaultDir", tc.m_last_directory );
229 235
230 if ( tc. m_font_use ) { 236 if ( tc. m_font_use ) {