author | harlekin <harlekin> | 2004-06-19 10:18:25 (UTC) |
---|---|---|
committer | harlekin <harlekin> | 2004-06-19 10:18:25 (UTC) |
commit | e05195bbaf71fbfca033bef5855085772fa586eb (patch) (side-by-side diff) | |
tree | 2e2aaf7a200ac7f4c2e4a8a76f62fb1ed2f5e590 /core | |
parent | 48ec0fc077b7834c49c1af1b1279f943ef58de41 (diff) | |
download | opie-e05195bbaf71fbfca033bef5855085772fa586eb.zip opie-e05195bbaf71fbfca033bef5855085772fa586eb.tar.gz opie-e05195bbaf71fbfca033bef5855085772fa586eb.tar.bz2 |
BUGFIX: 0001089 - remember Browse path when selecting a tab background image
-rw-r--r-- | core/settings/launcher/tabconfig.h | 1 | ||||
-rw-r--r-- | core/settings/launcher/tabdialog.cpp | 18 | ||||
-rw-r--r-- | core/settings/launcher/tabssettings.cpp | 6 |
3 files changed, 20 insertions, 5 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 @@ -41,4 +41,5 @@ struct TabConfig { ViewMode m_view; BackgroundType m_bg_type; + QString m_last_directory; QString m_bg_image; QString m_bg_color; 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 @@ /* OPIE */ -#include <qpe/resource.h> + #include <opie2/ofontselector.h> #include <opie2/otabwidget.h> @@ -36,4 +36,8 @@ #include <opie2/odebug.h> +/* QPE */ +#include <qpe/resource.h> +#include <qpe/qpeapplication.h> + /* QT */ #include <qlayout.h> @@ -43,4 +47,5 @@ #include <qapplication.h> #include <qlabel.h> +#include <qfileinfo.h> #include <qradiobutton.h> #include <qbuttongroup.h> @@ -415,7 +420,4 @@ QWidget *TabDialog::createIconTab ( QWidget *parent ) connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int))); -// vertLayout-> addSpacing ( 8 ); - -// gridLayout = new QGridLayout ( vertLayout ); gridLayout-> addRowSpacing ( 2, 8 ); @@ -429,4 +431,8 @@ QWidget *TabDialog::createIconTab ( QWidget *parent ) vertLayout-> addStretch ( 10 ); + if ( m_tc.m_last_directory == QString::null ) { + m_tc.m_last_directory = QPEApplication::documentDir(); + } + return tab; } @@ -481,6 +487,8 @@ void TabDialog::bgImageClicked ( ) types. insert ( "Images", list ); - QString file = OFileDialog::getOpenFileName ( 1, "/", QString::null, types ); + QString file = OFileDialog::getOpenFileName ( 1, m_tc.m_last_directory, QString::null, types ); + if ( !file. isEmpty ( )) { + m_tc.m_last_directory = QFileInfo( file ).dirPath(); m_bgimage = DocLnk ( file ). file ( ); 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 ) global_def. m_changed = false; + Config cfg2 = Config( "Launchersettings" ); for ( QStringList::Iterator it = m_ids. begin ( ); it != m_ids. end ( ); ++it ) { @@ -149,4 +150,5 @@ void TabsSettings::readTabSettings ( Config &cfg ) cfg. setGroup ( grp. arg ( *it )); + cfg2. setGroup( grp. arg ( *it )); QString view = cfg. readEntry ( "View" ); @@ -165,4 +167,5 @@ void TabsSettings::readTabSettings ( Config &cfg ) tc. m_bg_image = cfg. readEntry ( "BackgroundImage", tc. m_bg_image ); + tc. m_last_directory = cfg2.readEntry( "DefaultDir", "" ); tc. m_bg_color = cfg. readEntry ( "BackgroundColor", tc. m_bg_color ); tc. m_text_color = cfg. readEntry ( "TextColor", tc. m_text_color ); @@ -201,4 +204,5 @@ void TabsSettings::accept ( ) { Config cfg ( "Launcher" ); + Config cfg2 ( "Launchersettings" ); // Launcher Tab @@ -212,4 +216,5 @@ void TabsSettings::accept ( ) cfg. setGroup ( grp. arg ( *it )); + cfg2. setGroup ( grp. arg ( *it )); switch ( tc. m_view ) { case TabConfig::Icon: @@ -227,4 +232,5 @@ void TabsSettings::accept ( ) cfg. writeEntry ( "BackgroundColor", tc. m_bg_color ); cfg. writeEntry ( "TextColor", tc. m_text_color ); + cfg2. writeEntry ( "DefaultDir", tc.m_last_directory ); if ( tc. m_font_use ) { |