Merge branch 'master' of github.com:Sankore/Sankore-3.1

preferencesAboutTextFull
Claudio Valerio 13 years ago
commit bb1f264cfa
  1. 10
      src/core/UBSettings.cpp
  2. 8
      src/core/UBSettings.h
  3. 9
      src/gui/UBFeaturesWidget.cpp
  4. 9
      src/gui/UBLibNavigatorWidget.cpp

@ -78,6 +78,7 @@ QPointer<QSettings> UBSettings::sAppSettings = 0;
const int UBSettings::maxThumbnailWidth = 400; const int UBSettings::maxThumbnailWidth = 400;
const int UBSettings::defaultThumbnailWidth = 150; const int UBSettings::defaultThumbnailWidth = 150;
const int UBSettings::defaultLibraryIconSize = 80;
const int UBSettings::defaultGipWidth = 150; const int UBSettings::defaultGipWidth = 150;
const int UBSettings::defaultSoundWidth = 50; const int UBSettings::defaultSoundWidth = 50;
@ -394,6 +395,8 @@ void UBSettings::init()
teacherGuidePageZeroActivated = new UBSetting(this,"DockPalette","TeacherGuideActivatePageZero",true); teacherGuidePageZeroActivated = new UBSetting(this,"DockPalette","TeacherGuideActivatePageZero",true);
teacherGuideLessonPagesActivated = new UBSetting(this,"DockPalette","TeacherGuideActivateLessonPages",true); teacherGuideLessonPagesActivated = new UBSetting(this,"DockPalette","TeacherGuideActivateLessonPages",true);
libIconSize = new UBSetting(this, "Library", "LibIconSize", defaultLibraryIconSize);
actionGroupText = "Group items"; actionGroupText = "Group items";
actionUngroupText = "Ungroup items"; actionUngroupText = "Ungroup items";
} }
@ -1184,6 +1187,13 @@ void UBSettings::setCommunityPassword(const QString &password)
communityPsw->set(QVariant(password)); communityPsw->set(QVariant(password));
} }
int UBSettings::libraryIconSize(){
return libIconSize->get().toInt();
}
void UBSettings::setLibraryIconsize(const int& size){
libIconSize->set(QVariant(size));
}
bool UBSettings::checkDirectory(QString& dirPath) bool UBSettings::checkDirectory(QString& dirPath)
{ {

@ -96,6 +96,9 @@ class UBSettings : public QObject
QString communityPassword(); QString communityPassword();
void setCommunityPassword(const QString& password); void setCommunityPassword(const QString& password);
int libraryIconSize();
void setLibraryIconsize(const int& size);
void init(); void init();
//user directories //user directories
@ -177,6 +180,7 @@ class UBSettings : public QObject
static const int maxThumbnailWidth; static const int maxThumbnailWidth;
static const int defaultThumbnailWidth; static const int defaultThumbnailWidth;
static const int defaultLibraryIconSize;
static const int defaultImageWidth; static const int defaultImageWidth;
static const int defaultShapeWidth; static const int defaultShapeWidth;
@ -205,6 +209,8 @@ class UBSettings : public QObject
static QString defaultDocumentGroupName; static QString defaultDocumentGroupName;
static QString documentTrashGroupName; static QString documentTrashGroupName;
//static int libIconSize;
UBSetting* productWebUrl; UBSetting* productWebUrl;
QString softwareHomeUrl; QString softwareHomeUrl;
@ -349,6 +355,8 @@ class UBSettings : public QObject
UBSetting* teacherGuidePageZeroActivated; UBSetting* teacherGuidePageZeroActivated;
UBSetting* teacherGuideLessonPagesActivated; UBSetting* teacherGuideLessonPagesActivated;
UBSetting* libIconSize;
public slots: public slots:
void setPenWidthIndex(int index); void setPenWidthIndex(int index);

@ -17,6 +17,7 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name)
setObjectName(name); setObjectName(name);
mName = "FeaturesWidget"; mName = "FeaturesWidget";
mVisibleState = true; mVisibleState = true;
int currentIconSize = UBSettings::settings()->libraryIconSize();
SET_STYLE_SHEET(); SET_STYLE_SHEET();
//setAttribute(Qt::WA_StyledBackground, true); //setAttribute(Qt::WA_StyledBackground, true);
@ -63,8 +64,8 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name)
featuresListView->setItemDelegate( itemDelegate ); featuresListView->setItemDelegate( itemDelegate );
//featuresListView->setSelectionRectVisible(false); //featuresListView->setSelectionRectVisible(false);
featuresListView->setIconSize( QSize(defaultThumbnailSize, defaultThumbnailSize) ); featuresListView->setIconSize( QSize(currentIconSize, currentIconSize) );
featuresListView->setGridSize( QSize(defaultThumbnailSize * 1.75, defaultThumbnailSize * 1.75) ); featuresListView->setGridSize( QSize(currentIconSize * 1.75, currentIconSize * 1.75) );
//pathListView->setStyleSheet( QString("background: #EEEEEE; border-radius : 10px; border : 2px solid #999999;") ); //pathListView->setStyleSheet( QString("background: #EEEEEE; border-radius : 10px; border : 2px solid #999999;") );
pathListView->setModel( featuresPathModel ); pathListView->setModel( featuresPathModel );
@ -104,7 +105,8 @@ UBFeaturesWidget::UBFeaturesWidget(QWidget *parent, const char *name)
thumbSlider = new QSlider( Qt::Horizontal, featuresListView ); thumbSlider = new QSlider( Qt::Horizontal, featuresListView );
thumbSlider->setMinimum( minThumbnailSize ); thumbSlider->setMinimum( minThumbnailSize );
thumbSlider->setMaximum( maxThumbnailSize ); thumbSlider->setMaximum( maxThumbnailSize );
thumbSlider->setValue( defaultThumbnailSize ); thumbSlider->setValue(currentIconSize);
//qDebug() << "init" << featuresListView->height(); //qDebug() << "init" << featuresListView->height();
thumbSlider->move( 0, featuresListView->height() ); thumbSlider->move( 0, featuresListView->height() );
thumbSlider->resize( thumbSlider->width(), thumbSlider->height() + 4 ); thumbSlider->resize( thumbSlider->width(), thumbSlider->height() + 4 );
@ -353,6 +355,7 @@ void UBFeaturesWidget::thumbnailSizeChanged( int value )
{ {
featuresListView->setIconSize( QSize( value, value ) ); featuresListView->setIconSize( QSize( value, value ) );
featuresListView->setGridSize( QSize( value * 1.75, value * 1.75 ) ); featuresListView->setGridSize( QSize( value * 1.75, value * 1.75 ) );
UBSettings::settings()->setLibraryIconsize(value);
} }
void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata ) void UBFeaturesWidget::onDisplayMetadata( QMap<QString,QString> metadata )

@ -52,8 +52,10 @@ UBLibNavigatorWidget::UBLibNavigatorWidget(QWidget *parent, const char *name):QW
mSlider = new QSlider(Qt::Horizontal, this); mSlider = new QSlider(Qt::Horizontal, this);
mSlider->setMinimumHeight(20); mSlider->setMinimumHeight(20);
mSlider->setRange(lowBoundForSlider, topBoundForSlider); mSlider->setRange(lowBoundForSlider, topBoundForSlider);
mSliderWidthSetting = new UBSetting(UBSettings::settings(), "Library", "LibWidgetWidth", topBoundForSlider); //mSliderWidthSetting = new UBSetting(UBSettings::settings(), "Library", "LibWidgetWidth", topBoundForSlider);
int defaultWidth = mSliderWidthSetting->get().toInt(); //int defaultWidth = mSliderWidthSetting->get().toInt();
int defaultWidth = UBSettings::settings()->libraryIconSize();
qDebug() << defaultWidth;
mSlider->setValue(defaultWidth); mSlider->setValue(defaultWidth);
mSlider->setTickInterval(tickIntervalForSlider); mSlider->setTickInterval(tickIntervalForSlider);
mLayout->addWidget(mSlider, 0); mLayout->addWidget(mSlider, 0);
@ -181,6 +183,7 @@ void UBLibNavigatorWidget::onDisplaySearchEngine(UBLibElement *elem)
*/ */
void UBLibNavigatorWidget::updateThumbnailsSize(int newSize) void UBLibNavigatorWidget::updateThumbnailsSize(int newSize)
{ {
mSliderWidthSetting->set(newSize); //mSliderWidthSetting->set(newSize);
UBSettings::settings()->setLibraryIconsize(newSize);
mLibWidget->updateThumbnailsSize(newSize); mLibWidget->updateThumbnailsSize(newSize);
} }

Loading…
Cancel
Save