Bug 149098 - download/upload tab: open the last used tab on start
Summary: download/upload tab: open the last used tab on start
Status: RESOLVED FIXED
Alias: None
Product: ktorrent
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: openSUSE Linux
: NOR wishlist
Target Milestone: ---
Assignee: Joris Guisson
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2007-08-22 09:28 UTC by Maciej Pilichowski
Modified: 2007-08-22 19:24 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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();
 	}