summaryrefslogtreecommitdiff
path: root/core/settings/launcher/tabdialog.cpp
Unidiff
Diffstat (limited to 'core/settings/launcher/tabdialog.cpp') (more/less context) (ignore 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 @@
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;
21  -_. . .   )=.  = see the file COPYING. If not, write to the 21  -_. . .   )=.  = see the file COPYING. If not, write to the
22    --        :-=` Free Software Foundation, Inc., 22    --        :-=` Free Software Foundation, Inc.,
23 59 Temple Place - Suite 330, 23 59 Temple Place - Suite 330,
24 Boston, MA 02111-1307, USA. 24 Boston, MA 02111-1307, USA.
25 25
26*/ 26*/
27 27
28#include "tabdialog.h" 28#include "tabdialog.h"
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>
34#include <opie2/ocolorbutton.h> 34#include <opie2/ocolorbutton.h>
35#include <opie2/ofiledialog.h> 35#include <opie2/ofiledialog.h>
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>
40#include <qvbox.h> 44#include <qvbox.h>
41#include <qtabbar.h> 45#include <qtabbar.h>
42#include <qiconview.h> 46#include <qiconview.h>
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>
47#include <qwhatsthis.h> 52#include <qwhatsthis.h>
48#include <qcheckbox.h> 53#include <qcheckbox.h>
49 54
50 55
51using namespace Opie::Ui; 56using namespace Opie::Ui;
52class SampleItem : public QIconViewItem { 57class SampleItem : public QIconViewItem {
53public: 58public:
54 SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text ) 59 SampleItem ( QIconView *v, const QString &text, const QPixmap &pix ) : QIconViewItem ( v, text )
55 { 60 {
56 m_large = pix; 61 m_large = pix;
@@ -405,38 +410,39 @@ QWidget *TabDialog::createIconTab ( QWidget *parent )
405 410
406 QRadioButton *rb; 411 QRadioButton *rb;
407 rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" ); 412 rb = new QRadioButton( tr( "Small" ), tab, "iconsmall" );
408 m_iconsize-> insert ( rb, TabConfig::List ); 413 m_iconsize-> insert ( rb, TabConfig::List );
409 gridLayout-> addWidget( rb, 0, 1 ); 414 gridLayout-> addWidget( rb, 0, 1 );
410 415
411 rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" ); 416 rb = new QRadioButton( tr( "Large" ), tab, "iconlarge" );
412 m_iconsize-> insert ( rb, TabConfig::Icon ); 417 m_iconsize-> insert ( rb, TabConfig::Icon );
413 gridLayout-> addWidget( rb, 1, 1 ); 418 gridLayout-> addWidget( rb, 1, 1 );
414 419
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
422 label = new QLabel ( tr( "Color:" ), tab ); 424 label = new QLabel ( tr( "Color:" ), tab );
423 gridLayout-> addWidget ( label, 3, 0 ); 425 gridLayout-> addWidget ( label, 3, 0 );
424 426
425 m_iconcolor = new Opie::OColorButton ( tab, QColor ( m_tc. m_text_color ) ); 427 m_iconcolor = new Opie::OColorButton ( tab, QColor ( m_tc. m_text_color ) );
426 connect ( m_iconcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( iconColorClicked(const QColor&))); 428 connect ( m_iconcolor, SIGNAL( colorSelected(const QColor&)), this, SLOT( iconColorClicked(const QColor&)));
427 gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft ); 429 gridLayout-> addWidget ( m_iconcolor, 3, 1, AlignLeft );
428 430
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}
433 439
434 440
435void TabDialog::iconSizeClicked ( int s ) 441void TabDialog::iconSizeClicked ( int s )
436{ 442{
437 m_sample-> setViewMode ((TabConfig::ViewMode) s ); 443 m_sample-> setViewMode ((TabConfig::ViewMode) s );
438} 444}
439 445
440void TabDialog::fontClicked ( const QFont &f ) 446void TabDialog::fontClicked ( const QFont &f )
441{ 447{
442 m_sample-> setViewFont ( f ); 448 m_sample-> setViewFont ( f );
@@ -471,26 +477,28 @@ void TabDialog::iconColorClicked ( const QColor &col )
471} 477}
472 478
473void TabDialog::bgImageClicked ( ) 479void TabDialog::bgImageClicked ( )
474{ 480{
475 // ### use OFileSelector here ### 481 // ### use OFileSelector here ###
476 // this is just a quick c&p from the old appearance app 482 // this is just a quick c&p from the old appearance app
477 483
478 MimeTypes types; 484 MimeTypes types;
479 QStringList list; 485 QStringList list;
480 list << "image/*"; 486 list << "image/*";
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 );
487 } 495 }
488} 496}
489 497
490void TabDialog::bgDefaultClicked ( ) 498void TabDialog::bgDefaultClicked ( )
491{ 499{
492 m_bgimage = "launcher/opie-background"; 500 m_bgimage = "launcher/opie-background";
493 bgTypeClicked ( TabConfig::Image ); 501 bgTypeClicked ( TabConfig::Image );
494} 502}
495 503
496void TabDialog::accept ( ) 504void TabDialog::accept ( )