- Timestamp:
- 07/04/11 23:42:02 (12 years ago)
- Branches:
- master, qt5
- Children:
- 526128c
- Parents:
- 8dd3dd2
- Location:
- src/gui
- Files:
-
- 3 deleted
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
src/gui/conferenceeditor.cpp
r8dd3dd2 re6ab8a2 22 22 #include "conferencemodel.h" 23 23 #include "urlinputdialog.h" 24 #include "mapwindow.h"25 24 #include "errormessage.h" 26 25 … … 51 50 connect(changeUrl, SIGNAL(clicked()), SLOT(changeUrlClicked())); 52 51 connect(refreshBtn, SIGNAL(clicked()), SLOT(refreshClicked())); 53 connect(showMapButton, SIGNAL(clicked()), SLOT(conferenceMapClicked()));54 52 connect(buttonBox, SIGNAL(rejected()), SLOT(close())); 55 53 … … 97 95 + ", " + 98 96 conf.end().toString("dd-MM-yyyy")); 99 100 QString map = conf.map();101 if (map.isEmpty()) {102 showMapButton->hide();103 } else {104 showMapButton->show();105 }106 107 97 conferenceInfo->setCurrentIndex(0); 108 98 removeBtn->show(); … … 220 210 } 221 211 222 void ConferenceEditor::conferenceMapClicked()223 {224 Conference conf = Conference::getById(selected_id);225 QString mapPath = conf.map();226 if(mapPath.isEmpty() or !QFile::exists(mapPath)) {227 error_message("Map is not available");228 return;229 }230 231 QString roomName;232 233 QPixmap map(mapPath);234 MapWindow window(map,roomName,this);235 window.exec();236 } -
src/gui/conferenceeditor.h
r8dd3dd2 re6ab8a2 65 65 void changeUrlClicked(); 66 66 void refreshClicked(); 67 void conferenceMapClicked();68 67 69 68 private: -
src/gui/conferenceeditor.ui
r8dd3dd2 re6ab8a2 217 217 </item> 218 218 <item row="1" column="3"> 219 <widget class="QPushButton" name="showMapButton">220 <property name="text">221 <string>MAP</string>222 </property>223 <property name="icon">224 <iconset resource="../icons.qrc">225 <normaloff>:/icons/applications-internet.png</normaloff>:/icons/applications-internet.png</iconset>226 </property>227 <property name="flat">228 <bool>true</bool>229 </property>230 </widget>231 </item>232 <item row="1" column="4">233 219 <spacer name="horizontalSpacer_4"> 234 220 <property name="orientation"> -
src/gui/gui.pro
r8dd3dd2 re6ab8a2 44 44 conflictsdialog.ui \ 45 45 tabcontainer.ui \ 46 mapwindow.ui \47 46 settingsdialog.ui \ 48 47 conferenceeditor.ui \ … … 62 61 eventdialog.h \ 63 62 tabcontainer.h \ 64 mapwindow.h \65 63 settingsdialog.h \ 66 64 conferenceeditor.h \ … … 80 78 eventdialog.cpp \ 81 79 tabcontainer.cpp \ 82 mapwindow.cpp \83 80 settingsdialog.cpp \ 84 81 conferenceeditor.cpp \ -
src/gui/tabcontainer.cpp
r8dd3dd2 re6ab8a2 28 28 29 29 #include "eventdialog.h" 30 #include "mapwindow.h"31 30 #include "room.h" 32 31 #include "errormessage.h" … … 50 49 connect(treeView, SIGNAL(eventHasChanged(int,bool)), SIGNAL(eventHasChanged(int,bool))); 51 50 connect(treeView, SIGNAL(clicked(const QModelIndex &)), SLOT(itemClicked(const QModelIndex &))); 52 connect(treeView, SIGNAL(requestForMap(const QModelIndex &)), SLOT(displayMap(const QModelIndex &)));53 51 connect(treeView, SIGNAL(requestForConflicts(const QModelIndex &)), SLOT(displayConflicts(const QModelIndex &))); 54 52 … … 81 79 dialog.exec(); 82 80 disconnect(&dialog, SIGNAL(eventHasChanged(int,bool)), this, SIGNAL(eventHasChanged(int,bool))); 83 }84 85 void TabContainer::displayMap(const QModelIndex &aIndex)86 {87 Event *event = static_cast<Event*>(aIndex.internalPointer());88 89 QVariant mapPathV = event->room()->map();90 QString mapPath;91 if (!mapPathV.isValid()) {92 error_message("No map for this room");93 return;94 } else {95 mapPath = mapPathV.toString();96 if (!QFile::exists(mapPath)) {97 error_message("Map for this room not found: " + mapPath);98 return;99 }100 }101 102 QPixmap map(mapPath);103 MapWindow window(map, event->room()->name(),this);104 window.exec();105 81 } 106 82 -
src/gui/tabcontainer.h
r8dd3dd2 re6ab8a2 51 51 virtual void updateTreeView(const QDate &aDate); 52 52 void itemClicked(const QModelIndex &aIndex); 53 void displayMap(const QModelIndex &aIndex);54 53 void displayConflicts(const QModelIndex &aIndex); 55 54 };
Note: See TracChangeset
for help on using the changeset viewer.