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

View File

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

View File

@ -205,14 +205,15 @@ class NotifyBase
virtual void notifyTurtleSearchResult(uint32_t search_id,const std::list<TurtleFileInfo>& files) { (void)files; }
};
const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_DIRLIST = 3;
const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_TRANSFERLIST = 7;
const int NOTIFY_LIST_CONFIG = 8;
const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_TRANSFERLIST = 7;
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_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 ;
if (update_local)
{
localModel->postMods();
ui.localDirTreeView->update() ;
}
else
{
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) type;
#ifdef NOTIFY_DEBUG
std::cerr << "NotifyQt::notifyListChange()" << std::endl;
#endif
@ -86,13 +84,18 @@ void NotifyQt::notifyListChange(int list, int type)
#endif
emit friendsChanged() ;
break;
case NOTIFY_LIST_DIRLIST:
case NOTIFY_LIST_DIRLIST_LOCAL:
#ifdef DEBUG
std::cerr << "received files changed" << std::endl ;
#endif
emit filesPostModChanged(false) ; /* Remote */
emit filesPostModChanged(true) ; /* Local */
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:
break;
case NOTIFY_LIST_MESSAGELIST:
@ -134,8 +137,10 @@ void NotifyQt::notifyListPreChange(int list, int type)
case NOTIFY_LIST_FRIENDS:
emit friendsChanged() ;
break;
case NOTIFY_LIST_DIRLIST:
case NOTIFY_LIST_DIRLIST_FRIENDS:
emit filesPreModChanged(false) ; /* remote */
break ;
case NOTIFY_LIST_DIRLIST_LOCAL:
emit filesPreModChanged(true) ; /* local */
break;
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; }
};
const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_DIRLIST = 3;
const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_TRANSFERLIST = 7;
const int NOTIFY_LIST_CONFIG = 8;
const int NOTIFY_LIST_NEIGHBOURS = 1;
const int NOTIFY_LIST_FRIENDS = 2;
const int NOTIFY_LIST_SEARCHLIST = 4;
const int NOTIFY_LIST_MESSAGELIST = 5;
const int NOTIFY_LIST_CHANNELLIST = 6;
const int NOTIFY_LIST_TRANSFERLIST = 7;
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_MOD = 0x02; /* general purpose, check all */