summaryrefslogtreecommitdiff
path: root/libopie/otabwidget.cpp
Side-by-side diff
Diffstat (limited to 'libopie/otabwidget.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/otabwidget.cpp24
1 files changed, 23 insertions, 1 deletions
diff --git a/libopie/otabwidget.cpp b/libopie/otabwidget.cpp
index aaf14ce..bed7ef1 100644
--- a/libopie/otabwidget.cpp
+++ b/libopie/otabwidget.cpp
@@ -143,3 +143,3 @@ void OTabWidget::removePage( QWidget *childwidget )
{
- if ( childwidget )
+ if ( childwidget )
{
@@ -203,2 +203,15 @@ void OTabWidget::setCurrentTab( const QString &tabname )
+void OTabWidget::setCurrentTab(int tabindex) {
+ OTabInfo *newtab = tabs.first();
+ while ( newtab && newtab->id() != tabindex )
+ {
+ newtab = tabs.next();
+ }
+ if ( newtab && newtab->id() == tabindex )
+ {
+ selectTab( newtab );
+ }
+}
+
+
OTabWidget::TabStyle OTabWidget::tabStyle() const
@@ -307 +320,10 @@ void OTabWidget::resizeEvent( QResizeEvent * )
}
+
+int OTabWidget::getCurrentTab() {
+ if ( currentTab )
+ {
+ return currentTab->id();
+ }
+ return -1;
+}
+