[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: KDE/kdeplasma-addons
From: Andrius Štikonas <stikonas () gmail ! com>
Date: 2009-06-30 19:45:06
Message-ID: 1246391106.314349.11743.nullmailer () svn ! kde ! org
[Download RAW message or body]
SVN commit 989735 by stikonas:
Use KIntSpinBox instead of QSpinBox for better integration with KDE. As a bonus this \
allows to use plural suffix in spinboxes since KDE 4.3 if necessary.
M +7 -2 applets/microblog/configuration.ui
M +3 -12 applets/microblog/microblog.cpp
M +0 -2 applets/microblog/microblog.h
M +1 -7 applets/news/news.cpp
M +0 -1 applets/news/news.h
M +1 -1 applets/notes/config.ui
M +3 -11 applets/rssnow/news.cpp
M +0 -1 applets/rssnow/news.h
M +8 -1 applets/systemloadviewer/generalconfig.ui
M +1 -1 libs/plasmaweather/weatherconfig.cpp
M +6 -1 libs/plasmaweather/weatherconfig.ui
M +7 -2 wallpapers/virus/virusconfig.ui
--- trunk/KDE/kdeplasma-addons/applets/microblog/configuration.ui #989734:989735
@@ -72,7 +72,7 @@
<item row="8" column="2" >
<layout class="QHBoxLayout" name="horizontalLayout" >
<item>
- <widget class="QSpinBox" name="historySizeSpinBox" >
+ <widget class="KIntSpinBox" name="historySizeSpinBox" >
<property name="maximum" >
<number>20</number>
</property>
@@ -112,7 +112,7 @@
<item row="9" column="2" >
<layout class="QHBoxLayout" name="horizontalLayout_2" >
<item>
- <widget class="QSpinBox" name="historyRefreshSpinBox" >
+ <widget class="KIntSpinBox" name="historyRefreshSpinBox" >
<property name="minimum" >
<number>2</number>
</property>
@@ -261,6 +261,11 @@
<extends>QComboBox</extends>
<header>kcombobox.h</header>
</customwidget>
+ <customwidget>
+ <class>KIntSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>knuminput.h</header>
+ </customwidget>
</customwidgets>
<tabstops>
<tabstop>serviceUrlCombo</tabstop>
--- trunk/KDE/kdeplasma-addons/applets/microblog/microblog.cpp #989734:989735
@@ -23,7 +23,6 @@
#include <QApplication>
#include <QGridLayout>
#include <QPushButton>
-#include <QSpinBox>
#include <QCheckBox>
#include <QFontMetrics>
#include <QGraphicsView>
@@ -559,29 +558,21 @@
QWidget *configWidget = new QWidget();
configUi.setupUi(configWidget);
-
- connect(configUi.historySizeSpinBox, SIGNAL(valueChanged(int)), this, \
SLOT(updateSpinBoxSuffix()));
- connect(configUi.historyRefreshSpinBox, SIGNAL(valueChanged(int)), this, \
SLOT(updateSpinBoxSuffix()));
-
+
configUi.serviceUrlCombo->addItem("https://identi.ca/api/");
configUi.serviceUrlCombo->addItem("https://twitter.com/");
configUi.serviceUrlCombo->setEditText(m_serviceUrl);
configUi.usernameEdit->setText(m_username);
configUi.passwordEdit->setText(m_password);
configUi.historySizeSpinBox->setValue(m_historySize);
+ configUi.historySizeSpinBox->setSuffix(ki18np(" message", " messages"));
configUi.historyRefreshSpinBox->setValue(m_historyRefresh);
+ configUi.historyRefreshSpinBox->setSuffix(ki18np(" minute", " minutes"));
configUi.checkIncludeFriends->setChecked(m_includeFriends);
- updateSpinBoxSuffix();
parent->addPage(configWidget, i18n("General"), icon());
}
-void MicroBlog::updateSpinBoxSuffix()
-{
- configUi.historySizeSpinBox->setSuffix(i18np(" message", " messages", \
configUi.historySizeSpinBox->value()));
- configUi.historyRefreshSpinBox->setSuffix(i18np(" minute", " minutes", \
configUi.historyRefreshSpinBox->value()));
-}
-
void MicroBlog::configAccepted()
{
QString serviceUrl = configUi.serviceUrlCombo->currentText();
--- trunk/KDE/kdeplasma-addons/applets/microblog/microblog.h #989734:989735
@@ -33,7 +33,6 @@
class KLineEdit;
class KTextEdit;
class KTextBrowser;
-class QSpinBox;
class QCheckBox;
class QGraphicsLinearLayout;
class QGraphicsProxyWidget;
@@ -96,7 +95,6 @@
void openProfile();
void editTextChanged();
void serviceFinished(Plasma::ServiceJob *job);
- void updateSpinBoxSuffix();
void themeChanged();
void showTweets();
--- trunk/KDE/kdeplasma-addons/applets/news/news.cpp #989734:989735
@@ -229,7 +229,6 @@
connect(parent, SIGNAL(accepted()), this, SLOT(configAccepted()));
connect(feedsUi.addFeed, SIGNAL(clicked()), this, SLOT(addFeed()));
connect(feedsUi.removeFeed, SIGNAL(clicked()), this, SLOT(removeFeed()));
- connect(ui.intervalSpinBox, SIGNAL(valueChanged(int)), this, \
SLOT(updateSpinBoxSuffix(int)));
m_defaultFeeds = akregatorFeeds();
feedsUi.feedComboBox->clear();
@@ -240,7 +239,7 @@
}
ui.intervalSpinBox->setValue(m_interval);
- updateSpinBoxSuffix(m_interval);
+ ui.intervalSpinBox->setSuffix(ki18np(" minute", " minutes"));
ui.timestampCheckBox->setChecked(m_showTimestamps);
ui.titlesCheckBox->setChecked(m_showTitles);
@@ -249,11 +248,6 @@
feedsUi.feedList->addItems(m_feeds);
}
-void News::updateSpinBoxSuffix(int interval)
-{
- ui.intervalSpinBox->setSuffix(i18np(" minute", " minutes", interval));
-}
-
void News::feedTextChanged(const QString& text)
{
feedsUi.addFeed->setEnabled(!text.isEmpty());
--- trunk/KDE/kdeplasma-addons/applets/news/news.h #989734:989735
@@ -53,7 +53,6 @@
void removeFeed();
void feedTextChanged(const QString& text);
void makeStylesheet();
- void updateSpinBoxSuffix(int interval);
private:
QStringList m_feeds;
--- trunk/KDE/kdeplasma-addons/applets/notes/config.ui #989734:989735
@@ -109,7 +109,7 @@
</widget>
</item>
<item>
- <widget class="QSpinBox" name="autoFontPercent" >
+ <widget class="KIntSpinBox" name="autoFontPercent" >
<property name="suffix" >
<string>%</string>
</property>
--- trunk/KDE/kdeplasma-addons/applets/rssnow/news.cpp #989734:989735
@@ -129,9 +129,6 @@
connect(feedsUi.removeFeed, SIGNAL(clicked()), this, SLOT(removeFeed()));
connect(feedsUi.feedList, SIGNAL( itemSelectionChanged ()), this, \
SLOT(slotItemChanged()));
connect(feedsUi.feedComboBox->lineEdit(), SIGNAL( textChanged( const QString& ) \
), this, SLOT( slotChangeText(const QString& ) ) );
- connect(ui.maxAge, SIGNAL(valueChanged(int)), this, \
SLOT(updateSpinBoxSuffix()));
- connect(ui.switchInterval, SIGNAL(valueChanged(int)), this, \
SLOT(updateSpinBoxSuffix()));
- connect(ui.intervalSpinBox, SIGNAL(valueChanged(int)), this, \
SLOT(updateSpinBoxSuffix())); feedsUi.removeFeed->setEnabled( false );
KConfig feedsFile(QString("news/feeds"), KConfig::FullConfig, "data");
m_defaultFeeds = feedsFile.group("feeds").entryMap();
@@ -147,9 +144,11 @@
}
ui.intervalSpinBox->setValue(m_interval);
+ ui.intervalSpinBox->setSuffix(ki18np(" minute", " minutes"));
ui.switchInterval->setValue(m_switchInterval);
+ ui.switchInterval->setSuffix(ki18np(" second", " seconds"));
ui.maxAge->setValue(m_maxAge);
- updateSpinBoxSuffix();
+ ui.maxAge->setSuffix(ki18np(" hour", " hours"));
if (m_logo) {
ui.logo->setCheckState(Qt::Checked);
} else {
@@ -171,13 +170,6 @@
parent->addPage(fWidget, i18n("Feeds"), icon());
}
-void News::updateSpinBoxSuffix()
-{
- ui.maxAge->setSuffix(i18np(" hour", " hours", ui.maxAge->value()));
- ui.switchInterval->setSuffix(i18np(" second", " seconds", \
ui.switchInterval->value()));
- ui.intervalSpinBox->setSuffix(i18np(" minute", " minutes", \
ui.intervalSpinBox->value()));
-}
-
void News::slotChangeText( const QString& text )
{
feedsUi.addFeed->setEnabled( !text.isEmpty() );
--- trunk/KDE/kdeplasma-addons/applets/rssnow/news.h #989734:989735
@@ -64,7 +64,6 @@
void removeFeed();
void slotItemChanged();
void slotChangeText( const QString& text );
- void updateSpinBoxSuffix();
private:
QStringList m_feedlist;
--- trunk/KDE/kdeplasma-addons/applets/systemloadviewer/generalconfig.ui \
#989734:989735 @@ -58,7 +58,7 @@
<property name="orientation" >
<enum>Qt::Horizontal</enum>
</property>
- <widget class="QSpinBox" name="spbxUpdateInterval" >
+ <widget class="KIntSpinBox" name="spbxUpdateInterval" >
<property name="suffix" >
<string> ms</string>
</property>
@@ -95,6 +95,13 @@
</item>
</layout>
</widget>
+ <customwidgets>
+ <customwidget>
+ <class>KIntSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>knuminput.h</header>
+ </customwidget>
+ </customwidgets>
<resources/>
<connections/>
</ui>
--- trunk/KDE/kdeplasma-addons/libs/plasmaweather/weatherconfig.cpp #989734:989735
@@ -123,7 +123,7 @@
void WeatherConfig::setUpdateInterval(int interval)
{
d->ui.updateIntervalSpinBox->setValue(interval);
- d->ui.updateIntervalSpinBox->setSuffix(i18np(" minute", " minutes", interval));
+ d->ui.updateIntervalSpinBox->setSuffix(ki18np(" minute", " minutes"));
}
void WeatherConfig::setTemperatureUnit(const QString& unit)
--- trunk/KDE/kdeplasma-addons/libs/plasmaweather/weatherconfig.ui #989734:989735
@@ -136,7 +136,7 @@
</widget>
</item>
<item row="4" column="1">
- <widget class="QSpinBox" name="updateIntervalSpinBox">
+ <widget class="KIntSpinBox" name="updateIntervalSpinBox">
<property name="sizePolicy">
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
<horstretch>0</horstretch>
@@ -300,6 +300,11 @@
</widget>
<customwidgets>
<customwidget>
+ <class>KIntSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>knuminput.h</header>
+ </customwidget>
+ <customwidget>
<class>KPushButton</class>
<extends>QPushButton</extends>
<header>kpushbutton.h</header>
--- trunk/KDE/kdeplasma-addons/wallpapers/virus/virusconfig.ui #989734:989735
@@ -285,7 +285,7 @@
</spacer>
</item>
<item row="1" column="1">
- <widget class="QSpinBox" name="m_updateInterval">
+ <widget class="KIntSpinBox" name="m_updateInterval">
<property name="minimumSize">
<size>
<width>100</width>
@@ -313,7 +313,7 @@
</widget>
</item>
<item row="2" column="1">
- <widget class="QSpinBox" name="m_maxCells">
+ <widget class="KIntSpinBox" name="m_maxCells">
<property name="minimumSize">
<size>
<width>100</width>
@@ -423,6 +423,11 @@
<extends>QPushButton</extends>
<header>kcolorbutton.h</header>
</customwidget>
+ <customwidget>
+ <class>KIntSpinBox</class>
+ <extends>QSpinBox</extends>
+ <header>knuminput.h</header>
+ </customwidget>
</customwidgets>
<resources/>
<connections/>
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic