tmis 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/tmis/engine/import/spreadsheet_roo.rb +4 -3
- data/lib/tmis/engine/import/timetable_reader.rb +0 -1
- data/lib/tmis/interface/forms/export_general_timetable.rb +1 -1
- data/lib/tmis/interface/forms/export_group_timetable.rb +1 -1
- data/lib/tmis/interface/forms/export_lecturer_timetable.rb +1 -1
- data/lib/tmis/interface/forms/ui_about.rb +1 -1
- data/lib/tmis/interface/forms/ui_console.rb +1 -1
- data/lib/tmis/interface/forms/ui_debug_console.rb +1 -1
- data/lib/tmis/interface/forms/ui_edit_study.rb +1 -1
- data/lib/tmis/interface/forms/ui_expand_changes.rb +1 -1
- data/lib/tmis/interface/forms/ui_export_general_timetable.rb +1 -1
- data/lib/tmis/interface/forms/ui_export_group_timetable.rb +1 -1
- data/lib/tmis/interface/forms/ui_export_lecturer_timetable.rb +1 -1
- data/lib/tmis/interface/forms/ui_find.rb +1 -1
- data/lib/tmis/interface/forms/ui_import.rb +1 -1
- data/lib/tmis/interface/forms/ui_settings.rb +1 -1
- data/lib/tmis/interface/mainwindow.rb +5 -3
- data/lib/tmis/interface/models/speciality_subject_table_model.rb +8 -2
- data/lib/tmis/interface/ui_mainwindow.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4cc7538f20247e8ad56a375fd38dab9cc0d77b0
|
4
|
+
data.tar.gz: 938a8e400a59287bdba3b68b48c871fc0625c9c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3e6889c713b4c4a2fe7b7b9a62338c63a25a17bb103b1084ae7b93ae41cb09b94fdceee53c716d2b61dc5a81034b58eb0e39bbb7d78059c935c13070a0f825ba
|
7
|
+
data.tar.gz: 7c5111415e6295849d839d5ff20cf533e1d223dafcaa1b044e3b6bc2955c9b7442f794638de40c877e8ef68c37b17f66365482f4678bc54e2f4ce1abc4ada508
|
@@ -14,8 +14,8 @@ class SpreadsheetRoo < AbstractSpreadsheet
|
|
14
14
|
|
15
15
|
##Contract String => Any
|
16
16
|
def initialize(filepath)
|
17
|
-
@filepath = filepath
|
18
|
-
@sheet = Roo::Spreadsheet.open(filepath)
|
17
|
+
@filepath = filepath.force_encoding("UTF-8")
|
18
|
+
@sheet = Roo::Spreadsheet.open(@filepath)
|
19
19
|
@sheet.default_sheet = 0
|
20
20
|
end
|
21
21
|
|
@@ -57,7 +57,7 @@ class SpreadsheetSpreadsheet < AbstractSpreadsheet
|
|
57
57
|
|
58
58
|
#Contract String => Any
|
59
59
|
def initialize(filepath)
|
60
|
-
@filepath = filepath
|
60
|
+
@filepath = filepath.force_encoding("UTF-8")
|
61
61
|
Spreadsheet.client_encoding = 'UTF-8'
|
62
62
|
if File.file?(@filepath)
|
63
63
|
@book = Spreadsheet.open(@filepath)
|
@@ -127,6 +127,7 @@ end
|
|
127
127
|
class SpreadsheetCreater
|
128
128
|
#Contract String => Or[IsA[AbstractSpreadsheet], IsA[WritableSpreadsheet]]
|
129
129
|
def self.create(filename)
|
130
|
+
filename = filename.force_encoding("UTF-8")
|
130
131
|
if filename =~ /.*.csv/
|
131
132
|
SpreadsheetRoo.new(File.expand_path(filename))
|
132
133
|
else
|
@@ -23,7 +23,7 @@ class ExportGeneralTimetableDialog < Qt::Dialog
|
|
23
23
|
end
|
24
24
|
|
25
25
|
def on_browsePushButton_clicked
|
26
|
-
@ui.pathLineEdit.text = Qt::FileDialog::getSaveFileName(self, 'Save File',
|
26
|
+
@ui.pathLineEdit.text = Qt::FileDialog::getSaveFileName(self, 'Save File', "#{Dir.home}/NewTimetable", 'XLS Spreadsheet(*.xls)')
|
27
27
|
end
|
28
28
|
|
29
29
|
def on_exportButtonBox_accepted
|
@@ -38,7 +38,7 @@ class ExportGroupTimetableDialog < Qt::Dialog
|
|
38
38
|
|
39
39
|
def on_saveCheckBox_toggled(checked)
|
40
40
|
if checked
|
41
|
-
if (path = Qt::FileDialog::getExistingDirectory(self, 'Open Directory',
|
41
|
+
if (path = Qt::FileDialog::getExistingDirectory(self, 'Open Directory', Dir.home, Qt::FileDialog::ShowDirsOnly | Qt::FileDialog::DontResolveSymlinks))
|
42
42
|
@ui.folderPathLineEdit.text = path # force_encoding doesn't help because Qt changes the encoding to ASCII anyway
|
43
43
|
else
|
44
44
|
@ui.folderPathLineEdit.text = Dir.home
|
@@ -38,7 +38,7 @@ class ExportLecturerTimetableDialog < Qt::Dialog
|
|
38
38
|
|
39
39
|
def on_saveCheckBox_toggled(checked)
|
40
40
|
if checked
|
41
|
-
if (path = Qt::FileDialog::getExistingDirectory(self, 'Open Directory',
|
41
|
+
if (path = Qt::FileDialog::getExistingDirectory(self, 'Open Directory', Dir.home, Qt::FileDialog::ShowDirsOnly | Qt::FileDialog::DontResolveSymlinks))
|
42
42
|
@ui.folderPathLineEdit.text = path # force_encoding doesn't help because Qt changes the encoding to ASCII anyway
|
43
43
|
else
|
44
44
|
@ui.folderPathLineEdit.text = Dir.home
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'about.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:25 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'console.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:25 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'debug_console.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:25 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'edit_study.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:25 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'expand_changes.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:25 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'export_general_timetable.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:24 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'export_group_timetable.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:25 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'export_lecturer_timetable.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:25 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'find.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:25 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'import.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:24 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'settings.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:24 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|
@@ -221,7 +221,8 @@ class MainWindow < Qt::MainWindow
|
|
221
221
|
end
|
222
222
|
|
223
223
|
def on_openAction_triggered
|
224
|
-
if (filename = Qt::FileDialog::getOpenFileName(self, 'Open File',
|
224
|
+
if (filename = Qt::FileDialog::getOpenFileName(self, 'Open File', Dir.home, 'TMIS databases (SQLite3)(*.sqlite)'))
|
225
|
+
filename = filename.force_encoding("UTF-8")
|
225
226
|
Database.instance.connect_to filename
|
226
227
|
update_recent filename
|
227
228
|
show_tables
|
@@ -232,7 +233,7 @@ class MainWindow < Qt::MainWindow
|
|
232
233
|
end
|
233
234
|
|
234
235
|
def on_saveAsAction_triggered
|
235
|
-
if (filename = Qt::FileDialog::getSaveFileName(self, 'Save File',
|
236
|
+
if (filename = Qt::FileDialog::getSaveFileName(self, 'Save File', "#{Dir.home}/NewTimetable.sqlite", 'TMIS databases (SQLite3)(*.sqlite)'))
|
236
237
|
filename.force_encoding('UTF-8')
|
237
238
|
FileUtils.cp(Database.instance.path, filename) unless Database.instance.path == filename
|
238
239
|
Database.instance.connect_to filename
|
@@ -243,7 +244,8 @@ class MainWindow < Qt::MainWindow
|
|
243
244
|
|
244
245
|
def on_importAction_triggered
|
245
246
|
please_wait do
|
246
|
-
if (filename = Qt::FileDialog::getOpenFileName(self, 'Open File',
|
247
|
+
if (filename = Qt::FileDialog::getOpenFileName(self, 'Open File', Dir.home, 'Spreadsheets(*.xls *.xlsx *.ods *.csv)'))
|
248
|
+
filename = filename.force_encoding('UTF-8')
|
247
249
|
if Database.instance.connected?
|
248
250
|
(id = ImportDialog.new(Date.parse(@ui.dateDateEdit.date.toString(Qt::ISODate)))).exec
|
249
251
|
else
|
@@ -58,7 +58,10 @@ class SpecialitySubjectTableModel < Qt::AbstractTableModel
|
|
58
58
|
when 6
|
59
59
|
speciality_subject.consultations_hours
|
60
60
|
when 7
|
61
|
-
speciality_subject.lecture_hours
|
61
|
+
[speciality_subject.lecture_hours,
|
62
|
+
speciality_subject.practical_hours,
|
63
|
+
speciality_subject.consultations_hours ].
|
64
|
+
keep_if{|x| x.respond_to?(:+) }.inject(:+)
|
62
65
|
when 8
|
63
66
|
speciality_subject.preffered_days
|
64
67
|
when 9
|
@@ -83,7 +86,10 @@ class SpecialitySubjectTableModel < Qt::AbstractTableModel
|
|
83
86
|
when 6
|
84
87
|
speciality_subject.consultations_hours
|
85
88
|
when 7
|
86
|
-
speciality_subject.lecture_hours
|
89
|
+
[speciality_subject.lecture_hours,
|
90
|
+
speciality_subject.practical_hours,
|
91
|
+
speciality_subject.consultations_hours ].
|
92
|
+
keep_if{|x| x.respond_to?(:+) }.inject(:+)
|
87
93
|
when 8
|
88
94
|
speciality_subject.preffered_days
|
89
95
|
when 9
|
@@ -1,7 +1,7 @@
|
|
1
1
|
=begin
|
2
2
|
** Form generated from reading ui file 'mainwindow.ui'
|
3
3
|
**
|
4
|
-
** Created: Wed Sep 4
|
4
|
+
** Created: Wed Sep 4 12:32:24 2013
|
5
5
|
** by: Qt User Interface Compiler version 4.8.5
|
6
6
|
**
|
7
7
|
** WARNING! All changes made in this file will be lost when recompiling ui file!
|