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