From: Karai C. <ck...@us...> - 2006-05-18 10:01:25
|
Update of /cvsroot/krusader/krusader_kde3/krusader/Panel In directory sc8-pr-cvs11.sourceforge.net:/tmp/cvs-serv27217/krusader_kde3/krusader/Panel Modified Files: listpanel.cpp panelpopup.cpp panelpopup.h Log Message: FIXED: [ 1144729 ] Krusader doesn't remember popup panel splitter position Index: listpanel.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Panel/listpanel.cpp,v retrieving revision 1.160 retrieving revision 1.161 diff -C2 -d -r1.160 -r1.161 *** listpanel.cpp 18 Mar 2006 15:30:16 -0000 1.160 --- listpanel.cpp 18 May 2006 10:01:19 -0000 1.161 *************** *** 84,87 **** --- 84,88 ---- #include "../Dialogs/krspecialwidgets.h" #include "../GUI/kcmdline.h" + #include "../Dialogs/percentalsplitter.h" #include "krdetailedview.h" #ifdef TESTING_BRIEF_VIEW *************** *** 258,262 **** // create a splitter to hold the view and the popup ! QSplitter *splt = new QSplitter(this); splt->setChildrenCollapsible(true); splt->setOrientation(QObject::Vertical); --- 259,263 ---- // create a splitter to hold the view and the popup ! QSplitter *splt = new PercentalSplitter(this); splt->setChildrenCollapsible(true); splt->setOrientation(QObject::Vertical); Index: panelpopup.h =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Panel/panelpopup.h,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** panelpopup.h 6 Jan 2005 21:30:46 -0000 1.10 --- panelpopup.h 18 May 2006 10:01:19 -0000 1.11 *************** *** 5,8 **** --- 5,9 ---- #include <qwidgetstack.h> #include <qpixmap.h> + #include <qvaluelist.h> #include <kfileitem.h> #include <qguardedptr.h> *************** *** 13,16 **** --- 14,18 ---- class QLabel; class QListViewItem; + class QSplitter; class KFileTreeView; class QToolButton; *************** *** 26,33 **** enum Parts { Tree, Preview, QuickPanel, View, DskUsage, Last=0xFF }; public: ! PanelPopup( QWidget *parent, bool left ); ~PanelPopup(); inline int currentPage() const { return stack->id(stack->visibleWidget()); } public slots: void update(KURL url); --- 28,37 ---- enum Parts { Tree, Preview, QuickPanel, View, DskUsage, Last=0xFF }; public: ! PanelPopup( QSplitter *splitter, bool left ); ~PanelPopup(); inline int currentPage() const { return stack->id(stack->visibleWidget()); } + void saveSizes(); + public slots: void update(KURL url); *************** *** 49,53 **** protected: ! QWidgetStack *stack; KImageFilePreview *viewer; KrSqueezedTextLabel *dataLine; --- 53,59 ---- protected: ! bool _left; ! bool _hidden; ! QWidgetStack *stack; KImageFilePreview *viewer; KrSqueezedTextLabel *dataLine; *************** *** 60,63 **** --- 66,71 ---- PanelViewer *panelviewer; DiskUsageViewer *diskusage; + QValueList<int> splitterSizes; + QSplitter *splitter; }; Index: panelpopup.cpp =================================================================== RCS file: /cvsroot/krusader/krusader_kde3/krusader/Panel/panelpopup.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** panelpopup.cpp 14 Feb 2006 14:36:32 -0000 1.25 --- panelpopup.cpp 18 May 2006 10:01:19 -0000 1.26 *************** *** 23,29 **** #include "../KViewer/diskusageviewer.h" ! PanelPopup::PanelPopup( QWidget *parent, bool left ) : QWidget( parent ), ! stack( 0 ), viewer( 0 ), pjob( 0 ) { ! QGridLayout * layout = new QGridLayout(this, 1, 1); // create the label+buttons setup --- 23,43 ---- #include "../KViewer/diskusageviewer.h" ! PanelPopup::PanelPopup( QSplitter *parent, bool left ) : QWidget( parent ), ! _left( left ), _hidden(true), stack( 0 ), viewer( 0 ), pjob( 0 ), splitterSizes() { ! splitter = parent; ! QGridLayout * layout = new QGridLayout(this, 1, 1); ! ! // loading the splitter sizes ! krConfig->setGroup( "Private" ); ! if( left ) ! splitterSizes = krConfig->readIntListEntry( "Left PanelPopup Splitter Sizes" ); ! else ! splitterSizes = krConfig->readIntListEntry( "Right PanelPopup Splitter Sizes" ); ! ! if( splitterSizes.count() < 2 ) { ! splitterSizes.clear(); ! splitterSizes.push_back( 100 ); ! splitterSizes.push_back( 100 ); ! } // create the label+buttons setup *************** *** 200,203 **** --- 214,220 ---- void PanelPopup::show() { QWidget::show(); + if( _hidden ) + splitter->setSizes( splitterSizes ); + _hidden = false; tabSelected( stack->id(stack->visibleWidget()) ); } *************** *** 205,213 **** --- 222,245 ---- void PanelPopup::hide() { + if( !_hidden ) + splitterSizes = splitter->sizes(); QWidget::hide(); + _hidden = true; if (stack->id(stack->visibleWidget()) == View) panelviewer->closeURL(); if (stack->id(stack->visibleWidget()) == DskUsage) diskusage->closeURL(); } + void PanelPopup::saveSizes() { + krConfig->setGroup( "Private" ); + + if( !isHidden() ) + splitterSizes = splitter->sizes(); + + if( _left ) + krConfig->writeEntry( "Left PanelPopup Splitter Sizes", splitterSizes ); + else + krConfig->writeEntry( "Right PanelPopup Splitter Sizes", splitterSizes ); + } + void PanelPopup::handleOpenURLRequest(const KURL &url) { if (KMimeType::findByURL(url.url())->name() == "inode/directory") ACTIVE_PANEL->func->openUrl(url); |