[rkward-cvs] SF.net SVN: rkward:[3515] trunk/rkward/rkward
tfry at users.sourceforge.net
tfry at users.sourceforge.net
Mon Apr 18 11:56:57 UTC 2011
Revision: 3515
http://rkward.svn.sourceforge.net/rkward/?rev=3515&view=rev
Author: tfry
Date: 2011-04-18 11:56:57 +0000 (Mon, 18 Apr 2011)
Log Message:
-----------
Reduce the amount of flicker while restoring (large) workplaces
Modified Paths:
--------------
trunk/rkward/rkward/rkward.cpp
trunk/rkward/rkward/rkward.h
trunk/rkward/rkward/windows/rkworkplace.cpp
Modified: trunk/rkward/rkward/rkward.cpp
===================================================================
--- trunk/rkward/rkward/rkward.cpp 2011-04-18 11:45:15 UTC (rev 3514)
+++ trunk/rkward/rkward/rkward.cpp 2011-04-18 11:56:57 UTC (rev 3515)
@@ -113,6 +113,7 @@
RK_TRACE (APP);
RK_ASSERT (rkward_mainwin == 0);
+ gui_rebuild_locked = false;
rkward_mainwin = this;
RKGlobals::rinter = 0;
RKSettings::settings_tracker = new RKSettingsTracker (this);
@@ -474,6 +475,7 @@
void RKWardMainWindow::partChanged (KParts::Part *part) {
RK_TRACE (APP);
+ if (gui_rebuild_locked) return;
createGUI (part);
if (!guiFactory ()) {
@@ -508,6 +510,18 @@
*/
}
+void RKWardMainWindow::lockGUIRebuild (bool lock) {
+ RK_TRACE (APP);
+
+ if (lock) {
+ RK_ASSERT (!gui_rebuild_locked);
+ gui_rebuild_locked = true;
+ } else {
+ gui_rebuild_locked = false;
+ partChanged (part_manager->activePart ());
+ }
+}
+
void RKWardMainWindow::initStatusBar () {
RK_TRACE (APP);
@@ -610,14 +624,17 @@
// }
RKWorkplace::RKWorkplaceObjectList map = RKWorkplace::mainWorkplace ()->getObjectList ();
- for (RKWorkplace::RKWorkplaceObjectList::const_iterator it = map.constBegin (); it != map.constEnd (); ++it){
+ for (RKWorkplace::RKWorkplaceObjectList::const_iterator it = map.constBegin (); it != map.constEnd (); ++it) {
+ lockGUIRebuild (true);
if (!(*it)->close (true)) {
if (!(*it)->isType (RKMDIWindow::X11Window)) { // X11 windows have a delayed close
// If a child refuses to close, we return false.
slotSetStatusReady ();
+ lockGUIRebuild (false);
return false;
}
}
+ lockGUIRebuild (false);
}
return true;
Modified: trunk/rkward/rkward/rkward.h
===================================================================
--- trunk/rkward/rkward/rkward.h 2011-04-18 11:45:15 UTC (rev 3514)
+++ trunk/rkward/rkward/rkward.h 2011-04-18 11:56:57 UTC (rev 3515)
@@ -76,6 +76,7 @@
/** (try to) close all windows, and ask whether it is ok to quit */
bool doQueryQuit ();
+ void lockGUIRebuild (bool lock);
protected:
void openWorkspace (const KUrl &url);
/** save Options/Settings. Includes general Options like all bar positions and status as well as the geometry and the recent file list */
@@ -205,6 +206,7 @@
void updateCWD ();
RKTopLevelWindowGUI *toplevel_actions;
+ bool gui_rebuild_locked;
};
#endif // RKWARD_H
Modified: trunk/rkward/rkward/windows/rkworkplace.cpp
===================================================================
--- trunk/rkward/rkward/windows/rkworkplace.cpp 2011-04-18 11:45:15 UTC (rev 3514)
+++ trunk/rkward/rkward/windows/rkworkplace.cpp 2011-04-18 11:56:57 UTC (rev 3515)
@@ -419,10 +419,12 @@
void RKWorkplace::closeAll (int type, int state) {
RK_TRACE (APP);
+ RKWardMainWindow::getMain ()->lockGUIRebuild (true);
RKWorkplaceObjectList list_to_close = getObjectList (type, state);
for (RKWorkplaceObjectList::const_iterator it = list_to_close.constBegin (); it != list_to_close.constEnd (); ++it) {
closeWindow (*it);
}
+ RKWardMainWindow::getMain ()->lockGUIRebuild (false);
}
void RKWorkplace::removeWindow (QObject *object) {
@@ -593,6 +595,7 @@
void RKWorkplace::restoreWorkplace (const QStringList &description) {
RK_TRACE (APP);
+ RKWardMainWindow::getMain ()->lockGUIRebuild (true);
QString base;
for (int i = 0; i < description.size (); ++i) {
// Item format for rkward <= 0.5.4: "type:specification"
@@ -653,6 +656,7 @@
}
}
}
+ RKWardMainWindow::getMain ()->lockGUIRebuild (false);
}
///////////////////////// END RKWorkplace ////////////////////////////
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the rkward-tracker
mailing list