summaryrefslogtreecommitdiff
Side-by-side diff
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 @@
  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU General
..}^=.=       =       ; Public License for more details.
-++=   -.     .`     .:
+++=   -.     .`     .:
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
@@ -29,5 +29,5 @@
struct TabConfig {
- enum ViewMode {
+ enum ViewMode {
Icon,
List
@@ -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;
@@ -50,13 +51,13 @@ struct TabConfig {
bool m_font_italic;
bool m_changed;
-
+
bool operator == ( const TabConfig &tc )
{
- return ( m_view == tc. m_view ) &&
+ return ( m_view == tc. m_view ) &&
( m_bg_type == tc. m_bg_type ) &&
( m_bg_image == tc. m_bg_image ) &&
( m_bg_color == tc. m_bg_color ) &&
( m_text_color == tc. m_text_color ) &&
- ( m_font_use == tc. m_font_use ) &&
+ ( m_font_use == tc. m_font_use ) &&
( m_font_use ? (
( m_font_family == tc. m_font_family ) &&
@@ -65,5 +66,5 @@ struct TabConfig {
( m_font_italic == tc. m_font_italic )
) : true );
-
+
}
};
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 ) {