1.1 --- a/mainwindow.cpp Mon Oct 06 11:10:20 2008 +0000
1.2 +++ b/mainwindow.cpp Wed Oct 29 17:42:34 2008 +0000
1.3 @@ -1721,30 +1721,6 @@
1.4 {
1.5 VymView *vm=new VymView (model);
1.6
1.7 -/*
1.8 - // Create TreeView
1.9 - QTreeView *tv=new QTreeView;
1.10 - tv->setModel (model);
1.11 - tv->setMinimumWidth (350);
1.12 - tv->setColumnWidth (0,350);
1.13 -
1.14 - // Create good old MapEditor
1.15 - MapEditor* me=model->getMapEditor();
1.16 - if (!me) me=new MapEditor (model);
1.17 - //me->viewport()->setFocus();
1.18 - me->setAntiAlias (actionViewToggleAntiAlias->isOn());
1.19 - me->setSmoothPixmap(actionViewToggleSmoothPixmapTransform->isOn());
1.20 -
1.21 - vm->addWidget (tv);
1.22 - vm->addWidget (me);
1.23 -
1.24 - // Set geometry
1.25 - QList <int> sizes;
1.26 - sizes.append (150);
1.27 - sizes.append (600);
1.28 - vm->setSizes (sizes);
1.29 -
1.30 -*/
1.31 return vm;
1.32 }
1.33
1.34 @@ -1752,8 +1728,8 @@
1.35 {
1.36 VymModel *m=new VymModel;
1.37 tabModel.append (m);
1.38 - MapEditor* me = new MapEditor (m);
1.39 - me->setObjectName ("MapEditor");
1.40 + //MapEditor* me = new MapEditor (m);
1.41 + //me->setObjectName ("MapEditor");
1.42
1.43 VymView *view=createView (m);
1.44 tabWidget->addTab (view,tr("unnamed","MainWindow: name for new and empty file"));
1.45 @@ -1787,7 +1763,7 @@
1.46 // Make fn absolute (needed for unzip)
1.47 fn=QDir (fn).absPath();
1.48
1.49 - MapEditor *me;
1.50 + VymModel *vm;
1.51
1.52 if (lmode==NewMap)
1.53 {
1.54 @@ -1830,15 +1806,15 @@
1.55 // Try to load map
1.56 if ( !fn.isEmpty() )
1.57 {
1.58 - me = currentMapEditor();
1.59 + vm = currentModel();
1.60 // Check first, if mapeditor exists
1.61 // If it is not default AND we want a new map,
1.62 // create a new mapeditor in a new tab
1.63 - if ( lmode==NewMap && (!me || !me->getModel()->isDefault() ) )
1.64 + if ( lmode==NewMap && (!vm || !vm->isDefault() ) )
1.65 {
1.66 - VymModel *m=new VymModel;
1.67 - tabModel.append (m);
1.68 - VymView *view=createView (m);
1.69 + vm=new VymModel;
1.70 + tabModel.append (vm);
1.71 + VymView *view=createView (vm);
1.72 tabWidget->addTab (view,fn);
1.73 tabIndex=tabWidget->count()-1;
1.74 tabWidget->setCurrentPage (tabIndex);
1.75 @@ -1878,20 +1854,20 @@
1.76
1.77 //tabWidget->currentPage() won't be NULL here, because of above...
1.78 tabWidget->setCurrentIndex (tabIndex);
1.79 - me->viewport()->setFocus();
1.80 + //FIXME no me anymore... me->viewport()->setFocus();
1.81
1.82 if (err!=aborted)
1.83 {
1.84 // Save existing filename in case we import
1.85 - QString fn_org=me->getModel()->getFilePath();
1.86 + QString fn_org=vm->getFilePath();
1.87
1.88 // Finally load map into mapEditor
1.89 - me->getModel()->setFilePath (fn);
1.90 - err=me->getModel()->load(fn,lmode,ftype);
1.91 + vm->setFilePath (fn);
1.92 + err=vm->load(fn,lmode,ftype);
1.93
1.94 // Restore old (maybe empty) filepath, if this is an import
1.95 if (lmode!=NewMap)
1.96 - me->getModel()->setFilePath (fn_org);
1.97 + vm->setFilePath (fn_org);
1.98 }
1.99
1.100 // Finally check for errors and go home
1.101 @@ -1903,13 +1879,13 @@
1.102 {
1.103 if (lmode==NewMap)
1.104 {
1.105 - me->getModel()->setFilePath (fn);
1.106 - tabWidget->setTabText (tabIndex, me->getModel()->getFileName());
1.107 + vm->setFilePath (fn);
1.108 + tabWidget->setTabText (tabIndex, vm->getFileName());
1.109 if (!isInTmpDir (fn))
1.110 {
1.111 // Only append to lastMaps if not loaded from a tmpDir
1.112 // e.g. imported bookmarks are in a tmpDir
1.113 - addRecentMap(me->getModel()->getFilePath() );
1.114 + addRecentMap(vm->getFilePath() );
1.115 }
1.116 actionFilePrint->setEnabled (true);
1.117 }