Go to the documentation of this file.00001 #include "GPS.h"
00002 #include <stdio.h>
00003
00004
00005 Gps::Gps(){
00006
00007
00008 }
00009
00010
00011 void Gps::set_map_type(QString value)
00012
00013 {
00014
00015 }
00016
00017 void Gps::check_size()
00018
00019 {
00020
00021 }
00022
00023 void Gps::set_zoom(int value)
00024
00025 {
00026
00027 }
00028
00029 void Gps::update_coord(double lat, double lon)
00030
00031 {
00032
00033
00034 }
00035
00036
00037 void Gps::selection_changed()
00038
00039 {
00040
00041 }
00042
00043 void Gps::start_clicked()
00044
00045 {
00046 started = true;
00047 path.clear();
00048 QList<QListWidgetItem *> l = list_widget->findItems(QString("New Itinerary"),Qt::MatchExactly);
00049 if(l.count()==0)
00050 list_widget->insertItem(0,QString("New Itinerary"));
00051 list_widget->setCurrentItem(list_widget->item(0));
00052
00053 }
00054
00055 void Gps::stop_clicked()
00056
00057 {
00058 started = false;
00059 start_pos_set = false;
00060
00061 }
00062
00063 void Gps::save_clicked()
00064
00065 {
00066 QList<QListWidgetItem *> l = list_widget->findItems(QString("New Itinerary"),Qt::MatchExactly);
00067 if(l.count() != 0){
00068 QString file = QFileDialog::getSaveFileName();
00069 FILE *f;
00070 QByteArray ba = file.toLatin1();
00071 if((f = fopen(ba.data(),"w+"))!=NULL){
00072 ba = path.toLatin1();
00073 fprintf(f,"%s",ba.data());
00074 fclose(f);
00075 QListWidgetItem *tmp = list_widget->takeItem(0);
00076 delete tmp;
00077
00078 list_widget->addItem(file);
00079 loaded_files.append(path);
00080 }
00081 }
00082 }
00083
00084 void Gps::setList(QListWidget *l)
00085
00086 {
00087 list_widget = l;
00088 }
00089
00090 void Gps::load_clicked()
00091
00092 {
00093 QStringList files = QFileDialog::getOpenFileNames();
00094
00095 FILE *f;
00096 QByteArray ba;
00097 foreach (QString s, files) {
00098 ba = s.toLatin1();
00099 f = fopen(ba.data(),"r+");
00100 char* c = (char*) malloc (10000);
00101
00102 if(fgets(c,10000,f)!=NULL){
00103 QString *s = new QString(c);
00104 loaded_files.append(*s);
00105 list_widget->addItem(ba.data());
00106 list_widget->setCurrentItem(list_widget->item(list_widget->count() - 1));
00107 delete s;
00108 }
00109 fclose(f);
00110
00111
00112 }
00113 url.removeQueryItem("markers");
00114 check_size();
00115 selection_changed();
00116
00117 }
00118