[Marble-commits] KDE/kdeedu/marble/src/plugins/runner/monav
Dennis Nienhüser
earthwings at gentoo.org
Mon Nov 1 13:19:14 CET 2010
SVN commit 1191905 by nienhueser:
Use a third tab for managing maps instead of a toggle button in the configure tab.
M +14 -19 MonavConfigWidget.cpp
M +30 -11 MonavConfigWidget.ui
--- trunk/KDE/kdeedu/marble/src/plugins/runner/monav/MonavConfigWidget.cpp #1191904:1191905
@@ -97,8 +97,6 @@
QString m_transport;
- bool m_manageMapsModeEnabled;
-
MonavConfigWidgetPrivate( MonavConfigWidget* parent, MonavPlugin* plugin );
void parseNewStuff( const QByteArray &data );
@@ -199,7 +197,7 @@
MonavConfigWidgetPrivate::MonavConfigWidgetPrivate( MonavConfigWidget* parent, MonavPlugin* plugin ) :
m_parent( parent ), m_plugin( plugin ), m_networkAccessManager( 0 ),
m_currentReply( 0 ), m_unpackProcess( 0 ), m_filteredModel( new QSortFilterProxyModel( parent) ),
- m_mapsModel( 0 ), m_initialized( false ), m_manageMapsModeEnabled( false )
+ m_mapsModel( 0 ), m_initialized( false )
{
m_filteredModel->setFilterKeyColumn( 1 );
}
@@ -326,8 +324,9 @@
setupUi( this );
d->setBusy( false );
m_installedMapsListView->setModel( d->m_filteredModel );
+ m_configureMapsListView->setModel( d->m_mapsModel );
+
updateComboBoxes();
- setManageMapsModeEnabled( false );
connect( m_continentComboBox, SIGNAL( currentIndexChanged( int ) ),
this, SLOT( updateStates() ) );
@@ -337,8 +336,6 @@
this, SLOT( updateRegions() ) );
connect( m_installButton, SIGNAL( clicked() ), this, SLOT( downloadMap() ) );
connect( m_cancelButton, SIGNAL( clicked() ), this, SLOT( cancelOperation() ) );
- connect( m_manageMapsButton, SIGNAL( clicked( bool) ),
- this, SLOT( setManageMapsModeEnabled( bool ) ) );
connect( &d->m_removeMapSignalMapper, SIGNAL( mapped( int ) ),
this, SLOT( removeMap( int ) ) );
connect( &d->m_upgradeMapSignalMapper, SIGNAL( mapped( int ) ),
@@ -403,7 +400,6 @@
} else {
d->parseNewStuff( reply->readAll() );
updateComboBoxes();
- setManageMapsModeEnabled( false );
}
}
}
@@ -567,8 +563,16 @@
{
m_mapsModel = m_plugin->installedMapsModel();
m_filteredModel->setSourceModel( m_mapsModel );
- m_parent->setManageMapsModeEnabled( m_manageMapsModeEnabled );
+ m_parent->m_configureMapsListView->setModel( m_mapsModel );
+ m_parent->m_installedMapsListView->setColumnHidden( 1, true );
+ m_parent->m_configureMapsListView->setColumnHidden( 2, true );
+ m_parent->m_configureMapsListView->setColumnHidden( 3, true );
+ m_parent->m_configureMapsListView->setColumnHidden( 4, true );
+
+ m_parent->m_configureMapsListView->horizontalHeader()->setVisible( true );
+ m_parent->m_installedMapsListView->horizontalHeader()->setVisible( true );
+
updateTransportPreference();
updateInstalledMapsViewButtons();
}
@@ -614,7 +618,8 @@
d->m_filteredModel->setFilterFixedString( filter );
d->m_transport = filter;
}
- d->updateInstalledMapsViewButtons();
+
+ m_configureMapsListView->resizeColumnsToContents();
}
void MonavConfigWidget::removeMap( int index )
@@ -642,16 +647,6 @@
}
}
-void MonavConfigWidget::setManageMapsModeEnabled( bool enabled )
-{
- d->m_manageMapsModeEnabled = enabled;
- m_installedMapsListView->setColumnHidden( 1, enabled );
- m_installedMapsListView->setColumnHidden( 2, !enabled );
- m_installedMapsListView->setColumnHidden( 3, !enabled );
- m_installedMapsListView->setColumnHidden( 4, !enabled );
- m_installedMapsListView->resizeColumnsToContents();
-}
-
void MonavConfigWidgetPrivate::setBusy( bool busy, const QString &message ) const
{
if ( busy ) {
--- trunk/KDE/kdeedu/marble/src/plugins/runner/monav/MonavConfigWidget.ui #1191904:1191905
@@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
- <width>280</width>
+ <width>286</width>
<height>277</height>
</rect>
</property>
@@ -28,7 +28,7 @@
</property>
<widget class="QWidget" name="tab">
<attribute name="title">
- <string>Installed Maps</string>
+ <string>Configure</string>
</attribute>
<layout class="QGridLayout" name="gridLayout">
<item row="0" column="0">
@@ -50,17 +50,36 @@
</item>
</widget>
</item>
- <item row="0" column="2">
- <widget class="QPushButton" name="m_manageMapsButton">
- <property name="text">
- <string>Manage Maps</string>
+ <item row="1" column="0" colspan="3">
+ <widget class="QTableView" name="m_configureMapsListView">
+ <property name="horizontalScrollBarPolicy">
+ <enum>Qt::ScrollBarAlwaysOff</enum>
</property>
- <property name="checkable">
+ <property name="alternatingRowColors">
<bool>true</bool>
</property>
+ <attribute name="horizontalHeaderVisible">
+ <bool>true</bool>
+ </attribute>
+ <attribute name="horizontalHeaderStretchLastSection">
+ <bool>false</bool>
+ </attribute>
+ <attribute name="verticalHeaderVisible">
+ <bool>false</bool>
+ </attribute>
+ <attribute name="verticalHeaderStretchLastSection">
+ <bool>false</bool>
+ </attribute>
</widget>
</item>
- <item row="1" column="0" colspan="3">
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_3">
+ <attribute name="title">
+ <string>Manage Maps</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_5">
+ <item row="0" column="0">
<widget class="QTableView" name="m_installedMapsListView">
<property name="horizontalScrollBarPolicy">
<enum>Qt::ScrollBarAlwaysOff</enum>
@@ -69,7 +88,7 @@
<bool>true</bool>
</property>
<attribute name="horizontalHeaderVisible">
- <bool>true</bool>
+ <bool>false</bool>
</attribute>
<attribute name="horizontalHeaderStretchLastSection">
<bool>false</bool>
@@ -86,7 +105,7 @@
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
- <string>Get New Maps</string>
+ <string>Install New</string>
</attribute>
<layout class="QFormLayout" name="formLayout">
<property name="fieldGrowthPolicy">
@@ -178,7 +197,7 @@
<number>0</number>
</property>
<property name="value">
- <number>140915</number>
+ <number>140958</number>
</property>
<property name="format">
<string>%v/%m MB</string>
More information about the Marble-commits
mailing list