summaryrefslogtreecommitdiff
path: root/core/launcher/launcher.cpp
Unidiff
Diffstat (limited to 'core/launcher/launcher.cpp') (more/less context) (show whitespace changes)
-rw-r--r--core/launcher/launcher.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/core/launcher/launcher.cpp b/core/launcher/launcher.cpp
index 5ec1cf8..ccc2114 100644
--- a/core/launcher/launcher.cpp
+++ b/core/launcher/launcher.cpp
@@ -74,13 +74,13 @@
74 74
75 75
76static bool isVisibleWindow( int ); 76static bool isVisibleWindow( int );
77//=========================================================================== 77//===========================================================================
78 78
79LauncherTabWidget::LauncherTabWidget( Launcher* parent ) : 79LauncherTabWidget::LauncherTabWidget( Launcher* parent ) :
80 QVBox( parent ), docview( 0 ) 80 QVBox( parent ), docview( 0 ),docTabEnabled(true),m_DocumentTabId(0)
81{ 81{
82 docLoadingWidgetEnabled = false; 82 docLoadingWidgetEnabled = false;
83 docLoadingWidget = 0; 83 docLoadingWidget = 0;
84 docLoadingWidgetProgress = 0; 84 docLoadingWidgetProgress = 0;
85 launcher = parent; 85 launcher = parent;
86 categoryBar = new LauncherTabBar( this ); 86 categoryBar = new LauncherTabBar( this );
@@ -125,13 +125,13 @@ void LauncherTabWidget::createDocLoadingWidget()
125 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) ); 125 waitPixmap->setSizePolicy( QSizePolicy( (QSizePolicy::SizeType)5, (QSizePolicy::SizeType)5, waitPixmap->sizePolicy().hasHeightForWidth() ) );
126 waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) ); 126 waitPixmap->setPixmap( Resource::loadPixmap( "bigwait" ) );
127 waitPixmap->setAlignment( int( QLabel::AlignCenter ) ); 127 waitPixmap->setAlignment( int( QLabel::AlignCenter ) );
128 128
129 Config cfg( "Launcher" ); 129 Config cfg( "Launcher" );
130 cfg.setGroup( "DocTab" ); 130 cfg.setGroup( "DocTab" );
131 bool docTabEnabled = cfg.readBoolEntry( "Enable", true ); 131 docTabEnabled = cfg.readBoolEntry( "Enable", true );
132 132
133 QLabel *textLabel = new QLabel( docLoadingVBox ); 133 QLabel *textLabel = new QLabel( docLoadingVBox );
134 textLabel->setAlignment( int( QLabel::AlignCenter ) ); 134 textLabel->setAlignment( int( QLabel::AlignCenter ) );
135 docLoadingWidgetProgress = new QProgressBar( docLoadingVBox ); 135 docLoadingWidgetProgress = new QProgressBar( docLoadingVBox );
136 docLoadingWidgetProgress->setProgress( 0 ); 136 docLoadingWidgetProgress->setProgress( 0 );
137 docLoadingWidgetProgress->setCenterIndicator( TRUE ); 137 docLoadingWidgetProgress->setCenterIndicator( TRUE );
@@ -213,20 +213,23 @@ LauncherView* LauncherTabWidget::newView( const QString& id, const QPixmap& pm,
213 LauncherView* view = new LauncherView( stack ); 213 LauncherView* view = new LauncherView( stack );
214 connect( view, SIGNAL(clicked(const AppLnk*)), 214 connect( view, SIGNAL(clicked(const AppLnk*)),
215 this, SIGNAL(clicked(const AppLnk*))); 215 this, SIGNAL(clicked(const AppLnk*)));
216 connect( view, SIGNAL(rightPressed(AppLnk*)), 216 connect( view, SIGNAL(rightPressed(AppLnk*)),
217 this, SIGNAL(rightPressed(AppLnk*))); 217 this, SIGNAL(rightPressed(AppLnk*)));
218 218
219
219 int n = categoryBar->count(); 220 int n = categoryBar->count();
221
220 stack->addWidget( view, n ); 222 stack->addWidget( view, n );
221 223
222 LauncherTab *tab = new LauncherTab( id, view, pm, label ); 224 LauncherTab *tab = new LauncherTab( id, view, pm, label );
223 categoryBar->insertTab( tab, n-1 ); 225 categoryBar->insertTab( tab, n-1 );
224 226 if ( id == "Documents" ) {
225 if ( id == "Documents" )
226 docview = view; 227 docview = view;
228 m_DocumentTabId = n;
229 }
227 230
228 odebug << "inserting " << id << " at " << n-1 << "" << oendl; 231 odebug << "inserting " << id << " at " << n-1 << "" << oendl;
229 232
230 Config cfg("Launcher"); 233 Config cfg("Launcher");
231 setTabAppearance( tab, cfg ); 234 setTabAppearance( tab, cfg );
232 235
@@ -601,13 +604,12 @@ void Launcher::properties( AppLnk *appLnk )
601 // Not supported: flat is simpler for the user 604 // Not supported: flat is simpler for the user
602 } else { 605 } else {
603/* ### libqtopia FIXME also moving docLnks... */ 606/* ### libqtopia FIXME also moving docLnks... */
604 LnkProperties prop(appLnk,0 ); 607 LnkProperties prop(appLnk,0 );
605 608
606 if (QPEApplication::execDialog( &prop )==QDialog::Accepted && tabs->currentView()==tabs->docView()) { 609 if (QPEApplication::execDialog( &prop )==QDialog::Accepted && tabs->currentView()==tabs->docView()) {
607 tabs->docView()->updateTools();
608 } 610 }
609 } 611 }
610} 612}
611 613
612void Launcher::storageChanged( const QList<FileSystem> & ) 614void Launcher::storageChanged( const QList<FileSystem> & )
613{ 615{
@@ -718,14 +720,19 @@ void Launcher::documentRemoved( const DocLnk& doc )
718{ 720{
719 tabs->docView()->removeLink( doc.linkFile() ); 721 tabs->docView()->removeLink( doc.linkFile() );
720} 722}
721 723
722void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc ) 724void Launcher::documentChanged( const DocLnk& oldDoc, const DocLnk& newDoc )
723{ 725{
726#if 0
724 documentRemoved( oldDoc ); 727 documentRemoved( oldDoc );
725 documentAdded( newDoc ); 728 documentAdded( newDoc );
729// tabs->docView()->updateTools();
730#else
731 tabs->docView()->changeItem(oldDoc,new DocLnk(newDoc));
732#endif
726} 733}
727 734
728void Launcher::allDocumentsRemoved() 735void Launcher::allDocumentsRemoved()
729{ 736{
730 tabs->docView()->removeAllItems(); 737 tabs->docView()->removeAllItems();
731} 738}