r12977 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r12976‎ | r12977 | r12978 >
Date:02:52, 8 February 2006
Author:vibber
Status:old
Tags:
Comment:
Make schema version selection work in the GUI
Modified paths:
  • /trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperGui.java (modified) (history)
  • /trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindow.java (modified) (history)
  • /trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindowForm.form (modified) (history)
  • /trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindowForm.java (modified) (history)

Diff [purge]

Index: trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperGui.java
@@ -105,6 +105,11 @@
106106 checkSchema();
107107 }
108108
 109+ void setSchema(String schema) {
 110+ this.schema = schema;
 111+ checkSchema();
 112+ }
 113+
109114 void checkSchema() {
110115 schemaReady = false;
111116 if (connected) {
Index: trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindow.java
@@ -186,6 +186,14 @@
187187 backend.setDbname(dbnameText.getText());
188188 }
189189
 190+ protected void onSchema14RadioActionPerformed(java.awt.event.ActionEvent evt) {
 191+ backend.setSchema("1.4");
 192+ }
 193+
 194+ protected void onSchema15RadioActionPerformed(java.awt.event.ActionEvent evt) {
 195+ backend.setSchema("1.5");
 196+ }
 197+
190198 /* ---- more random crap ---- */
191199
192200 File chooseFile(String message) {
Index: trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindowForm.java
@@ -167,12 +167,22 @@
168168 schema14Radio.setText("1.4 (cur, old)");
169169 schema14Radio.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
170170 schema14Radio.setMargin(new java.awt.Insets(0, 0, 0, 0));
 171+ schema14Radio.addActionListener(new java.awt.event.ActionListener() {
 172+ public void actionPerformed(java.awt.event.ActionEvent evt) {
 173+ schema14RadioActionPerformed(evt);
 174+ }
 175+ });
171176
172177 schemaRadios.add(schema15Radio);
173178 schema15Radio.setSelected(true);
174179 schema15Radio.setText("1.5 (page, revision, text)");
175180 schema15Radio.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
176181 schema15Radio.setMargin(new java.awt.Insets(0, 0, 0, 0));
 182+ schema15Radio.addActionListener(new java.awt.event.ActionListener() {
 183+ public void actionPerformed(java.awt.event.ActionEvent evt) {
 184+ schema15RadioActionPerformed(evt);
 185+ }
 186+ });
177187
178188 prefixLabel.setText("Table prefix");
179189
@@ -313,6 +323,14 @@
314324 pack();
315325 }// </editor-fold>//GEN-END:initComponents
316326
 327+ private void schema15RadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_schema15RadioActionPerformed
 328+ onSchema15RadioActionPerformed(evt); // i hate you, netbeans gui editor
 329+ }//GEN-LAST:event_schema15RadioActionPerformed
 330+
 331+ private void schema14RadioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_schema14RadioActionPerformed
 332+ onSchema14RadioActionPerformed(evt); // i hate you, netbeans gui editor
 333+ }//GEN-LAST:event_schema14RadioActionPerformed
 334+
317335 private void dbnameTextActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_dbnameTextActionPerformed
318336 onDbnameTextActionPerformed(evt); // i hate you, netbeans gui editor
319337 }//GEN-LAST:event_dbnameTextActionPerformed
@@ -397,4 +415,12 @@
398416 // TODO add your handling code here:
399417 }
400418
 419+ protected void onSchema14RadioActionPerformed(java.awt.event.ActionEvent evt) {
 420+// TODO add your handling code here:
 421+ }
 422+
 423+ protected void onSchema15RadioActionPerformed(java.awt.event.ActionEvent evt) {
 424+// TODO add your handling code here:
 425+ }
 426+
401427 }
Index: trunk/mwdumper/src/org/mediawiki/dumper/gui/DumperWindowForm.form
@@ -334,6 +334,9 @@
335335 <Insets value="[0, 0, 0, 0]"/>
336336 </Property>
337337 </Properties>
 338+ <Events>
 339+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="schema14RadioActionPerformed"/>
 340+ </Events>
338341 </Component>
339342 <Component class="javax.swing.JRadioButton" name="schema15Radio">
340343 <Properties>
@@ -351,6 +354,9 @@
352355 <Insets value="[0, 0, 0, 0]"/>
353356 </Property>
354357 </Properties>
 358+ <Events>
 359+ <EventHandler event="actionPerformed" listener="java.awt.event.ActionListener" parameters="java.awt.event.ActionEvent" handler="schema15RadioActionPerformed"/>
 360+ </Events>
355361 </Component>
356362 <Component class="javax.swing.JLabel" name="prefixLabel">
357363 <Properties>

Status & tagging log