Bug 149098

Summary: download/upload tab: open the last used tab on start
Product: [Applications] ktorrent Reporter: Maciej Pilichowski <bluedzins>
Component: generalAssignee: Joris Guisson <joris.guisson>
Status: RESOLVED FIXED    
Severity: wishlist    
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: openSUSE   
OS: Linux   
Latest Commit: Version Fixed In:

Description Maciej Pilichowski 2007-08-22 09:28:47 UTC
Version:            (using KDE KDE 3.5.7)
Installed from:    SuSE RPMs

Ktorrent always opens upload tab on start. I don't know other ktorrent users, but I am not interested in uploads, only downloads, so each time I start Ktorrent I have to click on downloads.

Please, remember last used tab and open it on start the next time Ktorrent is launched.
Comment 1 Joris Guisson 2007-08-22 19:24:41 UTC
SVN commit 703501 by guisson:

Make tab widget remember the current tab

BUG: 149098



 M  +8 -0      mainwindow.cpp  


--- trunk/extragear/network/ktorrent/ideal/mainwindow.cpp #703500:703501
@@ -58,6 +58,11 @@
 		if (bottom)
 			bottom->loadState(cfg);
 		loadSplitterState(cfg);
+		
+		KConfigGroup g = cfg->group("MainTabWidget");
+		int ct = g.readEntry("current_tab",0);
+		if (ct >= 0 && ct < tabs->count())
+			tabs->setCurrentIndex(ct);
 	}
 
 	void MainWindow::saveState(KSharedConfigPtr cfg)
@@ -70,6 +75,9 @@
 			bottom->saveState(cfg);
 		
 		saveSplitterState(cfg);
+		// save the current tab
+		KConfigGroup g = cfg->group("MainTabWidget");
+		g.writeEntry("current_tab",tabs->currentIndex());
 		cfg->sync();
 	}