Skip to content

Commit 4bcb313

Browse files
author
rblazek
committed
save attr column width
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5161 c8812cc2-4d05-0410-92ff-de0c093fc19c
1 parent b0708e7 commit 4bcb313

File tree

3 files changed

+25
-1
lines changed

3 files changed

+25
-1
lines changed

src/plugins/grass/qgsgrassattributes.cpp

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,18 @@ int QgsGrassAttributes::addTab ( const QString & label )
176176

177177
resetButtons();
178178

179+
QSettings settings("QuantumGIS", "qgis");
180+
QString path = "/GRASS/windows/attributes/columnWidth/";
181+
for ( int i = 0; i < 2; i++ )
182+
{
183+
bool ok;
184+
int cw = settings.readNumEntry( path+QString::number(i), 30, &ok);
185+
if ( ok ) tb->setColumnWidth (i, cw );
186+
}
187+
188+
connect ( tb->horizontalHeader(), SIGNAL(sizeChange(int,int,int)),
189+
this, SLOT(columnSizeChanged(int,int,int)) );
190+
179191
return ( tabCats->count() - 1 );
180192
}
181193

@@ -366,3 +378,12 @@ void QgsGrassAttributes::resetButtons ( )
366378
updateButton->setEnabled(true);
367379
}
368380
}
381+
382+
void QgsGrassAttributes::columnSizeChanged ( int section, int oldSize, int newSize )
383+
{
384+
QSettings settings("QuantumGIS", "qgis");
385+
QString path = "/GRASS/windows/attributes/columnWidth/"
386+
+ QString::number(section);
387+
std::cerr << "path = " << path.ascii() << " newSize = " << newSize << std::endl;
388+
settings.writeEntry( path, newSize);
389+
}

src/plugins/grass/qgsgrassattributes.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,9 @@ public slots:
9999
//! Called if tab is changed
100100
void tabChanged ( QWidget *widget );
101101

102+
//! Column size changed
103+
void columnSizeChanged ( int section, int oldSize, int newSize );
104+
102105
private:
103106
//! Pointer to vector provider
104107
QgsGrassProvider *mProvider;

src/plugins/grass/qgsgrassedit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,12 +38,12 @@ class QCloseEvent;
3838
class QgsRubberBand;
3939
class QgsVertexMarker;
4040
class QgsGrassEditLayer;
41+
class QgsGrassAttributes;
4142

4243
class QgsGrassProvider;
4344
#include "ui_qgsgrasseditbase.h"
4445
#include <QMainWindow>
4546
#include "qgsgrassselect.h"
46-
#include "qgsgrassattributes.h"
4747

4848
typedef struct {
4949
int field;

0 commit comments

Comments
 (0)