Improved RemoteDirModel interactivity

git-svn-id: http://svn.code.sf.net/p/retroshare/code/trunk@1519 b45a01b8-16f6-495d-af2f-9b41ad6348cc
This commit is contained in:
csoler 2009-08-11 18:14:55 +00:00
parent d78ee60e30
commit cf2343105b
6 changed files with 44 additions and 29 deletions

View file

@ -500,7 +500,7 @@ void FileIndexMonitor::updateCycle()
std::cerr << "List of Files to rehash in: " << dirpath << std::endl; std::cerr << "List of Files to rehash in: " << dirpath << std::endl;
#endif #endif
fiMods = true; fiMods = true;
cb->notifyListPreChange(NOTIFY_LIST_DIRLIST, 0); cb->notifyListPreChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
} }
#ifdef FIM_DEBUG #ifdef FIM_DEBUG
@ -550,7 +550,7 @@ void FileIndexMonitor::updateCycle()
} }
if (filesToHash.size() > 0) if (filesToHash.size() > 0)
cb->notifyListChange(NOTIFY_LIST_DIRLIST, 0); cb->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
} }
fiMutex.lock(); { /* LOCKED DIRS */ fiMutex.lock(); { /* LOCKED DIRS */
@ -671,7 +671,7 @@ void FileIndexMonitor::locked_saveFileIndexes()
void FileIndexMonitor::updateShareFlags(const SharedDirInfo& dir) void FileIndexMonitor::updateShareFlags(const SharedDirInfo& dir)
{ {
cb->notifyListPreChange(NOTIFY_LIST_DIRLIST, 0); cb->notifyListPreChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
bool fimods = false ; bool fimods = false ;
#ifdef FIM_DEBUG #ifdef FIM_DEBUG
@ -708,12 +708,12 @@ void FileIndexMonitor::updateShareFlags(const SharedDirInfo& dir)
RsStackMutex stack(fiMutex) ; /* LOCKED DIRS */ RsStackMutex stack(fiMutex) ; /* LOCKED DIRS */
locked_saveFileIndexes() ; locked_saveFileIndexes() ;
} }
cb->notifyListChange(NOTIFY_LIST_DIRLIST, 0); cb->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
} }
/* interface */ /* interface */
void FileIndexMonitor::setSharedDirectories(std::list<SharedDirInfo> dirs) void FileIndexMonitor::setSharedDirectories(std::list<SharedDirInfo> dirs)
{ {
cb->notifyListPreChange(NOTIFY_LIST_DIRLIST, 0); cb->notifyListPreChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
std::list<SharedDirInfo> checkeddirs; std::list<SharedDirInfo> checkeddirs;
@ -752,7 +752,7 @@ void FileIndexMonitor::setSharedDirectories(std::list<SharedDirInfo> dirs)
pendingDirs = true; pendingDirs = true;
pendingDirList = checkeddirs; pendingDirList = checkeddirs;
cb->notifyListChange(NOTIFY_LIST_DIRLIST, 0); cb->notifyListChange(NOTIFY_LIST_DIRLIST_LOCAL, 0);
} }
/* interface */ /* interface */

View file

@ -535,7 +535,7 @@ int FileIndexStore::searchBoolExp(Expression * exp, std::list<FileDetail> &resul
int FileIndexStore::AboutToModify() int FileIndexStore::AboutToModify()
{ {
if (cb) if (cb)
cb->notifyListPreChange(NOTIFY_LIST_DIRLIST, 0); cb->notifyListPreChange(NOTIFY_LIST_DIRLIST_FRIENDS, 0);
return 1; return 1;
} }
@ -544,7 +544,7 @@ int FileIndexStore::AboutToModify()
int FileIndexStore::ModCompleted() int FileIndexStore::ModCompleted()
{ {
if (cb) if (cb)
cb->notifyListChange(NOTIFY_LIST_DIRLIST, 0); cb->notifyListChange(NOTIFY_LIST_DIRLIST_FRIENDS, 0);
return 1; return 1;
} }

View file

@ -205,14 +205,15 @@ class NotifyBase
virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& files) { (void)files; } virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& files) { (void)files; }
}; };
const int NOTIFY_LIST_NEIGHBOURS = 1; const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2; const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_DIRLIST = 3; const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_SEARCHLIST = 4; const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_MESSAGELIST = 5; const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_CHANNELLIST = 6; const int NOTIFY_LIST_TRANSFERLIST = 7;
const int NOTIFY_LIST_TRANSFERLIST = 7; const int NOTIFY_LIST_CONFIG = 8;
const int NOTIFY_LIST_CONFIG = 8; const int NOTIFY_LIST_DIRLIST_LOCAL = 9;
const int NOTIFY_LIST_DIRLIST_FRIENDS = 10;
const int NOTIFY_TYPE_SAME = 0x01; const int NOTIFY_TYPE_SAME = 0x01;
const int NOTIFY_TYPE_MOD = 0x02; /* general purpose, check all */ const int NOTIFY_TYPE_MOD = 0x02; /* general purpose, check all */

View file

@ -504,9 +504,17 @@ void SharedFilesDialog::postModDirectories(bool update_local)
{ {
std::cerr << "SharedFilesDialog::postModDirectories called with update_local = " << update_local << std::endl ; std::cerr << "SharedFilesDialog::postModDirectories called with update_local = " << update_local << std::endl ;
if (update_local) if (update_local)
{
localModel->postMods(); localModel->postMods();
ui.localDirTreeView->update() ;
}
else else
{
model->postMods(); model->postMods();
ui.remoteDirTreeView->update() ;
}
QCoreApplication::flush();
} }

View file

@ -67,8 +67,6 @@ void NotifyQt::notifyHashingInfo(std::string fileinfo)
void NotifyQt::notifyListChange(int list, int type) void NotifyQt::notifyListChange(int list, int type)
{ {
(void) type;
#ifdef NOTIFY_DEBUG #ifdef NOTIFY_DEBUG
std::cerr << "NotifyQt::notifyListChange()" << std::endl; std::cerr << "NotifyQt::notifyListChange()" << std::endl;
#endif #endif
@ -86,13 +84,18 @@ void NotifyQt::notifyListChange(int list, int type)
#endif #endif
emit friendsChanged() ; emit friendsChanged() ;
break; break;
case NOTIFY_LIST_DIRLIST: case NOTIFY_LIST_DIRLIST_LOCAL:
#ifdef DEBUG #ifdef DEBUG
std::cerr << "received files changed" << std::endl ; std::cerr << "received files changed" << std::endl ;
#endif #endif
emit filesPostModChanged(false) ; /* Remote */
emit filesPostModChanged(true) ; /* Local */ emit filesPostModChanged(true) ; /* Local */
break; break;
case NOTIFY_LIST_DIRLIST_FRIENDS:
#ifdef DEBUG
std::cerr << "received files changed" << std::endl ;
#endif
emit filesPostModChanged(false) ; /* Local */
break;
case NOTIFY_LIST_SEARCHLIST: case NOTIFY_LIST_SEARCHLIST:
break; break;
case NOTIFY_LIST_MESSAGELIST: case NOTIFY_LIST_MESSAGELIST:
@ -134,8 +137,10 @@ void NotifyQt::notifyListPreChange(int list, int type)
case NOTIFY_LIST_FRIENDS: case NOTIFY_LIST_FRIENDS:
emit friendsChanged() ; emit friendsChanged() ;
break; break;
case NOTIFY_LIST_DIRLIST: case NOTIFY_LIST_DIRLIST_FRIENDS:
emit filesPreModChanged(false) ; /* remote */ emit filesPreModChanged(false) ; /* remote */
break ;
case NOTIFY_LIST_DIRLIST_LOCAL:
emit filesPreModChanged(true) ; /* local */ emit filesPreModChanged(true) ; /* local */
break; break;
case NOTIFY_LIST_SEARCHLIST: case NOTIFY_LIST_SEARCHLIST:

View file

@ -205,14 +205,15 @@ class NotifyBase
virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& files) { (void)files; } virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& files) { (void)files; }
}; };
const int NOTIFY_LIST_NEIGHBOURS = 1; const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2; const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_DIRLIST = 3; const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_SEARCHLIST = 4; const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_MESSAGELIST = 5; const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_CHANNELLIST = 6; const int NOTIFY_LIST_TRANSFERLIST = 7;
const int NOTIFY_LIST_TRANSFERLIST = 7; const int NOTIFY_LIST_CONFIG = 8;
const int NOTIFY_LIST_CONFIG = 8; const int NOTIFY_LIST_DIRLIST_LOCAL = 9;
const int NOTIFY_LIST_DIRLIST_FRIENDS = 10;
const int NOTIFY_TYPE_SAME = 0x01; const int NOTIFY_TYPE_SAME = 0x01;
const int NOTIFY_TYPE_MOD = 0x02; /* general purpose, check all */ const int NOTIFY_TYPE_MOD = 0x02; /* general purpose, check all */