Skip to content

Commit

Permalink
save attr column width
Browse files Browse the repository at this point in the history
git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@5161 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
rblazek committed Apr 4, 2006
1 parent b0708e7 commit 4bcb313
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 1 deletion.
21 changes: 21 additions & 0 deletions src/plugins/grass/qgsgrassattributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,18 @@ int QgsGrassAttributes::addTab ( const QString & label )

resetButtons();

QSettings settings("QuantumGIS", "qgis");
QString path = "/GRASS/windows/attributes/columnWidth/";
for ( int i = 0; i < 2; i++ )
{
bool ok;
int cw = settings.readNumEntry( path+QString::number(i), 30, &ok);
if ( ok ) tb->setColumnWidth (i, cw );
}

connect ( tb->horizontalHeader(), SIGNAL(sizeChange(int,int,int)),
this, SLOT(columnSizeChanged(int,int,int)) );

return ( tabCats->count() - 1 );
}

Expand Down Expand Up @@ -366,3 +378,12 @@ void QgsGrassAttributes::resetButtons ( )
updateButton->setEnabled(true);
}
}

void QgsGrassAttributes::columnSizeChanged ( int section, int oldSize, int newSize )
{
QSettings settings("QuantumGIS", "qgis");
QString path = "/GRASS/windows/attributes/columnWidth/"
+ QString::number(section);
std::cerr << "path = " << path.ascii() << " newSize = " << newSize << std::endl;
settings.writeEntry( path, newSize);
}
3 changes: 3 additions & 0 deletions src/plugins/grass/qgsgrassattributes.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ public slots:
//! Called if tab is changed
void tabChanged ( QWidget *widget );

//! Column size changed
void columnSizeChanged ( int section, int oldSize, int newSize );

private:
//! Pointer to vector provider
QgsGrassProvider *mProvider;
Expand Down
2 changes: 1 addition & 1 deletion src/plugins/grass/qgsgrassedit.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,12 @@ class QCloseEvent;
class QgsRubberBand;
class QgsVertexMarker;
class QgsGrassEditLayer;
class QgsGrassAttributes;

class QgsGrassProvider;
#include "ui_qgsgrasseditbase.h"
#include <QMainWindow>
#include "qgsgrassselect.h"
#include "qgsgrassattributes.h"

typedef struct {
int field;
Expand Down

0 comments on commit 4bcb313

Please sign in to comment.