src/gui.cpp

changeset 416
be1824f53c48
parent 413
a52c30a4c041
child 417
14bfeed046f3
equal deleted inserted replaced
415:6598e3f9c673 416:be1824f53c48
847 // up to date. 847 // up to date.
848 updateFileList(); 848 updateFileList();
849 return; 849 return;
850 } 850 }
851 851
852 str name;
853 if (f->name() == "")
854 name = "<anonymous>";
855 else
856 name = basename (f->name());
857
858 if (f == LDFile::current()) 852 if (f == LDFile::current())
859 ui->fileList->setCurrentItem (f->listItem()); 853 ui->fileList->setCurrentItem (f->listItem());
860 854
861 if (f->implicit()) 855 if (f->implicit())
862 f->listItem()->setForeground (QColor (96, 96, 96)); 856 f->listItem()->setForeground (QColor (96, 96, 96));
863 857
864 f->listItem()->setText (name); 858 f->listItem()->setText (f->getShortName());
865 f->listItem()->setIcon (f->hasUnsavedChanges() ? getIcon ("file-save") : QIcon()); 859 f->listItem()->setIcon (f->hasUnsavedChanges() ? getIcon ("file-save") : QIcon());
866 } 860 }
867 861
868 void ForgeWindow::beginAction (QAction* act) { 862 void ForgeWindow::beginAction (QAction* act) {
869 // Open the history so we can record the edits done during this action. 863 // Open the history so we can record the edits done during this action.
889 } 883 }
890 884
891 if (!f || f == LDFile::current()) 885 if (!f || f == LDFile::current())
892 return; 886 return;
893 887
894 clearSelection();
895 LDFile::setCurrent (f); 888 LDFile::setCurrent (f);
896
897 log ("Changed file to %1", basename (f->name()));
898
899 R()->setFile (f);
900 R()->update();
901 buildObjList();
902 } 889 }
903 890
904 void ForgeWindow::refreshObjectList() { 891 void ForgeWindow::refreshObjectList() {
905 #if 0 892 #if 0
906 ui->objectList->clear(); 893 ui->objectList->clear();

mercurial