summaryrefslogtreecommitdiff
path: root/core/settings/launcher/tabdialog.cpp
Side-by-side diff
Diffstat (limited to 'core/settings/launcher/tabdialog.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/settings/launcher/tabdialog.cpp18
1 files changed, 13 insertions, 5 deletions
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
@@ -19,38 +19,43 @@
 :     =  ...= . :.=- You should have received a copy of the GNU
 -.   .:....=;==+<; General Public License along with this file;
  -_. . .   )=.  = see the file COPYING. If not, write to the
    --        :-=` Free Software Foundation, Inc.,
59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
#include "tabdialog.h"
/* OPIE */
-#include <qpe/resource.h>
+
#include <opie2/ofontselector.h>
#include <opie2/otabwidget.h>
#include <opie2/ocolorbutton.h>
#include <opie2/ofiledialog.h>
#include <opie2/odebug.h>
+/* QPE */
+#include <qpe/resource.h>
+#include <qpe/qpeapplication.h>
+
/* QT */
#include <qlayout.h>
#include <qvbox.h>
#include <qtabbar.h>
#include <qiconview.h>
#include <qapplication.h>
#include <qlabel.h>
+#include <qfileinfo.h>
#include <qradiobutton.h>
#include <qbuttongroup.h>
#include <qwhatsthis.h>
#include <qcheckbox.h>
using namespace Opie::Ui;
class SampleItem : public QIconViewItem {
public:
SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text )
{
m_large = pix;
@@ -405,38 +410,39 @@ QWidget *TabDialog::createIconTab ( QWidget *parent )
QRadioButton *rb;
rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" );
m_iconsize-> insert ( rb, TabConfig::List );
gridLayout-> addWidget( rb, 0, 1 );
rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" );
m_iconsize-> insert ( rb, TabConfig::Icon );
gridLayout-> addWidget( rb, 1, 1 );
connect ( m_iconsize, SIGNAL( clicked(int)), this, SLOT( iconSizeClicked(int)));
-// vertLayout-> addSpacing ( 8 );
-
-// gridLayout = new QGridLayout ( vertLayout );
gridLayout-> addRowSpacing ( 2, 8 );
label = new QLabel ( tr( "Color:" ), tab );
gridLayout-> addWidget ( label, 3, 0 );
m_iconcolor = new Opie::OColorButton ( tab, QColor ( m_tc. m_text_color ) );
connect ( m_iconcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( iconColorClicked(const QColor&)));
gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft );
vertLayout-> addStretch ( 10 );
+ if ( m_tc.m_last_directory == QString::null ) {
+ m_tc.m_last_directory = QPEApplication::documentDir();
+ }
+
return tab;
}
void TabDialog::iconSizeClicked ( int s )
{
m_sample-> setViewMode ((TabConfig::ViewMode) s );
}
void TabDialog::fontClicked ( const QFont &f )
{
m_sample-> setViewFont ( f );
@@ -471,26 +477,28 @@ void TabDialog::iconColorClicked ( const QColor &col )
}
void TabDialog::bgImageClicked ( )
{
// ### use OFileSelector here ###
// this is just a quick c&p from the old appearance app
MimeTypes types;
QStringList list;
list << "image/*";
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 );
}
}
void TabDialog::bgDefaultClicked ( )
{
m_bgimage = "launcher/opie-background";
bgTypeClicked ( TabConfig::Image );
}
void TabDialog::accept ( )