Dictionaries dialog: Show dictionaries number

This commit is contained in:
Abs62 2014-06-30 17:58:39 +04:00
parent d5b0826d21
commit 581d55d504
3 changed files with 18 additions and 100 deletions

View file

@ -89,13 +89,6 @@ OrderAndProps::OrderAndProps( QWidget * parent,
{
ui.setupUi( this );
// For now we don't support arrows, so remove them until we get to that
delete ui.moveActiveUp;
delete ui.moveActiveDown;
delete ui.moveToActive;
delete ui.moveToInactive;
Instances::Group order( dictionaryOrder, allDictionaries );
Instances::Group inactive( inactiveDictionaries, allDictionaries );
@ -125,6 +118,13 @@ OrderAndProps::OrderAndProps( QWidget * parent,
connect (ui.searchLine, SIGNAL( filterChanged( QString const & ) ),
this, SLOT( filterChanged( QString const &) ) );
connect( ui.dictionaryOrder->getModel(), SIGNAL( contentChanged() ),
this, SLOT( showDictNumbers() ) );
connect( ui.inactiveDictionaries->getModel(), SIGNAL( contentChanged() ),
this, SLOT( showDictNumbers() ) );
showDictNumbers();
}
Config::Group OrderAndProps::getCurrentDictionaryOrder() const
@ -279,3 +279,10 @@ void OrderAndProps::contextMenuRequested( const QPoint & pos )
emit showDictionaryHeadwords( QString::fromUtf8( dict->getId().c_str() ) );
}
}
void OrderAndProps::showDictNumbers()
{
ui.dictionariesNumber->setText( tr( "Dictionaries active: %1, inactive: %2" )
.arg( QString::number( ui.dictionaryOrder->getModel()->rowCount( QModelIndex() ) ) )
.arg( QString::number( ui.inactiveDictionaries->getModel()->rowCount( QModelIndex() ) ) ) );
}

View file

@ -29,6 +29,7 @@ private slots:
void filterChanged( QString const & filterText );
void dictListFocused();
void inactiveDictListFocused();
void showDictNumbers();
private:

View file

@ -23,51 +23,12 @@
<item row="3" column="0">
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="moveToActive">
<widget class="QLabel" name="dictionariesNumber">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::UpArrow</enum>
<string notr="true"/>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="moveToInactive">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::DownArrow</enum>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item row="0" column="0">
@ -81,54 +42,7 @@
<widget class="DictListWidget" name="dictionaryOrder"/>
</item>
<item row="2" column="1">
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<spacer name="verticalSpacer">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QToolButton" name="moveActiveUp">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::UpArrow</enum>
</property>
</widget>
</item>
<item>
<widget class="QToolButton" name="moveActiveDown">
<property name="text">
<string>...</string>
</property>
<property name="arrowType">
<enum>Qt::DownArrow</enum>
</property>
</widget>
</item>
<item>
<spacer name="verticalSpacer_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>20</width>
<height>40</height>
</size>
</property>
</spacer>
</item>
</layout>
<layout class="QVBoxLayout" name="verticalLayout_2"/>
</item>
<item row="5" column="0">
<widget class="DictListWidget" name="inactiveDictionaries"/>
@ -431,10 +345,6 @@
</customwidgets>
<tabstops>
<tabstop>dictionaryOrder</tabstop>
<tabstop>moveActiveUp</tabstop>
<tabstop>moveActiveDown</tabstop>
<tabstop>moveToActive</tabstop>
<tabstop>moveToInactive</tabstop>
<tabstop>inactiveDictionaries</tabstop>
<tabstop>dictionaryDescription</tabstop>
<tabstop>dictionaryFileList</tabstop>