Browse Source

First release ;-)

Kolan Sh 3 years ago
parent
commit
7f48d3c371

+ 6
- 0
.gitmodules View File

@@ -0,0 +1,6 @@
1
+[submodule "cmake/backbone"]
2
+	path = cmake/backbone
3
+	url = git@git.backbone.ws:cmake/backbone.git
4
+[submodule "util/backbone"]
5
+	path = util/backbone
6
+	url = git@git.backbone.ws:cmake/backbone-utils.git

+ 1
- 0
AUTHORS View File

@@ -0,0 +1 @@
1
+Kolan Sh <backbone@backbone.ws>

+ 24
- 0
CMakeLists.txt View File

@@ -0,0 +1,24 @@
1
+PROJECT (LAviewDesktop C)
2
+
3
+CMAKE_MINIMUM_REQUIRED (VERSION 2.8)
4
+
5
+SET (PROJECT_LOWERCASE_NAME "laview-desktop")
6
+SET (PROJECT_DESCRIPTION "LAview Desktop Application.")
7
+
8
+SET (MAJOR 0)
9
+SET (MINOR 0)
10
+SET (PATCH 0)
11
+
12
+LIST (APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/cmake/backbone)
13
+
14
+ADD_SUBDIRECTORY (config)
15
+ADD_SUBDIRECTORY (src)
16
+ADD_SUBDIRECTORY (po)
17
+ADD_SUBDIRECTORY (pkg-config)
18
+ADD_SUBDIRECTORY (test)
19
+ADD_SUBDIRECTORY (cpack)
20
+ADD_SUBDIRECTORY (ui)
21
+ADD_SUBDIRECTORY (res)
22
+
23
+# enable testing
24
+ENABLE_TESTING ()

+ 165
- 0
COPYING View File

@@ -0,0 +1,165 @@
1
+                   GNU LESSER GENERAL PUBLIC LICENSE
2
+                       Version 3, 29 June 2007
3
+
4
+ Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
5
+ Everyone is permitted to copy and distribute verbatim copies
6
+ of this license document, but changing it is not allowed.
7
+
8
+
9
+  This version of the GNU Lesser General Public License incorporates
10
+the terms and conditions of version 3 of the GNU General Public
11
+License, supplemented by the additional permissions listed below.
12
+
13
+  0. Additional Definitions.
14
+
15
+  As used herein, "this License" refers to version 3 of the GNU Lesser
16
+General Public License, and the "GNU GPL" refers to version 3 of the GNU
17
+General Public License.
18
+
19
+  "The Library" refers to a covered work governed by this License,
20
+other than an Application or a Combined Work as defined below.
21
+
22
+  An "Application" is any work that makes use of an interface provided
23
+by the Library, but which is not otherwise based on the Library.
24
+Defining a subclass of a class defined by the Library is deemed a mode
25
+of using an interface provided by the Library.
26
+
27
+  A "Combined Work" is a work produced by combining or linking an
28
+Application with the Library.  The particular version of the Library
29
+with which the Combined Work was made is also called the "Linked
30
+Version".
31
+
32
+  The "Minimal Corresponding Source" for a Combined Work means the
33
+Corresponding Source for the Combined Work, excluding any source code
34
+for portions of the Combined Work that, considered in isolation, are
35
+based on the Application, and not on the Linked Version.
36
+
37
+  The "Corresponding Application Code" for a Combined Work means the
38
+object code and/or source code for the Application, including any data
39
+and utility programs needed for reproducing the Combined Work from the
40
+Application, but excluding the System Libraries of the Combined Work.
41
+
42
+  1. Exception to Section 3 of the GNU GPL.
43
+
44
+  You may convey a covered work under sections 3 and 4 of this License
45
+without being bound by section 3 of the GNU GPL.
46
+
47
+  2. Conveying Modified Versions.
48
+
49
+  If you modify a copy of the Library, and, in your modifications, a
50
+facility refers to a function or data to be supplied by an Application
51
+that uses the facility (other than as an argument passed when the
52
+facility is invoked), then you may convey a copy of the modified
53
+version:
54
+
55
+   a) under this License, provided that you make a good faith effort to
56
+   ensure that, in the event an Application does not supply the
57
+   function or data, the facility still operates, and performs
58
+   whatever part of its purpose remains meaningful, or
59
+
60
+   b) under the GNU GPL, with none of the additional permissions of
61
+   this License applicable to that copy.
62
+
63
+  3. Object Code Incorporating Material from Library Header Files.
64
+
65
+  The object code form of an Application may incorporate material from
66
+a header file that is part of the Library.  You may convey such object
67
+code under terms of your choice, provided that, if the incorporated
68
+material is not limited to numerical parameters, data structure
69
+layouts and accessors, or small macros, inline functions and templates
70
+(ten or fewer lines in length), you do both of the following:
71
+
72
+   a) Give prominent notice with each copy of the object code that the
73
+   Library is used in it and that the Library and its use are
74
+   covered by this License.
75
+
76
+   b) Accompany the object code with a copy of the GNU GPL and this license
77
+   document.
78
+
79
+  4. Combined Works.
80
+
81
+  You may convey a Combined Work under terms of your choice that,
82
+taken together, effectively do not restrict modification of the
83
+portions of the Library contained in the Combined Work and reverse
84
+engineering for debugging such modifications, if you also do each of
85
+the following:
86
+
87
+   a) Give prominent notice with each copy of the Combined Work that
88
+   the Library is used in it and that the Library and its use are
89
+   covered by this License.
90
+
91
+   b) Accompany the Combined Work with a copy of the GNU GPL and this license
92
+   document.
93
+
94
+   c) For a Combined Work that displays copyright notices during
95
+   execution, include the copyright notice for the Library among
96
+   these notices, as well as a reference directing the user to the
97
+   copies of the GNU GPL and this license document.
98
+
99
+   d) Do one of the following:
100
+
101
+       0) Convey the Minimal Corresponding Source under the terms of this
102
+       License, and the Corresponding Application Code in a form
103
+       suitable for, and under terms that permit, the user to
104
+       recombine or relink the Application with a modified version of
105
+       the Linked Version to produce a modified Combined Work, in the
106
+       manner specified by section 6 of the GNU GPL for conveying
107
+       Corresponding Source.
108
+
109
+       1) Use a suitable shared library mechanism for linking with the
110
+       Library.  A suitable mechanism is one that (a) uses at run time
111
+       a copy of the Library already present on the user's computer
112
+       system, and (b) will operate properly with a modified version
113
+       of the Library that is interface-compatible with the Linked
114
+       Version.
115
+
116
+   e) Provide Installation Information, but only if you would otherwise
117
+   be required to provide such information under section 6 of the
118
+   GNU GPL, and only to the extent that such information is
119
+   necessary to install and execute a modified version of the
120
+   Combined Work produced by recombining or relinking the
121
+   Application with a modified version of the Linked Version. (If
122
+   you use option 4d0, the Installation Information must accompany
123
+   the Minimal Corresponding Source and Corresponding Application
124
+   Code. If you use option 4d1, you must provide the Installation
125
+   Information in the manner specified by section 6 of the GNU GPL
126
+   for conveying Corresponding Source.)
127
+
128
+  5. Combined Libraries.
129
+
130
+  You may place library facilities that are a work based on the
131
+Library side by side in a single library together with other library
132
+facilities that are not Applications and are not covered by this
133
+License, and convey such a combined library under terms of your
134
+choice, if you do both of the following:
135
+
136
+   a) Accompany the combined library with a copy of the same work based
137
+   on the Library, uncombined with any other library facilities,
138
+   conveyed under the terms of this License.
139
+
140
+   b) Give prominent notice with the combined library that part of it
141
+   is a work based on the Library, and explaining where to find the
142
+   accompanying uncombined form of the same work.
143
+
144
+  6. Revised Versions of the GNU Lesser General Public License.
145
+
146
+  The Free Software Foundation may publish revised and/or new versions
147
+of the GNU Lesser General Public License from time to time. Such new
148
+versions will be similar in spirit to the present version, but may
149
+differ in detail to address new problems or concerns.
150
+
151
+  Each version is given a distinguishing version number. If the
152
+Library as you received it specifies that a certain numbered version
153
+of the GNU Lesser General Public License "or any later version"
154
+applies to it, you have the option of following the terms and
155
+conditions either of that published version or of any later version
156
+published by the Free Software Foundation. If the Library as you
157
+received it does not specify a version number of the GNU Lesser
158
+General Public License, you may choose any version of the GNU Lesser
159
+General Public License ever published by the Free Software Foundation.
160
+
161
+  If the Library as you received it specifies that a proxy can decide
162
+whether future versions of the GNU Lesser General Public License shall
163
+apply, that proxy's public statement of acceptance of any version is
164
+permanent authorization for you to choose that version for the
165
+Library.

+ 85
- 0
INSTALL View File

@@ -0,0 +1,85 @@
1
+    Requirements
2
+    ------------
3
+
4
+    Build-Time Dependencies
5
+
6
+LAview-Core: https://redmine.backbone.ws/projects/laview-core
7
+GTK+-3:http://www.gtk.org/
8
+CMake: http://www.cmake.org
9
+NSIS (W32): http://nsis.sourceforge.net
10
+
11
+    Run-Time Dependencies
12
+
13
+GTK+-3:http://www.gtk.org/
14
+LAview-Core: https://redmine.backbone.ws/projects/laview-core
15
+
16
+    Operation Systems
17
+
18
+ * GNU/Linux (Gentoo, Debian, etc.)
19
+ * MS Windows (Windows 5.1 aka XP)
20
+ * BSD-based (FreeBSD, OpenBSD, NetBSD, Mac OS X)
21
+
22
+If you need support of one more OS, be free in writing of patches and sending
23
+pull-requests to the mainstream.
24
+
25
+
26
+    Compilation
27
+    -----------
28
+
29
+    Compilation under GNU/Linux
30
+
31
+$ mkdir build-gcc && cd build-gcc
32
+$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr
33
+$ make -j$((`getconf _NPROCESSORS_ONLN`+1))
34
+
35
+    Compilation under MS Windows
36
+
37
+$ mkdir build-mingw && cd build-mingw
38
+$ cmake -G "MSYS Makefiles" .. -DCMAKE_BUILD_TYPE=Release
39
+$ make -j$((NUMBER_OF_PROCESSORS + 1))
40
+
41
+    Compilation under BSD-based Systems.
42
+
43
+TODO: add description here.
44
+
45
+
46
+    Packing/Installation
47
+    --------------------
48
+
49
+    Packing/Installation under GNU/Linux
50
+
51
+$ cpack
52
+Install using System Package Manager.
53
+
54
+    Packing/Installation under MS Windows
55
+
56
+$ cpack
57
+Install using generated by NSIS executable.
58
+
59
+    Packing/Installation under BSD-based
60
+
61
+$ cpack
62
+Install using System Package Manager.
63
+
64
+
65
+    Testing
66
+    -------
67
+
68
+    Testing under GNU/Linux
69
+
70
+$ ctest -j$((`getconf _NPROCESSORS_ONLN`+1))
71
+
72
+Automated tests for memory leaks:
73
+$ ctest -j$((NUMBER_OF_PROCESSORS + 1)) -D NightlyMemCheck && grep definitely Testing/Temporary/LastDynamicAnalysis_*.log
74
+
75
+    Testing under MS Windows
76
+
77
+$ ctest -j$((NUMBER_OF_PROCESSORS + 1))
78
+Automated tests for memory leaks are not available as far as Valgrind not
79
+present on this platform.
80
+
81
+    Testing under BSD-based
82
+
83
+$ ctest
84
+Automated tests for memory leaks are not available as far as Valgrind not
85
+present on this platform.

+ 2
- 0
MAINTAINERS View File

@@ -0,0 +1,2 @@
1
+Kolan Sh
2
+email: backbone@backbone.ws

+ 1
- 1
README View File

@@ -1 +1 @@
1
-Desktop LAview Application.
1
+LAview Desktop Application.

+ 1
- 0
cmake/backbone

@@ -0,0 +1 @@
1
+Subproject commit 126f4cc3fecf5f9c8ad3dd55edc164801f64482a

+ 5
- 0
config/CMakeLists.txt View File

@@ -0,0 +1,5 @@
1
+SET (GSchemaFile "ws.backbone.laview.desktop")
2
+INCLUDE (GSchemaCommonRules)
3
+
4
+CONFIGURE_FILE ("${CMAKE_CURRENT_SOURCE_DIR}/config.h.in"
5
+                "${CMAKE_CURRENT_BINARY_DIR}/config.h")

+ 6
- 0
config/Config.vapi View File

@@ -0,0 +1,6 @@
1
+[CCode (cheader_filename = "config.h")]
2
+namespace Config {
3
+	static const int VERSION_MAJOR;
4
+	static const int VERSION_MINOR;
5
+	static const int VERSION_PATCH;
6
+}

+ 3
- 0
config/config.h.in View File

@@ -0,0 +1,3 @@
1
+#define CONFIG_VERSION_MAJOR @MAJOR@
2
+#define CONFIG_VERSION_MINOR @MINOR@
3
+#define CONFIG_VERSION_PATCH @PATCH@

+ 23
- 0
config/ws.backbone.laview.desktop.gschema.xml View File

@@ -0,0 +1,23 @@
1
+<schemalist>
2
+    <schema id="ws.backbone.lavew.desktop-@MAJOR@" path="/ws/backbone/laview/desktop-@MAJOR@/" gettext-domain="laview-desktop-@MAJOR@">
3
+
4
+        <key name="greeting" type="s">
5
+            <default l10n="messages">"Hello, earthlings"</default>
6
+            <summary>A greeting</summary>
7
+            <description>Greeting of the invading martians</description>
8
+        </key>
9
+
10
+        <key name="bottles-of-beer" type="i">
11
+            <default>99</default>
12
+            <summary>Bottles of beer</summary>
13
+            <description>Number of bottles of beer on the wall</description>
14
+        </key>
15
+
16
+        <key name="lighting" type="b">
17
+            <default>false</default>
18
+            <summary>Is the light switched on?</summary>
19
+            <description>State of an imaginary light switch.</description>
20
+        </key>
21
+
22
+    </schema>
23
+</schemalist>

+ 14
- 0
cpack/CMakeLists.txt View File

@@ -0,0 +1,14 @@
1
+SET (CONTACT "backbone@backbone.ws")
2
+SET (DEBIAN_DEPENDENCIES "laview-core-0 >= 0.0.0")
3
+SET (DEBIAN_SECTION "TeX")
4
+SET (REDHAT_DEPENDENCIES "laview-core-0 >= 0.0.0")
5
+SET (REDHAT_SECTION "Applications/Publishing")
6
+SET (LICENSE "LGPLv3+")
7
+SET (WIN32_UNINSTALL_NAME "LAvDesk") # <= 8 symbols for the name
8
+
9
+SET (CPACK_PACKAGE_EXECUTABLES "${PROJECT_LOWERCASE_NAME}-${MAJOR};LAview Desktop")
10
+SET (CPACK_NSIS_INSTALLED_ICON_NAME bin\\\\${PROJECT_LOWERCASE_NAME}-${MAJOR}.exe)
11
+SET (CPACK_CREATE_DESKTOP_LINKS "${PROJECT_LOWERCASE_NAME}-${MAJOR}")
12
+SET (CPACK_NSIS_MENU_LINKS "https://redmine.backbone.ws/projects/laview/wiki" "Homepage for LAview Desktop")
13
+
14
+INCLUDE (CPackCommonRules)

+ 6
- 0
pkg-config/CMakeLists.txt View File

@@ -0,0 +1,6 @@
1
+INCLUDE (PkgConfigCommonRules)
2
+
3
+CONFIGURE_FILE (
4
+  "${CMAKE_SOURCE_DIR}/cmake/backbone/templates/pkg-config.pc.in"
5
+  "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOWERCASE_NAME}-${MAJOR}.pc"
6
+)

+ 1
- 0
po/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+INCLUDE (GettextCommonRules)

+ 1
- 0
po/de/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+INCLUDE (GettextLangRules)

+ 196
- 0
po/de/laview-desktop.po View File

@@ -0,0 +1,196 @@
1
+# German translations for laview-desktop package.
2
+# Copyright (C) 2015 THE laview-desktop'S COPYRIGHT HOLDER
3
+# This file is distributed under the same license as the laview-desktop package.
4
+#  <backbone@backbone.ws>, 2015.
5
+#
6
+msgid ""
7
+msgstr ""
8
+"Project-Id-Version: laview-desktop\n"
9
+"Report-Msgid-Bugs-To: \n"
10
+"POT-Creation-Date: 2015-12-27 19:03+0300\n"
11
+"PO-Revision-Date: 2015-10-24 20:19+0300\n"
12
+"Last-Translator:  <backbone@backbone.ws>\n"
13
+"Language-Team: German\n"
14
+"Language: de\n"
15
+"MIME-Version: 1.0\n"
16
+"Content-Type: text/plain; charset=UTF-8\n"
17
+"Content-Transfer-Encoding: 8bit\n"
18
+"Plural-Forms: nplurals=2; plural=(n != 1);\n"
19
+
20
+#: config/ws.backbone.laview.desktop.gschema.xml.h:1
21
+msgid "\"Hello, earthlings\""
22
+msgstr ""
23
+
24
+#: config/ws.backbone.laview.desktop.gschema.xml.h:2
25
+msgid "A greeting"
26
+msgstr ""
27
+
28
+#: config/ws.backbone.laview.desktop.gschema.xml.h:3
29
+msgid "Greeting of the invading martians"
30
+msgstr ""
31
+
32
+#: config/ws.backbone.laview.desktop.gschema.xml.h:4
33
+msgid "Bottles of beer"
34
+msgstr ""
35
+
36
+#: config/ws.backbone.laview.desktop.gschema.xml.h:5
37
+msgid "Number of bottles of beer on the wall"
38
+msgstr ""
39
+
40
+#: config/ws.backbone.laview.desktop.gschema.xml.h:6
41
+msgid "Is the light switched on?"
42
+msgstr ""
43
+
44
+#: config/ws.backbone.laview.desktop.gschema.xml.h:7
45
+msgid "State of an imaginary light switch."
46
+msgstr ""
47
+
48
+#: src/MainWindow.vala:84
49
+msgid "Select templates"
50
+msgstr ""
51
+
52
+#: src/MainWindow.vala:86
53
+msgid "_Cancel"
54
+msgstr ""
55
+
56
+#: src/MainWindow.vala:87
57
+msgid "_Open"
58
+msgstr ""
59
+
60
+#: src/main.vala:33
61
+msgid "Show the application's version"
62
+msgstr ""
63
+
64
+#: src/main.vala:52
65
+msgid "[FILE]"
66
+msgstr ""
67
+
68
+#: src/main.vala:64
69
+#, c-format
70
+msgid "Error: %s\n"
71
+msgstr ""
72
+
73
+#: src/main.vala:65
74
+#, c-format
75
+msgid "Run '%s --help' to see a full list of available command line options.\n"
76
+msgstr ""
77
+
78
+#: ui/glade/laview-desktop.glade.h:1
79
+msgid "Kolan Sh (backbone@backbone.ws)"
80
+msgstr ""
81
+
82
+#: ui/glade/laview-desktop.glade.h:2
83
+msgid "LaTeX View or View Data in LaTeX."
84
+msgstr ""
85
+
86
+#: ui/glade/laview-desktop.glade.h:3
87
+msgid "LAview"
88
+msgstr ""
89
+
90
+#: ui/glade/laview-desktop.glade.h:4
91
+msgid "Kolan Sh"
92
+msgstr ""
93
+
94
+#: ui/glade/laview-desktop.glade.h:5
95
+msgid "LAview Preferences"
96
+msgstr ""
97
+
98
+#: ui/glade/laview-desktop.glade.h:6
99
+msgid "Paths"
100
+msgstr ""
101
+
102
+#: ui/glade/laview-desktop.glade.h:7
103
+msgid "LyX path on Windows"
104
+msgstr ""
105
+
106
+#: ui/glade/laview-desktop.glade.h:8
107
+msgid "pdfLaTeX path on Windows"
108
+msgstr ""
109
+
110
+#: ui/glade/laview-desktop.glade.h:9
111
+msgid "Common"
112
+msgstr ""
113
+
114
+#: ui/glade/laview-desktop.glade.h:10
115
+msgid "Protocol Plugins"
116
+msgstr ""
117
+
118
+#: ui/glade/laview-desktop.glade.h:11
119
+msgid "Protocol plugins"
120
+msgstr ""
121
+
122
+#: ui/glade/laview-desktop.glade.h:12
123
+msgid "Data Plugins"
124
+msgstr ""
125
+
126
+#: ui/glade/laview-desktop.glade.h:13
127
+msgid "Data plugins"
128
+msgstr ""
129
+
130
+#: ui/glade/laview-desktop.glade.h:14
131
+msgid "LAview Desktop"
132
+msgstr ""
133
+
134
+#: ui/glade/laview-desktop.glade.h:15
135
+msgid "_Template"
136
+msgstr ""
137
+
138
+#: ui/glade/laview-desktop.glade.h:16
139
+msgid "_Document"
140
+msgstr ""
141
+
142
+#: ui/glade/laview-desktop.glade.h:17
143
+msgid "_Application"
144
+msgstr ""
145
+
146
+#: ui/glade/laview-desktop.glade.h:18
147
+msgid "_Help"
148
+msgstr ""
149
+
150
+#: ui/glade/laview-desktop.glade.h:19
151
+msgid "Create a new template"
152
+msgstr ""
153
+
154
+#: ui/glade/laview-desktop.glade.h:20
155
+msgid "Open a template"
156
+msgstr ""
157
+
158
+#: ui/glade/laview-desktop.glade.h:21
159
+msgid "Change selected template"
160
+msgstr ""
161
+
162
+#: ui/glade/laview-desktop.glade.h:22
163
+msgid "Delete selected template"
164
+msgstr ""
165
+
166
+#: ui/glade/laview-desktop.glade.h:23
167
+msgid "Document object preparing"
168
+msgstr ""
169
+
170
+#: ui/glade/laview-desktop.glade.h:24
171
+msgid "View and print the document"
172
+msgstr ""
173
+
174
+#: ui/glade/laview-desktop.glade.h:25
175
+msgid "Edit the result document"
176
+msgstr ""
177
+
178
+#: ui/glade/laview-desktop.glade.h:26
179
+msgid "Application preferences"
180
+msgstr ""
181
+
182
+#: ui/glade/laview-desktop.glade.h:27
183
+msgid "Help and reference"
184
+msgstr ""
185
+
186
+#: ui/glade/laview-desktop.glade.h:28
187
+msgid "Close the application"
188
+msgstr ""
189
+
190
+#: ui/glade/laview-desktop.glade.h:29
191
+msgid "Templates"
192
+msgstr ""
193
+
194
+#: ui/glade/laview-desktop.glade.h:30
195
+msgid "Document Objects"
196
+msgstr ""

+ 196
- 0
po/laview-desktop.pot View File

@@ -0,0 +1,196 @@
1
+# SOME DESCRIPTIVE TITLE.
2
+# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3
+# This file is distributed under the same license as the laview-desktop package.
4
+# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5
+#
6
+#, fuzzy
7
+msgid ""
8
+msgstr ""
9
+"Project-Id-Version: laview-desktop\n"
10
+"Report-Msgid-Bugs-To: \n"
11
+"POT-Creation-Date: 2015-12-27 19:04+0300\n"
12
+"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13
+"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
+"Language-Team: LANGUAGE <LL@li.org>\n"
15
+"Language: \n"
16
+"MIME-Version: 1.0\n"
17
+"Content-Type: text/plain; charset=CHARSET\n"
18
+"Content-Transfer-Encoding: 8bit\n"
19
+
20
+#: config/ws.backbone.laview.desktop.gschema.xml.h:1
21
+msgid "\"Hello, earthlings\""
22
+msgstr ""
23
+
24
+#: config/ws.backbone.laview.desktop.gschema.xml.h:2
25
+msgid "A greeting"
26
+msgstr ""
27
+
28
+#: config/ws.backbone.laview.desktop.gschema.xml.h:3
29
+msgid "Greeting of the invading martians"
30
+msgstr ""
31
+
32
+#: config/ws.backbone.laview.desktop.gschema.xml.h:4
33
+msgid "Bottles of beer"
34
+msgstr ""
35
+
36
+#: config/ws.backbone.laview.desktop.gschema.xml.h:5
37
+msgid "Number of bottles of beer on the wall"
38
+msgstr ""
39
+
40
+#: config/ws.backbone.laview.desktop.gschema.xml.h:6
41
+msgid "Is the light switched on?"
42
+msgstr ""
43
+
44
+#: config/ws.backbone.laview.desktop.gschema.xml.h:7
45
+msgid "State of an imaginary light switch."
46
+msgstr ""
47
+
48
+#: src/MainWindow.vala:84
49
+msgid "Select templates"
50
+msgstr ""
51
+
52
+#: src/MainWindow.vala:86
53
+msgid "_Cancel"
54
+msgstr ""
55
+
56
+#: src/MainWindow.vala:87
57
+msgid "_Open"
58
+msgstr ""
59
+
60
+#: src/main.vala:33
61
+msgid "Show the application's version"
62
+msgstr ""
63
+
64
+#: src/main.vala:52
65
+msgid "[FILE]"
66
+msgstr ""
67
+
68
+#: src/main.vala:64
69
+#, c-format
70
+msgid "Error: %s\n"
71
+msgstr ""
72
+
73
+#: src/main.vala:65
74
+#, c-format
75
+msgid "Run '%s --help' to see a full list of available command line options.\n"
76
+msgstr ""
77
+
78
+#: ui/glade/laview-desktop.glade.h:1
79
+msgid "Kolan Sh (backbone@backbone.ws)"
80
+msgstr ""
81
+
82
+#: ui/glade/laview-desktop.glade.h:2
83
+msgid "LaTeX View or View Data in LaTeX."
84
+msgstr ""
85
+
86
+#: ui/glade/laview-desktop.glade.h:3
87
+msgid "LAview"
88
+msgstr ""
89
+
90
+#: ui/glade/laview-desktop.glade.h:4
91
+msgid "Kolan Sh"
92
+msgstr ""
93
+
94
+#: ui/glade/laview-desktop.glade.h:5
95
+msgid "LAview Preferences"
96
+msgstr ""
97
+
98
+#: ui/glade/laview-desktop.glade.h:6
99
+msgid "Paths"
100
+msgstr ""
101
+
102
+#: ui/glade/laview-desktop.glade.h:7
103
+msgid "LyX path on Windows"
104
+msgstr ""
105
+
106
+#: ui/glade/laview-desktop.glade.h:8
107
+msgid "pdfLaTeX path on Windows"
108
+msgstr ""
109
+
110
+#: ui/glade/laview-desktop.glade.h:9
111
+msgid "Common"
112
+msgstr ""
113
+
114
+#: ui/glade/laview-desktop.glade.h:10
115
+msgid "Protocol Plugins"
116
+msgstr ""
117
+
118
+#: ui/glade/laview-desktop.glade.h:11
119
+msgid "Protocol plugins"
120
+msgstr ""
121
+
122
+#: ui/glade/laview-desktop.glade.h:12
123
+msgid "Data Plugins"
124
+msgstr ""
125
+
126
+#: ui/glade/laview-desktop.glade.h:13
127
+msgid "Data plugins"
128
+msgstr ""
129
+
130
+#: ui/glade/laview-desktop.glade.h:14
131
+msgid "LAview Desktop"
132
+msgstr ""
133
+
134
+#: ui/glade/laview-desktop.glade.h:15
135
+msgid "_Template"
136
+msgstr ""
137
+
138
+#: ui/glade/laview-desktop.glade.h:16
139
+msgid "_Document"
140
+msgstr ""
141
+
142
+#: ui/glade/laview-desktop.glade.h:17
143
+msgid "_Application"
144
+msgstr ""
145
+
146
+#: ui/glade/laview-desktop.glade.h:18
147
+msgid "_Help"
148
+msgstr ""
149
+
150
+#: ui/glade/laview-desktop.glade.h:19
151
+msgid "Create a new template"
152
+msgstr ""
153
+
154
+#: ui/glade/laview-desktop.glade.h:20
155
+msgid "Open a template"
156
+msgstr ""
157
+
158
+#: ui/glade/laview-desktop.glade.h:21
159
+msgid "Change selected template"
160
+msgstr ""
161
+
162
+#: ui/glade/laview-desktop.glade.h:22
163
+msgid "Delete selected template"
164
+msgstr ""
165
+
166
+#: ui/glade/laview-desktop.glade.h:23
167
+msgid "Document object preparing"
168
+msgstr ""
169
+
170
+#: ui/glade/laview-desktop.glade.h:24
171
+msgid "View and print the document"
172
+msgstr ""
173
+
174
+#: ui/glade/laview-desktop.glade.h:25
175
+msgid "Edit the result document"
176
+msgstr ""
177
+
178
+#: ui/glade/laview-desktop.glade.h:26
179
+msgid "Application preferences"
180
+msgstr ""
181
+
182
+#: ui/glade/laview-desktop.glade.h:27
183
+msgid "Help and reference"
184
+msgstr ""
185
+
186
+#: ui/glade/laview-desktop.glade.h:28
187
+msgid "Close the application"
188
+msgstr ""
189
+
190
+#: ui/glade/laview-desktop.glade.h:29
191
+msgid "Templates"
192
+msgstr ""
193
+
194
+#: ui/glade/laview-desktop.glade.h:30
195
+msgid "Document Objects"
196
+msgstr ""

+ 1
- 0
po/ru/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+INCLUDE (GettextLangRules)

+ 197
- 0
po/ru/laview-desktop.po View File

@@ -0,0 +1,197 @@
1
+# Russian translations for laview-desktop package.
2
+# Copyright (C) 2015 THE laview-desktop'S COPYRIGHT HOLDER
3
+# This file is distributed under the same license as the laview-desktop package.
4
+#  <backbone@backbone.ws>, 2015.
5
+#
6
+msgid ""
7
+msgstr ""
8
+"Project-Id-Version: laview-desktop\n"
9
+"Report-Msgid-Bugs-To: \n"
10
+"POT-Creation-Date: 2015-12-27 19:03+0300\n"
11
+"PO-Revision-Date: 2015-10-24 20:19+0300\n"
12
+"Last-Translator:  <backbone@backbone.ws>\n"
13
+"Language-Team: Russian\n"
14
+"Language: ru\n"
15
+"MIME-Version: 1.0\n"
16
+"Content-Type: text/plain; charset=UTF-8\n"
17
+"Content-Transfer-Encoding: 8bit\n"
18
+"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n"
19
+"%10<=4 && (n%100<10 || n%100>=20) ? 1 : 2);\n"
20
+
21
+#: config/ws.backbone.laview.desktop.gschema.xml.h:1
22
+msgid "\"Hello, earthlings\""
23
+msgstr "\"Привет, земляне\""
24
+
25
+#: config/ws.backbone.laview.desktop.gschema.xml.h:2
26
+msgid "A greeting"
27
+msgstr "Приветствие"
28
+
29
+#: config/ws.backbone.laview.desktop.gschema.xml.h:3
30
+msgid "Greeting of the invading martians"
31
+msgstr "Приветствие вторгнувшихся марсиан"
32
+
33
+#: config/ws.backbone.laview.desktop.gschema.xml.h:4
34
+msgid "Bottles of beer"
35
+msgstr "Бутылки пива"
36
+
37
+#: config/ws.backbone.laview.desktop.gschema.xml.h:5
38
+msgid "Number of bottles of beer on the wall"
39
+msgstr "Число бутылок пива на стене"
40
+
41
+#: config/ws.backbone.laview.desktop.gschema.xml.h:6
42
+msgid "Is the light switched on?"
43
+msgstr "Включен ли свет?"
44
+
45
+#: config/ws.backbone.laview.desktop.gschema.xml.h:7
46
+msgid "State of an imaginary light switch."
47
+msgstr "Состояние воображаемого выключателя света."
48
+
49
+#: src/MainWindow.vala:84
50
+msgid "Select templates"
51
+msgstr "Выберите шаблоны"
52
+
53
+#: src/MainWindow.vala:86
54
+msgid "_Cancel"
55
+msgstr "_Отмена"
56
+
57
+#: src/MainWindow.vala:87
58
+msgid "_Open"
59
+msgstr "_Открыть"
60
+
61
+#: src/main.vala:33
62
+msgid "Show the application's version"
63
+msgstr "Показать версию приложения"
64
+
65
+#: src/main.vala:52
66
+msgid "[FILE]"
67
+msgstr "[ФАЙЛ]"
68
+
69
+#: src/main.vala:64
70
+#, c-format
71
+msgid "Error: %s\n"
72
+msgstr "Ошибка: %s\n"
73
+
74
+#: src/main.vala:65
75
+#, c-format
76
+msgid "Run '%s --help' to see a full list of available command line options.\n"
77
+msgstr "Запустите '%s --help', чтобы увидеть весь список доступных опций.\n"
78
+
79
+#: ui/glade/laview-desktop.glade.h:1
80
+msgid "Kolan Sh (backbone@backbone.ws)"
81
+msgstr "Николай Ш (backbone@backbone.ws)"
82
+
83
+#: ui/glade/laview-desktop.glade.h:2
84
+msgid "LaTeX View or View Data in LaTeX."
85
+msgstr "LaTeX вид или Представление данных в LaTeX."
86
+
87
+#: ui/glade/laview-desktop.glade.h:3
88
+msgid "LAview"
89
+msgstr "LAview"
90
+
91
+#: ui/glade/laview-desktop.glade.h:4
92
+msgid "Kolan Sh"
93
+msgstr "Николай Ш"
94
+
95
+#: ui/glade/laview-desktop.glade.h:5
96
+msgid "LAview Preferences"
97
+msgstr "Параметры LAview"
98
+
99
+#: ui/glade/laview-desktop.glade.h:6
100
+msgid "Paths"
101
+msgstr "Пути"
102
+
103
+#: ui/glade/laview-desktop.glade.h:7
104
+msgid "LyX path on Windows"
105
+msgstr "Путь к LyX под Windows"
106
+
107
+#: ui/glade/laview-desktop.glade.h:8
108
+msgid "pdfLaTeX path on Windows"
109
+msgstr "Путь к pdfLaTeX под Windows"
110
+
111
+#: ui/glade/laview-desktop.glade.h:9
112
+msgid "Common"
113
+msgstr "Общие"
114
+
115
+#: ui/glade/laview-desktop.glade.h:10
116
+msgid "Protocol Plugins"
117
+msgstr "Плагины протоколов"
118
+
119
+#: ui/glade/laview-desktop.glade.h:11
120
+msgid "Protocol plugins"
121
+msgstr "Плагины протоколов"
122
+
123
+#: ui/glade/laview-desktop.glade.h:12
124
+msgid "Data Plugins"
125
+msgstr "Плагины данных"
126
+
127
+#: ui/glade/laview-desktop.glade.h:13
128
+msgid "Data plugins"
129
+msgstr "Плагины данных"
130
+
131
+#: ui/glade/laview-desktop.glade.h:14
132
+msgid "LAview Desktop"
133
+msgstr "Рабочее окно LAview"
134
+
135
+#: ui/glade/laview-desktop.glade.h:15
136
+msgid "_Template"
137
+msgstr "_Шаблон"
138
+
139
+#: ui/glade/laview-desktop.glade.h:16
140
+msgid "_Document"
141
+msgstr "_Документ"
142
+
143
+#: ui/glade/laview-desktop.glade.h:17
144
+msgid "_Application"
145
+msgstr "_Приложение"
146
+
147
+#: ui/glade/laview-desktop.glade.h:18
148
+msgid "_Help"
149
+msgstr "_Помощь"
150
+
151
+#: ui/glade/laview-desktop.glade.h:19
152
+msgid "Create a new template"
153
+msgstr "Создать новый шаблон"
154
+
155
+#: ui/glade/laview-desktop.glade.h:20
156
+msgid "Open a template"
157
+msgstr "Открыть шаблон"
158
+
159
+#: ui/glade/laview-desktop.glade.h:21
160
+msgid "Change selected template"
161
+msgstr "Изменить выбранный шаблон"
162
+
163
+#: ui/glade/laview-desktop.glade.h:22
164
+msgid "Delete selected template"
165
+msgstr "Удалить выбранный шаблон"
166
+
167
+#: ui/glade/laview-desktop.glade.h:23
168
+msgid "Document object preparing"
169
+msgstr "Подготовка объекта документа"
170
+
171
+#: ui/glade/laview-desktop.glade.h:24
172
+msgid "View and print the document"
173
+msgstr "Просмотр и печать документа"
174
+
175
+#: ui/glade/laview-desktop.glade.h:25
176
+msgid "Edit the result document"
177
+msgstr "Редактировать полученный документ"
178
+
179
+#: ui/glade/laview-desktop.glade.h:26
180
+msgid "Application preferences"
181
+msgstr "Параметры приложения"
182
+
183
+#: ui/glade/laview-desktop.glade.h:27
184
+msgid "Help and reference"
185
+msgstr "Помощь и справка"
186
+
187
+#: ui/glade/laview-desktop.glade.h:28
188
+msgid "Close the application"
189
+msgstr "Закрыть приложение"
190
+
191
+#: ui/glade/laview-desktop.glade.h:29
192
+msgid "Templates"
193
+msgstr "Шаблоны"
194
+
195
+#: ui/glade/laview-desktop.glade.h:30
196
+msgid "Document Objects"
197
+msgstr "Объекты документа"

+ 7
- 0
res/CMakeLists.txt View File

@@ -0,0 +1,7 @@
1
+INCLUDE (GResourceCommonRules)
2
+
3
+CONFIGURE_FILE ("${CMAKE_CURRENT_SOURCE_DIR}/${PROJECT_LOWERCASE_NAME}.desktop.in"
4
+                "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOWERCASE_NAME}-${MAJOR}.desktop")
5
+INSTALL (FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_LOWERCASE_NAME}-${MAJOR}.desktop"
6
+         DESTINATION "share/applications")
7
+INSTALL (FILES "laview-desktop.png" DESTINATION "share/pixmaps")

+ 262
- 0
res/about.svg
File diff suppressed because it is too large
View File


+ 9
- 0
res/laview-desktop.desktop.in View File

@@ -0,0 +1,9 @@
1
+[Desktop Entry]
2
+Name=LAview Desktop @MAJOR@.@MINOR@.@PATCH@
3
+Comment=LAview Desktop Application
4
+Exec=laview-desktop-@MAJOR@ %u
5
+Icon=laview-desktop
6
+Terminal=false
7
+Type=Application
8
+MimeType=laview/lyx;
9
+Categories=Office;

+ 8
- 0
res/laview-desktop.gresource.xml View File

@@ -0,0 +1,8 @@
1
+<?xml version="1.0" encoding="UTF-8"?>
2
+<gresources>
3
+  <gresource prefix="/ws/backbone/laview/desktop">
4
+    <file preprocess="to-pixdata">about.svg</file>
5
+    <!--<file preprocess="xml-stripblanks">whois-server-list.xml</file>-->
6
+    <!--<file compressed="true">gwhois.css</file>-->
7
+  </gresource>
8
+</gresources>

BIN
res/laview-desktop.ico View File


BIN
res/laview-desktop.png View File


+ 1
- 0
res/laview-desktop.rc View File

@@ -0,0 +1 @@
1
+IDR_MAINFRAME ICON "laview-desktop.ico"

+ 37
- 0
src/AboutWindow.vala View File

@@ -0,0 +1,37 @@
1
+namespace LAview.Desktop {
2
+
3
+	using Gtk;
4
+
5
+	/**
6
+	 * About dialog.
7
+	 */
8
+	public class AboutDialogWindow {
9
+		AboutDialog dialog;
10
+
11
+		public AboutDialogWindow (Window parent) throws Error {
12
+			var builder = new Builder ();
13
+			builder.add_from_file (AppDirs.ui_dir + "/laview-desktop.glade");
14
+			builder.connect_signals (this);
15
+
16
+			dialog = builder.get_object ("aboutdialog_window") as AboutDialog;
17
+			dialog.set_destroy_with_parent (true);
18
+			dialog.set_transient_for (parent);
19
+			dialog.set_modal (true);
20
+			dialog.delete_event.connect ((source) => {return true;});
21
+
22
+			dialog.version = @" $(Config.VERSION_MAJOR).$(Config.VERSION_MINOR).$(Config.VERSION_PATCH)";
23
+
24
+			dialog.response.connect ((response_id) => {
25
+				if (response_id == Gtk.ResponseType.CANCEL || response_id == Gtk.ResponseType.DELETE_EVENT) {
26
+					dialog.hide_on_delete ();
27
+				}
28
+			});
29
+
30
+			dialog.logo = new Gdk.Pixbuf.from_resource_at_scale ("/ws/backbone/laview/desktop/about.svg", 256, 256, true);
31
+		}
32
+
33
+		public void show_all () {
34
+			dialog.show_all ();
35
+		}
36
+	}
37
+}

+ 10
- 0
src/AppCore.vala View File

@@ -0,0 +1,10 @@
1
+namespace LAview.Desktop {
2
+
3
+	class AppCore {
4
+		public static LAview.Core.Core core;
5
+
6
+		public static void init (string[] args) throws Error {
7
+			core = new LAview.Core.Core();
8
+		}
9
+	}
10
+}

+ 31
- 0
src/AppDirs.vala View File

@@ -0,0 +1,31 @@
1
+namespace LAview.Desktop {
2
+
3
+	class AppDirs {
4
+		private const string DEFAULT_DATA_DIR = ".texreport-gtk";
5
+
6
+		public static File exec_file;
7
+		public static File exec_dir;
8
+		public static File common_dir;
9
+		public static string resource_dir;
10
+		public static string ui_dir;
11
+		public static string locale_dir;
12
+		public static string settings_dir;
13
+
14
+		public static void init (string[] args) {
15
+			exec_file = File.new_for_path (Environment.find_program_in_path (args[0]));
16
+			exec_dir = exec_file.get_parent ();
17
+			common_dir = exec_dir.get_parent ();
18
+			resource_dir = Path.build_path (Path.DIR_SEPARATOR_S, common_dir.get_path(),
19
+			                                "share/laview-desktop-"+Config.VERSION_MAJOR.to_string());
20
+			ui_dir = resource_dir + "/ui";
21
+			locale_dir = Path.build_path (Path.DIR_SEPARATOR_S, common_dir.get_path(), "share/locale");
22
+			settings_dir = Path.build_path (Path.DIR_SEPARATOR_S, common_dir.get_path(), "share/glib-2.0/schemas");
23
+			string w32dhack_sdir = settings_dir+"/laview-desktop-"+Config.VERSION_MAJOR.to_string();
24
+			if (File.new_for_path(w32dhack_sdir+"/gschemas.compiled").query_exists ())
25
+				settings_dir = w32dhack_sdir;
26
+		}
27
+
28
+		public static void terminate () {
29
+		}
30
+	}
31
+}

+ 16
- 0
src/CMakeLists.txt View File

@@ -0,0 +1,16 @@
1
+SET (BinName laview-desktop-${MAJOR})
2
+FILE (GLOB_RECURSE BinSources RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} *.vala)
3
+SET (BinPackages gtk+-3.0 gee-0.8 gobject-plugin-iface-0 laview-core-iface-0 laview-core-0 posix)
4
+SET (BinPkgModules gtk+-3.0 gee-0.8 laview-core-0)
5
+SET (BinCustomVapis ${CMAKE_SOURCE_DIR}/config/Config.vapi)
6
+INCLUDE_DIRECTORIES ("${CMAKE_BINARY_DIR}/config")
7
+SET (BinInstall ON)
8
+SET (BinExtraSources "${CMAKE_SOURCE_DIR}/res/laview-desktop.rc")
9
+IF (WIN32)
10
+  SET (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mwindows")
11
+  SET (CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--export-all-symbols")
12
+  SET (BinValaOpts -D WINDOWS)
13
+ELSE (WIN32)
14
+  SET (BinValaOpts -D UNIX)
15
+ENDIF (WIN32)
16
+INCLUDE (ValaBinCommonRules)

+ 256
- 0
src/MainWindow.vala View File

@@ -0,0 +1,256 @@
1
+namespace LAview.Desktop {
2
+
3
+	using Gtk, LAview, Core;
4
+
5
+	/**
6
+	 * Main LAview Desktop window.
7
+	 */
8
+	public class MainWindow {
9
+
10
+		Window window;
11
+		PreferencesDialog pref_dialog;
12
+		AboutDialogWindow about_dialog;
13
+		SubprocessDialog subprocess_dialog;
14
+		Gtk.Statusbar statusbar;
15
+		Gtk.ListStore liststore_templates;
16
+		Gtk.ListStore liststore_doc_objects;
17
+		TreeView treeview_templates;
18
+		TreeView treeview_objects;
19
+
20
+		public MainWindow () throws Error {
21
+			var builder = new Builder ();
22
+			builder.add_from_file (AppDirs.ui_dir + "/laview-desktop.glade");
23
+			builder.connect_signals (this);
24
+
25
+			window = builder.get_object ("main_window") as Window;
26
+			statusbar = builder.get_object ("statusbar") as Statusbar;
27
+			liststore_templates = builder.get_object ("liststore_templates") as Gtk.ListStore;
28
+			liststore_doc_objects = builder.get_object ("liststore_objects") as Gtk.ListStore;
29
+			treeview_templates = builder.get_object ("treeview_templates") as TreeView;
30
+			treeview_objects = builder.get_object ("treeview_objects") as TreeView;
31
+			window.title = "LAview Desktop"
32
+			        + @" $(Config.VERSION_MAJOR).$(Config.VERSION_MINOR).$(Config.VERSION_PATCH)";
33
+
34
+			pref_dialog = new PreferencesDialog (window);
35
+			subprocess_dialog = new SubprocessDialog (window);
36
+			about_dialog = new AboutDialogWindow (window);
37
+
38
+			fill_liststore_templates ();
39
+		}
40
+
41
+		void fill_liststore_templates () {
42
+			var templates = AppCore.core.get_templates_readable_names ();
43
+			liststore_templates.clear();
44
+			Gtk.TreeIter iter = Gtk.TreeIter();
45
+			foreach (var t in templates) {
46
+				liststore_templates.append (out iter);
47
+				liststore_templates.set (iter, 0, t);
48
+			}
49
+		}
50
+
51
+		void statusbar_show (string str) {
52
+			var context_id = statusbar.get_context_id ("common_context");
53
+			statusbar.push (context_id, str);
54
+		}
55
+
56
+		public void show_all () {
57
+			window.show_all ();
58
+			statusbar_show ("We're ready, Commander! Select or create a template. :-)");
59
+		}
60
+
61
+		[CCode (instance_pos = -1)]
62
+		public void menu_about_activate (Gtk.ImageMenuItem item) {
63
+			about_dialog.show_all ();
64
+		}
65
+
66
+		[CCode (instance_pos = -1)]
67
+		public void action_new_activate (Gtk.Action action) {
68
+			string[] argv = { AppCore.core.lyx_path, "--execute", "buffer-new" };
69
+			try {
70
+				var subprocess = new SubprocessLauncher(  SubprocessFlags.STDIN_PIPE
71
+					                                    | SubprocessFlags.STDOUT_PIPE
72
+					                                    | SubprocessFlags.STDERR_PIPE);
73
+				subprocess.spawnv(argv);
74
+			} catch (Error err) {
75
+				var msg = new MessageDialog (window, DialogFlags.MODAL, MessageType.ERROR,
76
+				                             ButtonsType.CLOSE, @"Error: $(err.message).");
77
+				msg.response.connect ((response_id) => { msg.destroy (); } );
78
+				msg.show ();
79
+			}
80
+		}
81
+
82
+		[CCode (instance_pos = -1)]
83
+		public void action_open_activate (Gtk.Action action) {
84
+			FileChooserDialog chooser = new Gtk.FileChooserDialog (_("Select templates"), window,
85
+			                                FileChooserAction.OPEN,
86
+			                                _("_Cancel"), ResponseType.CANCEL,
87
+			                                _("_Open"), ResponseType.ACCEPT);
88
+			chooser.select_multiple = true;
89
+			FileFilter filter = new FileFilter ();
90
+			chooser.set_filter (filter);
91
+			filter.add_mime_type ("application/x-tex");
92
+			filter.add_mime_type ("application/x-latex");
93
+			filter.add_mime_type ("application/x-lyx");
94
+			filter.add_pattern ("*.tex");
95
+			filter.add_pattern ("*.latex");
96
+			filter.add_pattern ("*.lyx");
97
+
98
+			if (chooser.run () == ResponseType.ACCEPT) {
99
+				SList<string> paths = chooser.get_filenames ();
100
+
101
+				foreach (unowned string path in paths)
102
+					AppCore.core.add_template (path);
103
+
104
+				fill_liststore_templates ();
105
+			}
106
+
107
+			chooser.close ();
108
+		}
109
+
110
+		void edit_lyx_files (string[] paths) {
111
+			string[] args = { AppCore.core.lyx_path, "--remote" };
112
+			foreach (var p in paths) args += p;
113
+			try {
114
+				var subprocess = new SubprocessLauncher(  SubprocessFlags.STDIN_PIPE
115
+					                                    | SubprocessFlags.STDOUT_PIPE
116
+					                                    | SubprocessFlags.STDERR_PIPE);
117
+				subprocess.spawnv(args);
118
+			} catch (Error err) {
119
+				var msg = new MessageDialog (window, DialogFlags.MODAL, MessageType.ERROR,
120
+				                             ButtonsType.CLOSE, @"Error: $(err.message).");
121
+				msg.response.connect ((response_id) => { msg.destroy (); } );
122
+				msg.show ();
123
+			}
124
+		}
125
+
126
+		int[] get_template_indices () {
127
+			var selection = treeview_templates.get_selection ();
128
+			var selected_rows = selection.get_selected_rows (null);
129
+			int[] indices = {};
130
+			foreach (var r in selected_rows) {
131
+				indices += r.get_indices()[0];
132
+			}
133
+			return indices;
134
+		}
135
+
136
+		[CCode (instance_pos = -1)]
137
+		public void action_edit_template_activate (Gtk.Action action) {
138
+			edit_selected_templates ();
139
+		}
140
+
141
+		[CCode (instance_pos = -1)]
142
+		public void action_delete_activate (Gtk.Action action) {
143
+			var indices = get_template_indices ();
144
+			for (int i = indices.length; i > 0; )
145
+				AppCore.core.remove_template (indices[--i]);
146
+			fill_liststore_templates ();
147
+		}
148
+
149
+		int[] get_objects_indices () {
150
+			var selection = treeview_objects.get_selection ();
151
+			var selected_rows = selection.get_selected_rows (null);
152
+			int[] indices = {};
153
+			foreach (var r in selected_rows) {
154
+				indices += r.get_indices()[0];
155
+			}
156
+			return indices;
157
+		}
158
+
159
+		[CCode (instance_pos = -1)]
160
+		public void action_compose_activate (Gtk.Action action) {
161
+			var t_indices = get_template_indices ();
162
+			var o_indices = get_objects_indices ();
163
+			if (t_indices.length != 0 && o_indices.length != 0) {
164
+				AppCore.core.compose_object (t_indices[0], o_indices[0]);
165
+			}
166
+			statusbar_show ("After composing all objects print the document.");
167
+		}
168
+
169
+		[CCode (instance_pos = -1)]
170
+		public void action_edit_result_activate (Gtk.Action action) {
171
+			var indices = get_template_indices();
172
+			if (indices.length != 0) {
173
+				var lyx_path = AppCore.core.get_lyx_file_path (indices[0]);
174
+				edit_lyx_files ({ lyx_path });
175
+			}
176
+		}
177
+
178
+		void post_print () {
179
+			var indices = get_template_indices();
180
+			var pdf_file = AppCore.core.get_pdf_file_path (indices[0]);
181
+			Utils.open_document (pdf_file, window);
182
+		}
183
+
184
+		[CCode (instance_pos = -1)]
185
+		public void action_print_activate (Gtk.Action action) {
186
+			var indices = get_template_indices();
187
+			if (indices.length != 0) {
188
+				try {
189
+					subprocess_dialog.show_all (AppCore.core.print_document (indices[0]),
190
+					                            "=== Print to PDF file... ===\n",
191
+					                            post_print);
192
+				} catch (Error err) {
193
+					var msg = new MessageDialog (window, DialogFlags.MODAL, MessageType.ERROR,
194
+					                             ButtonsType.CLOSE, @"Error: $(err.message).");
195
+					msg.response.connect ((response_id) => { msg.destroy (); } );
196
+					msg.show ();
197
+				}
198
+			}
199
+		}
200
+
201
+		[CCode (instance_pos = -1)]
202
+		public void action_preferences_activate (Gtk.Action action) {
203
+			pref_dialog.show_all ();
204
+		}
205
+
206
+		[CCode (instance_pos = -1)]
207
+		public void action_ref_activate (Gtk.Action action) {
208
+			try {
209
+				show_uri (null, "https://redmine.backbone.ws/projects/laview/wiki", Gdk.CURRENT_TIME);
210
+			} catch (Error err) {
211
+				var msg = new MessageDialog (window, DialogFlags.MODAL, MessageType.ERROR,
212
+				                             ButtonsType.CLOSE, @"Error: $(err.message).");
213
+				msg.response.connect ((response_id) => { msg.destroy (); } );
214
+				msg.show ();
215
+			}
216
+		}
217
+
218
+		void edit_selected_templates () {
219
+			var indices = get_template_indices ();
220
+			if (indices.length != 0) {
221
+				string[] paths = {};
222
+				foreach (var i in indices) {
223
+					paths += AppCore.core.get_template_path_by_index (i);
224
+				}
225
+				edit_lyx_files (paths);
226
+			}
227
+		}
228
+
229
+		[CCode (instance_pos = -1)]
230
+		public void templates_row_activated (Gtk.TreeView treeview,
231
+		                                     Gtk.TreePath path,
232
+		                                     Gtk.TreeViewColumn column) {
233
+			edit_selected_templates ();
234
+		}
235
+
236
+		[CCode (instance_pos = -1)]
237
+		public void templates_cursor_changed (Gtk.TreeView treeview) {
238
+			var indices = get_template_indices ();
239
+			if (indices.length != 0) {
240
+				var doc_objects = AppCore.core.get_objects_list (indices[0]);
241
+				liststore_doc_objects.clear();
242
+				Gtk.TreeIter iter = Gtk.TreeIter();
243
+				foreach (var t in doc_objects) {
244
+					liststore_doc_objects.append (out iter);
245
+					liststore_doc_objects.set (iter, 0, t);
246
+				}
247
+			}
248
+			statusbar_show ("Document analized, select an object and set it's properties.");
249
+		}
250
+
251
+		[CCode (instance_pos = -1)]
252
+		public void objects_cursor_changed (Gtk.TreeView treeview) {
253
+			statusbar_show ("Press 'Properties' button to compose the object.");
254
+		}
255
+	}
256
+}

+ 77
- 0
src/PreferencesWindow.vala View File

@@ -0,0 +1,77 @@
1
+namespace LAview.Desktop {
2
+
3
+	using Gtk;
4
+
5
+	/**
6
+	 * Preferences window.
7
+	 */
8
+	public class PreferencesDialog {
9
+		Dialog dialog;
10
+		Gtk.ListStore liststore_data;
11
+		Gtk.ListStore liststore_protocols;
12
+		FileChooserButton filechooserbutton_lyx;
13
+		FileChooserButton filechooserbutton_pdflatex;
14
+
15
+		public PreferencesDialog (Window parent) throws Error {
16
+			var builder = new Builder ();
17
+			builder.add_from_file (AppDirs.ui_dir + "/laview-desktop.glade");
18
+			builder.connect_signals (this);
19
+
20
+			dialog = builder.get_object ("preferences_window") as Dialog;
21
+			dialog.set_transient_for (parent);
22
+			dialog.set_modal (true);
23
+			dialog.delete_event.connect ((source) => {return true;});
24
+			liststore_data = builder.get_object ("liststore_data") as Gtk.ListStore;
25
+			liststore_protocols = builder.get_object ("liststore_protocols") as Gtk.ListStore;
26
+			filechooserbutton_lyx = builder.get_object ("filechooserbutton_lyx") as FileChooserButton;
27
+			filechooserbutton_pdflatex = builder.get_object ("filechooserbutton_pdflatex") as FileChooserButton;
28
+
29
+			fill_liststore_data ();
30
+			fill_liststore_protocols ();
31
+
32
+			filechooserbutton_lyx.set_filename (AppCore.core.lyx_path);
33
+			filechooserbutton_pdflatex.set_filename (AppCore.core.pdflatex_path);
34
+		}
35
+
36
+		void fill_liststore_data () {
37
+			var data_plugins = AppCore.core.get_data_plugins ();
38
+
39
+			liststore_data.clear();
40
+			TreeIter iter = TreeIter();
41
+			foreach (var p in data_plugins.entries) {
42
+				liststore_data.append (out iter);
43
+				liststore_data.set (iter, 0, p.value.get_readable_name ());
44
+			}
45
+		}
46
+
47
+		void fill_liststore_protocols () {
48
+			var protocol_plugins = AppCore.core.get_protocol_plugins ();
49
+
50
+			liststore_protocols.clear();
51
+			TreeIter iter = TreeIter();
52
+			foreach (var p in protocol_plugins.entries) {
53
+				liststore_protocols.append (out iter);
54
+				liststore_protocols.set (iter, 0, p.value.get_readable_name ());
55
+			}
56
+		}
57
+
58
+		public void show_all () {
59
+			dialog.show_all ();
60
+		}
61
+
62
+		[CCode (instance_pos = -1)]
63
+		public void button_close_clicked (Button button) {
64
+			dialog.hide ();
65
+		}
66
+
67
+		[CCode (instance_pos = -1)]
68
+		public void lyx_file_set (FileChooserButton chooser) {
69
+			AppCore.core.lyx_path = chooser.get_filename ();
70
+		}
71
+
72
+		[CCode (instance_pos = -1)]
73
+		public void pdflatex_file_set (FileChooserButton chooser) {
74
+			AppCore.core.pdflatex_path = chooser.get_filename ();
75
+		}
76
+	}
77
+}

+ 11
- 0
src/Resources.vala View File

@@ -0,0 +1,11 @@
1
+namespace LAview.Desktop {
2
+	class Resources {
3
+		public static Resource resource;
4
+
5
+		public static void init (string[] args) throws Error {
6
+			var resource_file = AppDirs.resource_dir+"/laview-desktop.gresource";
7
+			resource = Resource.load (resource_file);
8
+			resource._register();
9
+		}
10
+	}
11
+}

+ 15
- 0
src/Settings.vala View File

@@ -0,0 +1,15 @@
1
+namespace LAview.Desktop {
2
+
3
+	class AppSettings {
4
+		//public static GLib.Settings settings;
5
+
6
+		public static void init (string[] args) throws Error {
7
+			SettingsSchemaSource sss = new SettingsSchemaSource.from_directory (AppDirs.settings_dir, null, false);
8
+			//SettingsSchema schema = sss.lookup ("ws.backbone.laview.desktop-"+Config.VERSION_MAJOR.to_string(), false);
9
+			if (sss.lookup == null)
10
+				throw new FileError.NOENT ("Schema ID not found");
11
+
12
+			//settings = new Settings.full (schema, null, null);
13
+		}
14
+	}
15
+}

+ 69
- 0
src/SubprocessDialog.vala View File

@@ -0,0 +1,69 @@
1
+namespace LAview.Desktop {
2
+
3
+	using Gtk;
4
+
5
+	/**
6
+	 * Subprocess window.
7
+	 */
8
+	public class SubprocessDialog {
9
+		Dialog dialog;
10
+		TextView textview_stderrout;
11
+		Subprocess sp;
12
+		unowned PostProcessDelegate ppdelegate;
13
+
14
+		public delegate void PostProcessDelegate ();
15
+
16
+		public SubprocessDialog (Window parent) throws Error {
17
+			var builder = new Builder ();
18
+			builder.add_from_file (AppDirs.ui_dir + "/laview-desktop.glade");
19
+			builder.connect_signals (this);
20
+
21
+			dialog = builder.get_object ("subprocess_dialog") as Dialog;
22
+			dialog.set_transient_for (parent);
23
+			dialog.set_modal (true);
24
+			dialog.delete_event.connect ((source) => {return true;});
25
+			textview_stderrout = builder.get_object ("textview_stderrout") as TextView;
26
+		}
27
+
28
+		async void subprocess_async () {
29
+			try {
30
+				var ds_out = new DataInputStream(sp.get_stdout_pipe());
31
+				try {
32
+					for (string s = yield ds_out.read_line_async(); s != null; s = yield ds_out.read_line_async())
33
+						textview_stderrout.buffer.text += s + "\n";
34
+				} catch (IOError err) {
35
+					assert_not_reached();
36
+				}
37
+				if ((sp.wait_check()) == false) throw new IOError.FAILED("Error running subprocess.");
38
+				ppdelegate ();
39
+				dialog.hide ();
40
+
41
+			} catch (Error err) {
42
+				textview_stderrout.buffer.text += @"Error: $(err.message)";
43
+				if (sp != null) {
44
+					var ds_err = new DataInputStream(sp.get_stderr_pipe());
45
+					try {
46
+						for (string s = yield ds_err.read_line_async(); s != null; s = yield ds_err.read_line_async())
47
+							textview_stderrout.buffer.text += s + "\n";
48
+					} catch (IOError err) {
49
+						assert_not_reached();
50
+					}
51
+				}
52
+			}
53
+		}
54
+
55
+		public void show_all (Subprocess sp, string message, PostProcessDelegate ppdelegate) {
56
+			this.sp = sp;
57
+			textview_stderrout.buffer.text = message;
58
+			this.ppdelegate = ppdelegate;
59
+			dialog.show_all ();
60
+			subprocess_async.begin ();
61
+		}
62
+
63
+		[CCode (instance_pos = -1)]
64
+		public void button_stop_clicked (Button button) {
65
+			sp.force_exit ();
66
+			dialog.hide ();
67
+		}
68
+	}
69
+}

+ 72
- 0
src/Utils.vala View File

@@ -0,0 +1,72 @@
1
+namespace LAview.Desktop {
2
+
3
+	namespace Utils {
4
+
5
+		using Gtk;
6
+
7
+		/**
8
+		 * Resolve a path beginning with "~"
9
+		 * Look at: https://github.com/ssokolow/gvrun/blob/master/process_runner.vala#L86
10
+		 */
11
+		#if (linux || UNIX || __unix__)
12
+		static string expand_tilde (string path) {
13
+			if (!path.has_prefix ("~")) return path; // Just pass paths through if they don't start with ~
14
+
15
+			// Split the ~user portion from the path (Use / for the path if not present)
16
+			string parts[2];
17
+			if (!(Path.DIR_SEPARATOR_S in path)) {
18
+				parts = { path.substring(1), Path.DIR_SEPARATOR_S };
19
+			} else {
20
+				string trimmed = path.substring(1);
21
+				parts = trimmed.split(Path.DIR_SEPARATOR_S, 2);
22
+			}
23
+			warn_if_fail(parts.length == 2);
24
+
25
+			// Handle both "~" and "~user" forms
26
+			string home_path;
27
+			if (parts[0] == "") {
28
+				home_path = Environment.get_variable("HOME") ?? Environment.get_home_dir();
29
+			} else {
30
+				unowned Posix.Passwd _pw = Posix.getpwnam(parts[0]);
31
+				home_path = (_pw == null) ? null : _pw.pw_dir;
32
+			}
33
+
34
+			// Fail safely if we couldn't look up a homedir
35
+			if (home_path == null) {
36
+				warning("Could not get homedir for user: %s", parts[0].length > 0 ? parts[0] : "<current user>");
37
+				return path;
38
+			} else {
39
+				return home_path + Path.DIR_SEPARATOR_S + parts[1];
40
+			}
41
+		}
42
+		#endif
43
+
44
+		/**
45
+		 * Open document.
46
+		 * Idea borrowed from: https://github.com/ssokolow/gvrun/blob/master/process_runner.vala
47
+		 */
48
+		void open_document (string path, Window? parent_window = null) {
49
+			#if (UNIX)
50
+				const string[] OPENERS = {"xdg-open", "mimeopen", "open"};
51
+				foreach (var opener in OPENERS) {
52
+					if (Environment.find_program_in_path (opener) != null) {
53
+						try {
54
+							string[] argv = { opener, expand_tilde (path) };
55
+							Process.spawn_async(null, argv, null, SpawnFlags.SEARCH_PATH, null, null);
56
+						} catch (SpawnError err) {
57
+							var msg = new MessageDialog (parent_window, DialogFlags.MODAL, MessageType.ERROR,
58
+							                             ButtonsType.CLOSE, @"Error: $(err.message).");
59
+							msg.response.connect ((response_id) => { msg.destroy (); } );
60
+							msg.show ();
61
+						}
62
+						break;
63
+					}
64
+				}
65
+			#elif (WINDOWS)
66
+				Posix.system (@"start $path");
67
+			#else
68
+				assert_not_reached ();
69
+			#endif
70
+		}
71
+	}
72
+}

+ 72
- 0
src/main.vala View File

@@ -0,0 +1,72 @@
1
+extern const string GETTEXT_PACKAGE;
2
+
3
+namespace LAview.Desktop {
4
+
5
+	using Gtk, LAview.Desktop;
6
+
7
+	namespace CommandlineOptions {
8
+		// bool no_startup_progress = false;
9
+		// string data_dir = null;
10
+		bool show_version = false;
11
+		// bool no_runtime_monitoring = false;
12
+
13
+		OptionEntry[]? entries = null;
14
+
15
+		OptionEntry[] get_options() {
16
+			if (entries != null)
17
+			return entries;
18
+
19
+			// OptionEntry datadir = { "datadir", 'd', 0, OptionArg.FILENAME, &data_dir,
20
+			//     N_("Path to LAview-Desktop's private data"), N_("DIRECTORY") };
21
+			// entries += datadir;
22
+
23
+			// OptionEntry no_monitoring = { "no-runtime-monitoring", 0, 0, OptionArg.NONE, &no_runtime_monitoring,
24
+			//     N_("Do not monitor library directory at runtime for changes"), null };
25
+			// entries += no_monitoring;
26
+
27
+			// OptionEntry no_startup = { "no-startup-progress", 0, 0, OptionArg.NONE,
28
+			//                            &no_startup_progress,
29
+			//     N_("Don't display startup progress meter"), null };
30
+			// entries += no_startup;
31
+
32
+			OptionEntry version = { "version", 'V', 0, OptionArg.NONE, &show_version,
33
+			                        N_("Show the application's version"), null };
34
+			entries += version;
35
+
36
+			OptionEntry terminator = { null, 0, 0, 0, null, null, null };
37
+			entries += terminator;
38
+
39
+			return entries;
40
+		}
41
+	}
42
+
43
+	void main (string[] args) {
44
+
45
+		try {
46
+
47
+			AppDirs.init (args);
48
+			AppSettings.init (args);
49
+			AppCore.init (args);
50
+			Resources.init (args);
51
+
52
+			Gtk.init_with_args (ref args, _("[FILE]"), CommandlineOptions.get_options (), GETTEXT_PACKAGE);
53
+
54
+			// Internationalization
55
+			Intl.bindtextdomain (GETTEXT_PACKAGE, AppDirs.locale_dir);
56
+			Intl.bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
57
+
58
+			var main_window = new MainWindow ();
59
+			main_window.show_all ();
60
+
61
+			Gtk.main ();
62
+
63
+		} catch (Error e) {
64
+			stderr.printf (_("Error: %s\n"), e.message);
65
+			stderr.printf (_("Run '%s --help' to see a full list of available command line options.\n"), args[0]);
66
+		}
67
+
68
+		AppDirs.terminate();
69
+
70
+		return;
71
+	}
72
+}

+ 0
- 0
test/CMakeLists.txt View File


+ 1
- 0
ui/CMakeLists.txt View File

@@ -0,0 +1 @@
1
+ADD_SUBDIRECTORY (glade)

+ 2
- 0
ui/glade/CMakeLists.txt View File

@@ -0,0 +1,2 @@
1
+SET (GladeFile ${PROJECT_LOWERCASE_NAME})
2
+INCLUDE (GladeCommonRules)

+ 1134
- 0
ui/glade/laview-desktop.glade
File diff suppressed because it is too large
View File


+ 1
- 0
util/backbone

@@ -0,0 +1 @@
1
+Subproject commit 11c998aca2aa1b787286b336e579e5a4e31f471a

+ 2
- 0
valadoc_env View File

@@ -0,0 +1,2 @@
1
+BASEDIR=src config
2
+PKGS=gtk+-3.0 laview-core-0 laview-core-iface-0 gobject-plugin-iface-0 gobject-plugin-loader-0 gmodule-2.0 gee-0.8

Loading…
Cancel
Save