X-Git-Url: http://git.tdb.fi/?a=blobdiff_plain;f=source%2Fengineer%2Ftimetabledialog.cpp;h=1c7c907d25959904f5dc326a345a058af50f12b9;hb=f74ce147edde73319e55475433adb8e1d87b7201;hp=978b14bcb53a9e73d0e82fb913a1862ca05ab540;hpb=cf52013784607dc4d307bd1244c5346ee88336a4;p=r2c2.git diff --git a/source/engineer/timetabledialog.cpp b/source/engineer/timetabledialog.cpp index 978b14b..1c7c907 100644 --- a/source/engineer/timetabledialog.cpp +++ b/source/engineer/timetabledialog.cpp @@ -19,7 +19,7 @@ TimetableDialog::TimetableDialog(const GLtk::Resources &r, Timetable &tt): GLtk::Dialog(r), timetable(tt) { - set_size(200, 200); + set_size(250, 200); GLtk::Button *btn; @@ -38,6 +38,7 @@ TimetableDialog::TimetableDialog(const GLtk::Resources &r, Timetable &tt): add(*(ent_timetable = new GLtk::Entry(res))); ent_timetable->set_geometry(GLtk::Geometry(10, 45, geom.w-20, geom.h-55)); + ent_timetable->set_style("multiline"); ent_timetable->set_multiline(true); string text; @@ -53,13 +54,13 @@ TimetableDialog::TimetableDialog(const GLtk::Resources &r, Timetable &tt): void TimetableDialog::enabled_toggled(bool value) { timetable.set_enabled(value); + timetable.reset(); } void TimetableDialog::on_response(int code) { if(code) { - timetable.clear(); vector lines = split(ent_timetable->get_text(), '\n'); vector rows; rows.reserve(lines.size()); @@ -67,6 +68,7 @@ void TimetableDialog::on_response(int code) { for(vector::const_iterator i=lines.begin(); i!=lines.end(); ++i) rows.push_back(Timetable::Row::parse(*i)); + timetable.clear(); for(vector::const_iterator i=rows.begin(); i!=rows.end(); ++i) timetable.append(*i); }