updated api documentation
[urpo] / www / apidoc / html / urpomainwindow_8cpp_source.html
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2 <html xmlns="http://www.w3.org/1999/xhtml">
3 <head>
4 <meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
5 <title>Urpo: src/urpomainwindow.cpp Source File</title>
6 <link href="tabs.css" rel="stylesheet" type="text/css"/>
7 <link href="doxygen.css" rel="stylesheet" type="text/css"/>
8 </head>
9 <body>
10 <!-- Generated by Doxygen 1.6.3 -->
11 <div class="navigation" id="top">
12   <div class="tabs">
13     <ul>
14       <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>
15       <li><a href="annotated.html"><span>Classes</span></a></li>
16       <li class="current"><a href="files.html"><span>Files</span></a></li>
17     </ul>
18   </div>
19   <div class="tabs">
20     <ul>
21       <li><a href="files.html"><span>File&nbsp;List</span></a></li>
22     </ul>
23   </div>
24 <h1>src/urpomainwindow.cpp</h1><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/**************************************************************************</span>
25 <a name="l00002"></a>00002 <span class="comment"></span>
26 <a name="l00003"></a>00003 <span class="comment">    URPO</span>
27 <a name="l00004"></a>00004 <span class="comment"></span>
28 <a name="l00005"></a>00005 <span class="comment">    Unix Remote Printing Operation</span>
29 <a name="l00006"></a>00006 <span class="comment">    Copyright (c) Arto Hyvättinen 2010</span>
30 <a name="l00007"></a>00007 <span class="comment"></span>
31 <a name="l00008"></a>00008 <span class="comment">    This file is part of URPO.</span>
32 <a name="l00009"></a>00009 <span class="comment"></span>
33 <a name="l00010"></a>00010 <span class="comment">    URPO is free software: you can redistribute it and/or modify</span>
34 <a name="l00011"></a>00011 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
35 <a name="l00012"></a>00012 <span class="comment">    the Free Software Foundation, either version 3 of the License, or</span>
36 <a name="l00013"></a>00013 <span class="comment">    (at your option) any later version.</span>
37 <a name="l00014"></a>00014 <span class="comment"></span>
38 <a name="l00015"></a>00015 <span class="comment">    URPO is distributed in the hope that it will be useful,</span>
39 <a name="l00016"></a>00016 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
40 <a name="l00017"></a>00017 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
41 <a name="l00018"></a>00018 <span class="comment">    GNU General Public License for more details.</span>
42 <a name="l00019"></a>00019 <span class="comment"></span>
43 <a name="l00020"></a>00020 <span class="comment"></span>
44 <a name="l00021"></a>00021 <span class="comment">**************************************************************************/</span>
45 <a name="l00022"></a>00022 
46 <a name="l00023"></a>00023 <span class="preprocessor">#include &quot;urpomainwindow.h&quot;</span>
47 <a name="l00024"></a>00024 
48 <a name="l00025"></a>00025 
49 <a name="l00026"></a>00026 <span class="preprocessor">#include &quot;urpoconnectionsettings.h&quot;</span>
50 <a name="l00027"></a>00027 <span class="preprocessor">#include &quot;printerlistjob.h&quot;</span>
51 <a name="l00028"></a>00028 <span class="preprocessor">#include &quot;debugconsole.h&quot;</span>
52 <a name="l00029"></a>00029 <span class="preprocessor">#include &quot;printwidget.h&quot;</span>
53 <a name="l00030"></a>00030 <span class="preprocessor">#include &quot;printjob.h&quot;</span>
54 <a name="l00031"></a>00031 
55 <a name="l00032"></a>00032 <span class="preprocessor">#include &lt;QMenuBar&gt;</span>
56 <a name="l00033"></a>00033 <span class="preprocessor">#include &lt;QMessageBox&gt;</span>
57 <a name="l00034"></a>00034 <span class="preprocessor">#include &lt;QApplication&gt;</span>
58 <a name="l00035"></a>00035 <span class="preprocessor">#include &lt;QTextBrowser&gt;</span>
59 <a name="l00036"></a>00036 <span class="preprocessor">#include &lt;QUrl&gt;</span>
60 <a name="l00037"></a>00037 <span class="preprocessor">#include &lt;QLocale&gt;</span>
61 <a name="l00038"></a>00038 <span class="preprocessor">#include &lt;QFile&gt;</span>
62 <a name="l00039"></a>00039 
63 <a name="l00040"></a>00040 <span class="preprocessor">#include &lt;cstdlib&gt;</span>
64 <a name="l00041"></a>00041 
65 <a name="l00042"></a>00042 <span class="preprocessor">#include &quot;settingsdialog.h&quot;</span>
66 <a name="l00043"></a>00043 
67 <a name="l00044"></a>00044 <span class="preprocessor">#define VERSION &quot;0.9.2&quot;   </span>
68 <a name="l00046"></a>00046 <span class="preprocessor">UrpoMainWindow::UrpoMainWindow(QWidget *parent)</span>
69 <a name="l00047"></a>00047 <span class="preprocessor"></span>    : QMainWindow(parent)
70 <a name="l00048"></a>00048 {
71 <a name="l00049"></a>00049     setWindowTitle(QString(<span class="stringliteral">&quot;URPO &quot;</span>) + VERSION );
72 <a name="l00050"></a>00050     setWindowIcon( QIcon(<span class="stringliteral">&quot;:/urpo.png&quot;</span>));
73 <a name="l00051"></a>00051 
74 <a name="l00052"></a>00052     <span class="comment">// Load connection settings</span>
75 <a name="l00053"></a>00053     settings_ = <span class="keyword">new</span> <a class="code" href="class_urpo_connection_settings.html" title="Connection information, support storing settings.">UrpoConnectionSettings</a>(<span class="stringliteral">&quot;Urpo&quot;</span>,<span class="stringliteral">&quot;Urpo&quot;</span>);
76 <a name="l00054"></a>00054     settings_-&gt;load();
77 <a name="l00055"></a>00055 
78 <a name="l00056"></a>00056     <span class="comment">// Connect to debug monitor</span>
79 <a name="l00057"></a>00057     monitor_ = <span class="keyword">new</span> <a class="code" href="class_debug_console.html" title="Show debug messages.">DebugConsole</a>();
80 <a name="l00058"></a>00058     settings_-&gt;setDebugMonitor(monitor_);
81 <a name="l00059"></a>00059 
82 <a name="l00060"></a>00060     <span class="comment">// Init central widget</span>
83 <a name="l00061"></a>00061     printWidget_ = <span class="keyword">new</span> <a class="code" href="class_print_widget.html" title="GUI Widget of Urpo printing.">PrintWidget</a>;
84 <a name="l00062"></a>00062     setCentralWidget(printWidget_);
85 <a name="l00063"></a>00063 
86 <a name="l00064"></a>00064     <span class="comment">// Init Help</span>
87 <a name="l00065"></a>00065     initHelp();
88 <a name="l00066"></a>00066     <span class="comment">// Init menu</span>
89 <a name="l00067"></a>00067     initMenu();
90 <a name="l00068"></a>00068 
91 <a name="l00069"></a>00069     <span class="comment">// Connect buttons</span>
92 <a name="l00070"></a>00070     connect( printWidget_, SIGNAL(reconnect()), <span class="keyword">this</span>, SLOT(getPrinters()));
93 <a name="l00071"></a>00071     connect( printWidget_, SIGNAL(print(QString,QString)), <span class="keyword">this</span>, SLOT(print(QString,QString)));
94 <a name="l00072"></a>00072 
95 <a name="l00073"></a>00073     <span class="comment">// Init jobs</span>
96 <a name="l00074"></a>00074 
97 <a name="l00075"></a>00075     <span class="comment">// Init printers list job to get printers list</span>
98 <a name="l00076"></a>00076      printerListJob_ = <span class="keyword">new</span> <a class="code" href="class_printer_list_job.html" title="Get list of available printers.">PrinterListJob</a>( settings_);
99 <a name="l00077"></a>00077     <span class="comment">//  Connect finished to printersReceives:</span>
100 <a name="l00078"></a>00078     <span class="comment">//  - if success, enable printing</span>
101 <a name="l00079"></a>00079     <span class="comment">//  - if fail, go to Settings dialog</span>
102 <a name="l00080"></a>00080     connect( printerListJob_, SIGNAL(finished(<span class="keywordtype">bool</span>,QString)), <span class="keyword">this</span>, SLOT(printersReceived(<span class="keywordtype">bool</span>,QString)));
103 <a name="l00081"></a>00081 
104 <a name="l00082"></a>00082     <span class="comment">// Init print job</span>
105 <a name="l00083"></a>00083     printJob_ = <span class="keyword">new</span> <a class="code" href="class_print_job.html" title="File printing job&amp;#39;.">PrintJob</a>(settings_);
106 <a name="l00084"></a>00084     connect( printJob_, SIGNAL(finished(<span class="keywordtype">bool</span>,QString)), <span class="keyword">this</span>, SLOT(printFinished(<span class="keywordtype">bool</span>,QString)));
107 <a name="l00085"></a>00085 
108 <a name="l00086"></a>00086     <span class="keywordflow">if</span>( settings_-&gt;getHost().isEmpty())
109 <a name="l00087"></a>00087         <span class="comment">// If no host settings, go first to settings</span>
110 <a name="l00088"></a>00088         settings();
111 <a name="l00089"></a>00089     <span class="keywordflow">else</span>
112 <a name="l00090"></a>00090         <span class="comment">// Try to get printers list</span>
113 <a name="l00091"></a>00091         getPrinters();
114 <a name="l00092"></a>00092 
115 <a name="l00093"></a>00093 
116 <a name="l00094"></a>00094 }
117 <a name="l00095"></a>00095 
118 <a name="l00096"></a>00096 UrpoMainWindow::~UrpoMainWindow()
119 <a name="l00097"></a>00097 {
120 <a name="l00098"></a>00098 
121 <a name="l00099"></a>00099 }
122 <a name="l00100"></a>00100 
123 <a name="l00101"></a><a class="code" href="class_urpo_main_window.html#af4cbd77cd163252a26b9cecd6c34de11">00101</a> <span class="keywordtype">void</span> <a class="code" href="class_urpo_main_window.html#af4cbd77cd163252a26b9cecd6c34de11" title="Start printers getting.">UrpoMainWindow::getPrinters</a>()
124 <a name="l00102"></a>00102 {
125 <a name="l00103"></a>00103 
126 <a name="l00104"></a>00104     printWidget_-&gt;<a class="code" href="class_print_widget.html#a6a7ec1bbfe668da0e65aae39cd9d5a7e" title="Set status information.">setStatus</a>(tr(<span class="stringliteral">&quot;Connecting...&quot;</span>),<span class="keyword">true</span>);
127 <a name="l00105"></a>00105     connect(printWidget_, SIGNAL(cancel()), printerListJob_, SLOT(cancel()));
128 <a name="l00106"></a>00106     printerListJob_-&gt;<a class="code" href="class_urpo_job.html#ae4549ace1bc2331462d22281b8cbdf0f" title="Start job.">start</a>();
129 <a name="l00107"></a>00107 
130 <a name="l00108"></a>00108 }
131 <a name="l00109"></a>00109 
132 <a name="l00110"></a>00110 
133 <a name="l00111"></a>00111 <span class="keywordtype">void</span> UrpoMainWindow::initMenu()
134 <a name="l00112"></a>00112 {
135 <a name="l00113"></a>00113 
136 <a name="l00114"></a>00114     QAction* settingsAction = <span class="keyword">new</span> QAction( tr(<span class="stringliteral">&quot;Settings&quot;</span>), <span class="keyword">this</span>);
137 <a name="l00115"></a>00115     connect(settingsAction, SIGNAL(triggered()), <span class="keyword">this</span>, SLOT(<a class="code" href="class_urpo_main_window.html#abc82e9d98bc76494c11f8f1b733046ae" title="Show settings dialog.">settings</a>()) );
138 <a name="l00116"></a>00116     menuBar()-&gt;addAction(settingsAction);
139 <a name="l00117"></a>00117 
140 <a name="l00118"></a>00118     QAction* debugAction = <span class="keyword">new</span> QAction( tr(<span class="stringliteral">&quot;Debug&quot;</span>), <span class="keyword">this</span>);
141 <a name="l00119"></a>00119     debugAction-&gt;setStatusTip(tr(<span class="stringliteral">&quot;Open debug console&quot;</span>));
142 <a name="l00120"></a>00120     connect(debugAction, SIGNAL(triggered()), <span class="keyword">this</span>, SLOT(<a class="code" href="class_urpo_main_window.html#a86f59c8dbdf3bc2ac411ef2b826dbd89" title="Show debug window.">debugWindow</a>() ));
143 <a name="l00121"></a>00121     menuBar()-&gt;addAction(debugAction);
144 <a name="l00122"></a>00122 
145 <a name="l00123"></a>00123     QAction* aboutAction = <span class="keyword">new</span> QAction( tr(<span class="stringliteral">&quot;About&quot;</span>), <span class="keyword">this</span>);
146 <a name="l00124"></a>00124     connect(aboutAction, SIGNAL(triggered()), <span class="keyword">this</span>, SLOT(<a class="code" href="class_urpo_main_window.html#a7735827afb283fb173856ba825818769" title="Show about dialog.">about</a>()));
147 <a name="l00125"></a>00125     menuBar()-&gt;addAction(aboutAction);
148 <a name="l00126"></a>00126 
149 <a name="l00127"></a>00127     QAction* aboutQtAction = <span class="keyword">new</span> QAction( tr(<span class="stringliteral">&quot;About Qt&quot;</span>), <span class="keyword">this</span> );
150 <a name="l00128"></a>00128     connect(aboutQtAction, SIGNAL(triggered()), qApp, SLOT(aboutQt()));
151 <a name="l00129"></a>00129     menuBar()-&gt;addAction(aboutQtAction);
152 <a name="l00130"></a>00130 
153 <a name="l00131"></a>00131 
154 <a name="l00132"></a>00132     QAction* helpAction = <span class="keyword">new</span> QAction( tr(<span class="stringliteral">&quot;Help&quot;</span>), <span class="keyword">this</span> );
155 <a name="l00133"></a>00133     connect( helpAction, SIGNAL(triggered()), <span class="keyword">this</span>, SLOT(<a class="code" href="class_urpo_main_window.html#a4d8b27b7df20f2f2cee6d31f36a0bac1" title="Show help window.">helpWindow</a>()));
156 <a name="l00134"></a>00134     menuBar()-&gt;addAction(helpAction);
157 <a name="l00135"></a>00135 
158 <a name="l00136"></a>00136 }
159 <a name="l00137"></a>00137 
160 <a name="l00138"></a>00138 <span class="keywordtype">void</span> UrpoMainWindow::initHelp()
161 <a name="l00139"></a>00139 {
162 <a name="l00140"></a>00140 
163 <a name="l00141"></a>00141 
164 <a name="l00142"></a>00142 
165 <a name="l00143"></a>00143     <span class="comment">// Init help</span>
166 <a name="l00144"></a>00144     helpBrowser_ = <span class="keyword">new</span> QTextBrowser();
167 <a name="l00145"></a>00145     helpBrowser_-&gt;setWindowTitle(tr(<span class="stringliteral">&quot;Urpo Help&quot;</span>));
168 <a name="l00146"></a>00146 
169 <a name="l00147"></a>00147     <span class="comment">// Load help file</span>
170 <a name="l00148"></a>00148     <span class="comment">// Try to load locale version index_fi etc.</span>
171 <a name="l00149"></a>00149 
172 <a name="l00150"></a>00150     <span class="comment">// using LANG enviroment variable instead of QLocale because of Qt on Maemo problem</span>
173 <a name="l00151"></a>00151     <span class="comment">// bug #6136</span>
174 <a name="l00152"></a>00152     QString language = std::getenv(<span class="stringliteral">&quot;LANG&quot;</span>);
175 <a name="l00153"></a>00153 
176 <a name="l00154"></a>00154     QString helpfilename = QString(<span class="stringliteral">&quot;:/help/index_&quot;</span>) + language.left(2).toLower() + QString(<span class="stringliteral">&quot;.html&quot;</span>);
177 <a name="l00155"></a>00155 
178 <a name="l00156"></a>00156     QFile helpfile( helpfilename );
179 <a name="l00157"></a>00157     <span class="keywordflow">if</span>( helpfile.exists() )
180 <a name="l00158"></a>00158         helpBrowser_-&gt;setSource(QUrl( QString(<span class="stringliteral">&quot;qrc&quot;</span>) + helpfilename  ));
181 <a name="l00159"></a>00159     <span class="keywordflow">else</span>
182 <a name="l00160"></a>00160         <span class="comment">// Not find, load general</span>
183 <a name="l00161"></a>00161         helpBrowser_-&gt;setSource(QUrl(<span class="stringliteral">&quot;qrc:/help/index.html&quot;</span>));
184 <a name="l00162"></a>00162 
185 <a name="l00163"></a>00163     helpBrowser_-&gt;setOpenExternalLinks(<span class="keyword">true</span>);
186 <a name="l00164"></a>00164 
187 <a name="l00165"></a>00165 }
188 <a name="l00166"></a>00166 
189 <a name="l00167"></a><a class="code" href="class_urpo_main_window.html#a7b9ba5635e1f9f3a516e0e516c8bb82c">00167</a> <span class="keywordtype">void</span> <a class="code" href="class_urpo_main_window.html#a7b9ba5635e1f9f3a516e0e516c8bb82c" title="Populate printer QCombo and enable printing.">UrpoMainWindow::printersReceived</a>(<span class="keywordtype">bool</span> success, QString error)
190 <a name="l00168"></a>00168 {
191 <a name="l00169"></a>00169     <span class="comment">// Disconnect cancel button out of printerListJob</span>
192 <a name="l00170"></a>00170     disconnect(printWidget_, SIGNAL(cancel()), printerListJob_, SLOT(cancel()));
193 <a name="l00171"></a>00171     <span class="keywordflow">if</span>(success)
194 <a name="l00172"></a>00172     {
195 <a name="l00173"></a>00173         <span class="comment">// PrinterListJob successed</span>
196 <a name="l00174"></a>00174         printWidget_-&gt;<a class="code" href="class_print_widget.html#a9f5c076fb72f1e0453f58e4351e7b23c" title="Set printers.">setPrinters</a>( printerListJob_-&gt;<a class="code" href="class_printer_list_job.html#ac31476343a7d6d4b4dbc98f0a9082992" title="List of printers in system.">getPrinters</a>());
197 <a name="l00175"></a>00175         <span class="keywordflow">if</span>( printerListJob_-&gt;<a class="code" href="class_printer_list_job.html#ac31476343a7d6d4b4dbc98f0a9082992" title="List of printers in system.">getPrinters</a>().isEmpty())
198 <a name="l00176"></a>00176         {
199 <a name="l00177"></a>00177             <span class="comment">// No printers, can&#39;t print</span>
200 <a name="l00178"></a>00178             printWidget_-&gt;<a class="code" href="class_print_widget.html#a6a7ec1bbfe668da0e65aae39cd9d5a7e" title="Set status information.">setStatus</a>( QString(<span class="stringliteral">&quot;&lt;font color=red&gt;&quot;</span>) + tr(<span class="stringliteral">&quot;No printers found&quot;</span>) + QString(<span class="stringliteral">&quot;&lt;/font&gt;&quot;</span>),<span class="keyword">false</span>);
201 <a name="l00179"></a>00179             printWidget_-&gt;<a class="code" href="class_print_widget.html#a294239f17167fadcbd924344edf345bc" title="Set ready to print.">setReady</a>(<span class="keyword">false</span>);
202 <a name="l00180"></a>00180         }
203 <a name="l00181"></a>00181         <span class="keywordflow">else</span>
204 <a name="l00182"></a>00182         {
205 <a name="l00183"></a>00183             <span class="comment">// Ready to print</span>
206 <a name="l00184"></a>00184             printWidget_-&gt;<a class="code" href="class_print_widget.html#a294239f17167fadcbd924344edf345bc" title="Set ready to print.">setReady</a>( <span class="keyword">true</span> );
207 <a name="l00185"></a>00185         }
208 <a name="l00186"></a>00186 
209 <a name="l00187"></a>00187     }
210 <a name="l00188"></a>00188     <span class="keywordflow">else</span>
211 <a name="l00189"></a>00189     {
212 <a name="l00190"></a>00190         <span class="comment">// Unsuccess!</span>
213 <a name="l00191"></a>00191         printWidget_-&gt;<a class="code" href="class_print_widget.html#a6a7ec1bbfe668da0e65aae39cd9d5a7e" title="Set status information.">setStatus</a>(  QString(<span class="stringliteral">&quot;&lt;font color=red&gt;&quot;</span>) + error + QString(<span class="stringliteral">&quot;&lt;/font&gt;&quot;</span>) );
214 <a name="l00192"></a>00192         printWidget_-&gt;<a class="code" href="class_print_widget.html#a294239f17167fadcbd924344edf345bc" title="Set ready to print.">setReady</a>(<span class="keyword">false</span>);
215 <a name="l00193"></a>00193     }
216 <a name="l00194"></a>00194 }
217 <a name="l00195"></a>00195 
218 <a name="l00196"></a><a class="code" href="class_urpo_main_window.html#a7735827afb283fb173856ba825818769">00196</a> <span class="keywordtype">void</span> <a class="code" href="class_urpo_main_window.html#a7735827afb283fb173856ba825818769" title="Show about dialog.">UrpoMainWindow::about</a>()
219 <a name="l00197"></a>00197 {
220 <a name="l00198"></a>00198     <a class="code" href="class_urpo_main_window.html#a7735827afb283fb173856ba825818769" title="Show about dialog.">QMessageBox::about</a>(<span class="keyword">this</span>, tr(<span class="stringliteral">&quot;About Urpo&quot;</span>),
221 <a name="l00199"></a>00199                        tr(<span class="stringliteral">&quot;&lt;b&gt;Unix Remote Printing Operation %1 &lt;/b&gt;&quot;</span>
222 <a name="l00200"></a>00200                           <span class="stringliteral">&quot;&lt;p&gt;Copyright &amp;copy; Arto Hyv&amp;auml;ttinen 2010&quot;</span>
223 <a name="l00201"></a>00201                           <span class="stringliteral">&quot;&lt;p&gt;License: General Public License v3&quot;</span>
224 <a name="l00202"></a>00202                           ).arg(VERSION));
225 <a name="l00203"></a>00203 }
226 <a name="l00204"></a>00204 
227 <a name="l00205"></a><a class="code" href="class_urpo_main_window.html#abc82e9d98bc76494c11f8f1b733046ae">00205</a> <span class="keywordtype">void</span> <a class="code" href="class_urpo_main_window.html#abc82e9d98bc76494c11f8f1b733046ae" title="Show settings dialog.">UrpoMainWindow::settings</a>()
228 <a name="l00206"></a>00206 {
229 <a name="l00207"></a>00207     printWidget_-&gt;<a class="code" href="class_print_widget.html#af41b8303b7ebba95e070592f76c47c1e" title="Press print button.">doCancel</a>(); <span class="comment">// Cancel current process</span>
230 <a name="l00208"></a>00208 
231 <a name="l00209"></a>00209     <a class="code" href="class_settings_dialog.html" title="GUI dialog for Urpo Setting.">SettingsDialog</a>* dialog = <span class="keyword">new</span> <a class="code" href="class_settings_dialog.html" title="GUI dialog for Urpo Setting.">SettingsDialog</a>(<span class="keyword">this</span>);
232 <a name="l00210"></a>00210     dialog-&gt;<a class="code" href="class_settings_dialog.html#a24a50ddb3f66175cf0cca756e7f31df8" title="Set UrpoConnection having connection settings.">setSettings</a>(settings_);
233 <a name="l00211"></a>00211     dialog-&gt;<a class="code" href="class_settings_dialog.html#a01f13839d5d23033492d95e25a7e1cbd" title="Set QTextBrowser showing help.">setHelp</a>(helpBrowser_);
234 <a name="l00212"></a>00212     dialog-&gt;show();
235 <a name="l00213"></a>00213 
236 <a name="l00214"></a>00214     <span class="comment">// Dialog done -&gt; get printers</span>
237 <a name="l00215"></a>00215     connect( dialog, SIGNAL(accepted()), <span class="keyword">this</span>, SLOT(<a class="code" href="class_urpo_main_window.html#af4cbd77cd163252a26b9cecd6c34de11" title="Start printers getting.">getPrinters</a>()));
238 <a name="l00216"></a>00216 
239 <a name="l00217"></a>00217 }
240 <a name="l00218"></a>00218 
241 <a name="l00219"></a><a class="code" href="class_urpo_main_window.html#a86f59c8dbdf3bc2ac411ef2b826dbd89">00219</a> <span class="keywordtype">void</span> <a class="code" href="class_urpo_main_window.html#a86f59c8dbdf3bc2ac411ef2b826dbd89" title="Show debug window.">UrpoMainWindow::debugWindow</a>()
242 <a name="l00220"></a>00220 {
243 <a name="l00221"></a>00221     monitor_-&gt;show();
244 <a name="l00222"></a>00222     monitor_-&gt;raise();
245 <a name="l00223"></a>00223     monitor_-&gt;activateWindow();
246 <a name="l00224"></a>00224 }
247 <a name="l00225"></a>00225 
248 <a name="l00226"></a><a class="code" href="class_urpo_main_window.html#a4d8b27b7df20f2f2cee6d31f36a0bac1">00226</a> <span class="keywordtype">void</span> <a class="code" href="class_urpo_main_window.html#a4d8b27b7df20f2f2cee6d31f36a0bac1" title="Show help window.">UrpoMainWindow::helpWindow</a>()
249 <a name="l00227"></a>00227 {
250 <a name="l00228"></a>00228 
251 <a name="l00229"></a>00229     <span class="comment">// Show help</span>
252 <a name="l00230"></a>00230     helpBrowser_-&gt;home();
253 <a name="l00231"></a>00231     helpBrowser_-&gt;show();
254 <a name="l00232"></a>00232     helpBrowser_-&gt;raise();
255 <a name="l00233"></a>00233     helpBrowser_-&gt;activateWindow();
256 <a name="l00234"></a>00234 }
257 <a name="l00235"></a>00235 
258 <a name="l00236"></a><a class="code" href="class_urpo_main_window.html#aa23252ae7354606d0c745edfedcf2422">00236</a> <span class="keywordtype">void</span> <a class="code" href="class_urpo_main_window.html#aa23252ae7354606d0c745edfedcf2422" title="Print file.">UrpoMainWindow::print</a>(QString file, QString options)
259 <a name="l00237"></a>00237 {
260 <a name="l00238"></a>00238     printWidget_-&gt;<a class="code" href="class_print_widget.html#a6a7ec1bbfe668da0e65aae39cd9d5a7e" title="Set status information.">setStatus</a>( tr(<span class="stringliteral">&quot;Printing...&quot;</span>), <span class="keyword">true</span> );
261 <a name="l00239"></a>00239     connect( printWidget_, SIGNAL(cancel()), printJob_, SLOT(cancel()));
262 <a name="l00240"></a>00240     printJob_-&gt;<a class="code" href="class_print_job.html#a5ce2230a6599b03abefd3875a43ba62e" title="Print sigle file.">printFile</a>(file,options);
263 <a name="l00241"></a>00241 }
264 <a name="l00242"></a>00242 
265 <a name="l00243"></a><a class="code" href="class_urpo_main_window.html#aab72cf54adc0447b61e9030db560d6b3">00243</a> <span class="keywordtype">void</span> <a class="code" href="class_urpo_main_window.html#aab72cf54adc0447b61e9030db560d6b3" title="Print finished, enable buttons.">UrpoMainWindow::printFinished</a>(<span class="keywordtype">bool</span> success, QString errorStr)
266 <a name="l00244"></a>00244 {
267 <a name="l00245"></a>00245     disconnect( printWidget_, SIGNAL(cancel()), printJob_, SLOT(cancel()));
268 <a name="l00246"></a>00246     printWidget_-&gt;<a class="code" href="class_print_widget.html#a294239f17167fadcbd924344edf345bc" title="Set ready to print.">setReady</a>(<span class="keyword">true</span>); <span class="comment">// Ready to print again!</span>
269 <a name="l00247"></a>00247     <span class="keywordflow">if</span>( success == <span class="keyword">false</span> )  <span class="comment">// Error -- set error message!</span>
270 <a name="l00248"></a>00248     {
271 <a name="l00249"></a>00249         printWidget_-&gt;<a class="code" href="class_print_widget.html#a294239f17167fadcbd924344edf345bc" title="Set ready to print.">setReady</a>(<span class="keyword">true</span>);
272 <a name="l00250"></a>00250         printWidget_-&gt;<a class="code" href="class_print_widget.html#a6a7ec1bbfe668da0e65aae39cd9d5a7e" title="Set status information.">setStatus</a>( QString(<span class="stringliteral">&quot;&lt;font color=red&gt;&quot;</span>) + errorStr + QString(<span class="stringliteral">&quot;&lt;/font&gt;&quot;</span>));
273 <a name="l00251"></a>00251     }
274 <a name="l00252"></a>00252 }
275 </pre></div></div>
276 <hr class="footer"/><address style="text-align: right;"><small>Generated on Mon Sep 27 18:46:05 2010 for Urpo by&nbsp;
277 <a href="http://www.doxygen.org/index.html">
278 <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
279 </body>
280 </html>