-rw-r--r-- | core/launcher/launcher.pro | 2 | ||||
-rw-r--r-- | core/launcher/shutdown.ui | 1323 | ||||
-rw-r--r-- | core/launcher/shutdownimpl.cpp | 140 | ||||
-rw-r--r-- | core/launcher/shutdownimpl.h | 15 |
4 files changed, 117 insertions, 1363 deletions
diff --git a/core/launcher/launcher.pro b/core/launcher/launcher.pro index c053662..ccf8231 100644 --- a/core/launcher/launcher.pro +++ b/core/launcher/launcher.pro @@ -93,3 +93,3 @@ SOURCES = background.cpp \ $(OPIEDIR)/rsync/qrsync.cpp -INTERFACES = shutdown.ui syncdialog.ui +INTERFACES = syncdialog.ui INCLUDEPATH += $(OPIEDIR)/include diff --git a/core/launcher/shutdown.ui b/core/launcher/shutdown.ui deleted file mode 100644 index c5863df..0000000 --- a/core/launcher/shutdown.ui +++ b/dev/null @@ -1,1323 +0,0 @@ -<!DOCTYPE UI><UI> -<class>Shutdown</class> -<widget> - <class>QWidget</class> - <property stdset="1"> - <name>name</name> - <cstring>Form1</cstring> - </property> - <property stdset="1"> - <name>geometry</name> - <rect> - <x>0</x> - <y>0</y> - <width>433</width> - <height>465</height> - </rect> - </property> - <property stdset="1"> - <name>caption</name> - <string>Shut down...</string> - </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> - </property> - <vbox> - <property stdset="1"> - <name>margin</name> - <number>6</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>3</number> - </property> - <widget> - <class>QButtonGroup</class> - <property stdset="1"> - <name>name</name> - <cstring>ButtonGroup1</cstring> - </property> - <property stdset="1"> - <name>title</name> - <string>Terminate</string> - </property> - <property> - <name>layoutMargin</name> - </property> - <property> - <name>layoutSpacing</name> - </property> - <grid> - <property stdset="1"> - <name>margin</name> - <number>7</number> - </property> - <property stdset="1"> - <name>spacing</name> - <number>3</number> - </property> - <widget row="1" column="1" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>quit</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>3</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>palette</name> - <palette> - <active> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>236</red> - <green>236</green> - <blue>179</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>245</red> - <green>245</green> - <blue>217</blue> - </color> - <color> - <red>118</red> - <green>118</green> - <blue>89</blue> - </color> - <color> - <red>157</red> - <green>157</green> - <blue>119</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </active> - <disabled> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>236</red> - <green>236</green> - <blue>179</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>209</blue> - </color> - <color> - <red>118</red> - <green>118</green> - <blue>89</blue> - </color> - <color> - <red>157</red> - <green>157</green> - <blue>119</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </disabled> - <inactive> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>236</red> - <green>236</green> - <blue>179</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>209</blue> - </color> - <color> - <red>118</red> - <green>118</green> - <blue>89</blue> - </color> - <color> - <red>157</red> - <green>157</green> - <blue>119</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </inactive> - </palette> - </property> - <property stdset="1"> - <name>text</name> - <string>Terminate Opie</string> - </property> - <property stdset="1"> - <name>buttonGroupId</name> - <number>4</number> - </property> - </widget> - <widget row="1" column="0" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>reboot</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>3</hsizetype> - <vsizetype>0</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>palette</name> - <palette> - <active> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>236</red> - <green>183</green> - <blue>181</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>245</red> - <green>219</green> - <blue>218</blue> - </color> - <color> - <red>118</red> - <green>92</green> - <blue>91</blue> - </color> - <color> - <red>157</red> - <green>122</green> - <blue>121</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </active> - <disabled> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>236</red> - <green>183</green> - <blue>181</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>255</red> - <green>213</green> - <blue>212</blue> - </color> - <color> - <red>118</red> - <green>92</green> - <blue>91</blue> - </color> - <color> - <red>157</red> - <green>122</green> - <blue>121</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </disabled> - <inactive> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>236</red> - <green>183</green> - <blue>181</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>255</red> - <green>213</green> - <blue>212</blue> - </color> - <color> - <red>118</red> - <green>92</green> - <blue>91</blue> - </color> - <color> - <red>157</red> - <green>122</green> - <blue>121</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </inactive> - </palette> - </property> - <property stdset="1"> - <name>text</name> - <string>Reboot</string> - </property> - <property stdset="1"> - <name>buttonGroupId</name> - <number>2</number> - </property> - </widget> - <widget row="0" column="1" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>restart</cstring> - </property> - <property stdset="1"> - <name>palette</name> - <palette> - <active> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>236</red> - <green>236</green> - <blue>179</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>245</red> - <green>245</green> - <blue>217</blue> - </color> - <color> - <red>118</red> - <green>118</green> - <blue>89</blue> - </color> - <color> - <red>157</red> - <green>157</green> - <blue>119</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </active> - <disabled> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>236</red> - <green>236</green> - <blue>179</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>209</blue> - </color> - <color> - <red>118</red> - <green>118</green> - <blue>89</blue> - </color> - <color> - <red>157</red> - <green>157</green> - <blue>119</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </disabled> - <inactive> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>236</red> - <green>236</green> - <blue>179</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>209</blue> - </color> - <color> - <red>118</red> - <green>118</green> - <blue>89</blue> - </color> - <color> - <red>157</red> - <green>157</green> - <blue>119</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </inactive> - </palette> - </property> - <property stdset="1"> - <name>text</name> - <string>Restart Opie</string> - </property> - <property stdset="1"> - <name>buttonGroupId</name> - <number>3</number> - </property> - </widget> - <widget row="0" column="0" > - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>shutdown</cstring> - </property> - <property stdset="1"> - <name>palette</name> - <palette> - <active> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>236</red> - <green>183</green> - <blue>181</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>245</red> - <green>219</green> - <blue>218</blue> - </color> - <color> - <red>118</red> - <green>92</green> - <blue>91</blue> - </color> - <color> - <red>157</red> - <green>122</green> - <blue>121</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </active> - <disabled> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>236</red> - <green>183</green> - <blue>181</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>255</red> - <green>213</green> - <blue>212</blue> - </color> - <color> - <red>118</red> - <green>92</green> - <blue>91</blue> - </color> - <color> - <red>157</red> - <green>122</green> - <blue>121</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </disabled> - <inactive> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>236</red> - <green>183</green> - <blue>181</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>255</red> - <green>213</green> - <blue>212</blue> - </color> - <color> - <red>118</red> - <green>92</green> - <blue>91</blue> - </color> - <color> - <red>157</red> - <green>122</green> - <blue>121</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>222</red> - <green>222</green> - <blue>222</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </inactive> - </palette> - </property> - <property stdset="1"> - <name>text</name> - <string>Shutdown</string> - </property> - <property stdset="1"> - <name>buttonGroupId</name> - <number>1</number> - </property> - </widget> - </grid> - </widget> - <widget> - <class>QLabel</class> - <property stdset="1"> - <name>name</name> - <cstring>info</cstring> - </property> - <property stdset="1"> - <name>text</name> - <string><p> -These termination options are provided primarily for use while developing and testing the Opie system. In a normal environment, these concepts are unnecessary.</string> - </property> - </widget> - <widget> - <class>QProgressBar</class> - <property stdset="1"> - <name>name</name> - <cstring>progressBar</cstring> - </property> - <property stdset="1"> - <name>frameShape</name> - <enum>Panel</enum> - </property> - <property stdset="1"> - <name>frameShadow</name> - <enum>Sunken</enum> - </property> - <property stdset="1"> - <name>totalSteps</name> - <number>20</number> - </property> - <property stdset="1"> - <name>indicatorFollowsStyle</name> - <bool>false</bool> - </property> - </widget> - <spacer> - <property> - <name>name</name> - <cstring>Spacer2</cstring> - </property> - <property stdset="1"> - <name>orientation</name> - <enum>Vertical</enum> - </property> - <property stdset="1"> - <name>sizeType</name> - <enum>Expanding</enum> - </property> - <property> - <name>sizeHint</name> - <size> - <width>20</width> - <height>20</height> - </size> - </property> - </spacer> - <widget> - <class>QPushButton</class> - <property stdset="1"> - <name>name</name> - <cstring>cancel</cstring> - </property> - <property stdset="1"> - <name>sizePolicy</name> - <sizepolicy> - <hsizetype>1</hsizetype> - <vsizetype>7</vsizetype> - </sizepolicy> - </property> - <property stdset="1"> - <name>palette</name> - <palette> - <active> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>181</red> - <green>222</green> - <blue>178</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>218</red> - <green>238</green> - <blue>216</blue> - </color> - <color> - <red>90</red> - <green>111</green> - <blue>89</blue> - </color> - <color> - <red>120</red> - <green>148</green> - <blue>118</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>174</red> - <green>222</green> - <blue>158</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </active> - <disabled> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>181</red> - <green>222</green> - <blue>178</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>207</red> - <green>255</green> - <blue>204</blue> - </color> - <color> - <red>90</red> - <green>111</green> - <blue>89</blue> - </color> - <color> - <red>120</red> - <green>148</green> - <blue>118</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>128</red> - <green>128</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>174</red> - <green>222</green> - <blue>158</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </disabled> - <inactive> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>181</red> - <green>222</green> - <blue>178</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>207</red> - <green>255</green> - <blue>204</blue> - </color> - <color> - <red>90</red> - <green>111</green> - <blue>89</blue> - </color> - <color> - <red>120</red> - <green>148</green> - <blue>118</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - <color> - <red>174</red> - <green>222</green> - <blue>158</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>0</blue> - </color> - <color> - <red>0</red> - <green>0</green> - <blue>128</blue> - </color> - <color> - <red>255</red> - <green>255</green> - <blue>255</blue> - </color> - </inactive> - </palette> - </property> - <property stdset="1"> - <name>text</name> - <string>Cancel</string> - </property> - <property stdset="1"> - <name>default</name> - <bool>true</bool> - </property> - </widget> - </vbox> -</widget> -</UI> diff --git a/core/launcher/shutdownimpl.cpp b/core/launcher/shutdownimpl.cpp index 06ed756..0c5b4f6 100644 --- a/core/launcher/shutdownimpl.cpp +++ b/core/launcher/shutdownimpl.cpp @@ -29,20 +29,91 @@ #include <qlabel.h> +#include <qlayout.h> +#include <qpalette.h> +static void changeButtonColor ( QPushButton *btn, const QColor &col ) +{ + QPalette pal = btn-> palette ( ); + + pal. setColor ( QPalette::Active, QColorGroup::Button, col ); + pal. setColor ( QPalette::Disabled, QColorGroup::Button, col ); + pal. setColor ( QPalette::Inactive, QColorGroup::Button, col ); + + btn-> setPalette ( pal ); +} + -#include <stdio.h> ShutdownImpl::ShutdownImpl( QWidget* parent, const char *name, WFlags fl ) - : Shutdown( parent, name, fl ) + : QWidget ( parent, name, fl ) { - timer = new QTimer( this ); - connect( timer, SIGNAL(timeout()), this, SLOT(timeout()) ); + setCaption ( tr( "Shut down..." )); + + QVBoxLayout *vbox = new QVBoxLayout ( this ); + vbox-> setSpacing ( 3 ); + vbox-> setMargin ( 6 ); + + QButtonGroup *btngrp = new QButtonGroup ( this ); + + btngrp-> setTitle ( tr( "Terminate" )); + btngrp-> setColumnLayout ( 0, Qt::Vertical ); + btngrp-> layout ( )-> setSpacing ( 0 ); + btngrp-> layout ( )-> setMargin ( 0 ); + + QGridLayout *grid = new QGridLayout ( btngrp-> layout ( )); + grid-> setAlignment ( Qt::AlignTop ); + grid-> setSpacing ( 3 ); + grid-> setMargin ( 7 ); + + QPushButton *quit = new QPushButton ( tr( "Terminate Opie" ), btngrp, "quit" ); + changeButtonColor ( quit, QColor ( 236, 236, 179 )); + btngrp-> insert ( quit, 4 ); + grid-> addWidget ( quit, 1, 1 ); + + QPushButton *reboot = new QPushButton ( tr( "Reboot" ), btngrp, "reboot" ); + changeButtonColor ( reboot, QColor( 236, 183, 181 )); + btngrp-> insert ( reboot, 2 ); + grid-> addWidget( reboot, 1, 0 ); + + QPushButton *restart = new QPushButton ( tr( "Restart Opie" ), btngrp, "restart" ); + changeButtonColor ( restart, QColor( 236, 236, 179 )); + btngrp-> insert ( restart, 3 ); + grid-> addWidget ( restart, 0, 1 ); - connect( ButtonGroup1, SIGNAL(clicked(int)), this, SLOT(buttonClicked(int)) ); - connect( cancel, SIGNAL(clicked()), this, SLOT(cancelClicked()) ); + QPushButton *shutdown = new QPushButton( tr( "Shutdown" ), btngrp, "shutdown" ); + changeButtonColor ( shutdown, QColor( 236, 183, 181 )); + btngrp-> insert ( shutdown, 1 ); + grid-> addWidget ( shutdown, 0, 0 ); + + vbox-> addWidget ( btngrp ); + + m_info = new QLabel ( this, "info" ); + m_info-> setText( tr( "<p>\n" "These termination options are provided primarily for use while developing and testing the Opie system. In a normal environment, these concepts are unnecessary." ) ); + vbox-> addWidget ( m_info ); + + m_progress = new QProgressBar ( this, "progressBar" ); + m_progress-> setFrameShape ( QProgressBar::Panel ); + m_progress-> setFrameShadow ( QProgressBar::Sunken ); + m_progress-> setTotalSteps ( 20 ); + m_progress-> setIndicatorFollowsStyle ( false ); + vbox-> addWidget ( m_progress ); + + vbox-> addItem ( new QSpacerItem ( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding )); + + QPushButton *cancel = new QPushButton ( tr( "Cancel" ), this, "cancel" ); + changeButtonColor ( cancel, QColor( 181, 222, 178 )); + cancel-> setDefault ( true ); + cancel-> setSizePolicy ( QSizePolicy ( QSizePolicy::Minimum, QSizePolicy::Expanding, cancel-> sizePolicy ( ). hasHeightForWidth ( ))); + vbox-> addWidget ( cancel ); + + m_timer = new QTimer ( this ); + connect ( m_timer, SIGNAL( timeout ( )), this, SLOT( timeout ( ))); + + connect ( btngrp, SIGNAL( clicked ( int )), this, SLOT( buttonClicked ( int ))); + connect ( cancel, SIGNAL( clicked ( )), this, SLOT( cancelClicked ( ))); + + m_progress-> hide ( ); + Global::hideInputMethod ( ); - progressBar->hide(); - Global::hideInputMethod(); #ifdef QT_QWS_CUSTOM - QPushButton *sb = Shutdown::shutdown; - sb->hide(); + shutdown-> hide ( ); #endif @@ -50,44 +121,45 @@ ShutdownImpl::ShutdownImpl( QWidget* parent, const char *name, WFlags fl ) -void ShutdownImpl::buttonClicked( int b ) +void ShutdownImpl::buttonClicked ( int b ) { - progress = 0; + m_counter = 0; + switch ( b ) { case 1: - operation = ShutdownSystem; + m_operation = ShutdownSystem; break; case 2: - operation = RebootSystem; + m_operation = RebootSystem; break; case 3: - operation = RestartDesktop; + m_operation = RestartDesktop; break; case 4: - operation = TerminateDesktop; + m_operation = TerminateDesktop; break; } - info->hide(); - progressBar->show(); - timer->start( 300 ); - timeout(); + m_info-> hide ( ); + m_progress-> show ( ); + m_timer-> start ( 300 ); + timeout ( ); } -void ShutdownImpl::cancelClicked() +void ShutdownImpl::cancelClicked ( ) { - progressBar->hide(); - info->show(); - if ( timer->isActive() ) - timer->stop(); + m_progress-> hide ( ); + m_info-> show ( ); + if ( m_timer-> isActive ( )) + m_timer-> stop ( ); else - close(); + close ( ); } -void ShutdownImpl::timeout() +void ShutdownImpl::timeout ( ) { - if ( (progress+=2) > progressBar->totalSteps() ) { - progressBar->hide(); - timer->stop(); - emit shutdown( operation ); - } else { - progressBar->setProgress( progress ); - } + if (( m_counter += 2 ) > m_progress-> totalSteps ( )) { + m_progress-> hide ( ); + m_timer-> stop ( ); + emit shutdown ( m_operation ); + } + else + m_progress-> setProgress ( m_counter ); } diff --git a/core/launcher/shutdownimpl.h b/core/launcher/shutdownimpl.h index 54668f3..462f347 100644 --- a/core/launcher/shutdownimpl.h +++ b/core/launcher/shutdownimpl.h @@ -22,7 +22,9 @@ -#include "shutdown.h" +#include <qwidget.h> class QTimer; +class QLabel; +class QProgressBar; -class ShutdownImpl : public Shutdown +class ShutdownImpl : public QWidget { @@ -43,5 +45,8 @@ private slots: private: - QTimer *timer; - int progress; - Type operation; + QTimer *m_timer; + int m_counter; + Type m_operation; + + QLabel * m_info; + QProgressBar *m_progress; }; |