Browse Source

Call setGuiItem with a KStandardGuiItem in the code for the KPushButtons which used to have stdItem set.

git-svn-id: file:///var/svn/tigccpp/trunk@1123 9552661e-59e3-4036-b4f2-dbe53926924f
kevinkofler 17 years ago
parent
commit
f57420f854

+ 6 - 19
ktigcc/customstyle.cpp

@@ -3,35 +3,22 @@
 #include <QVariant>
 #include <QImage>
 #include <QPixmap>
+#include <kpushbutton.h> 
 
-/*
- *  Constructs a CustomStyle as a child of 'parent', with the
- *  name 'name' and widget flags set to 'f'.
- *
- *  The dialog will by default be modeless, unless you set 'modal' to
- *  true to construct a modal dialog.
- */
 CustomStyle::CustomStyle(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
+  : QDialog(parent, name, modal, fl)
 {
-    setupUi(this);
-
+  setupUi(this);
+  okButton->setGuiItem(KStandardGuiItem::Ok);
+  cancelButton->setGuiItem(KStandardGuiItem::Cancel);
 }
 
-/*
- *  Destroys the object and frees any allocated resources
- */
 CustomStyle::~CustomStyle()
 {
-    // no need to delete child widgets, Qt does it all for us
 }
 
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
 void CustomStyle::languageChange()
 {
-    retranslateUi(this);
+  retranslateUi(this);
 }
 

+ 10 - 24
ktigcc/functions.cpp

@@ -23,41 +23,27 @@
 #include <QVariant>
 #include <QImage>
 #include <QPixmap>
+#include <kpushbutton.h> 
 
-// Make this slot public.
-void FunctionDialog::accept()
+FunctionDialog::FunctionDialog(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
+  : QDialog(parent, name, modal, fl)
 {
-  QDialog::accept();
+  setupUi(this);
+  cancelButton->setGuiItem(KStandardGuiItem::Cancel);
 }
 
-/*
- *  Constructs a FunctionDialog as a child of 'parent', with the
- *  name 'name' and widget flags set to 'f'.
- *
- *  The dialog will by default be modeless, unless you set 'modal' to
- *  true to construct a modal dialog.
- */
-FunctionDialog::FunctionDialog(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
+FunctionDialog::~FunctionDialog()
 {
-    setupUi(this);
-
 }
 
-/*
- *  Destroys the object and frees any allocated resources
- */
-FunctionDialog::~FunctionDialog()
+// Make this slot public.
+void FunctionDialog::accept()
 {
-    // no need to delete child widgets, Qt does it all for us
+  QDialog::accept();
 }
 
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
 void FunctionDialog::languageChange()
 {
-    retranslateUi(this);
+  retranslateUi(this);
 }
 

+ 13 - 27
ktigcc/newsdlg.cpp

@@ -27,6 +27,7 @@
 #include <kio/netaccess.h>
 #include <kmessagebox.h>
 #include <ksharedconfig.h>
+#include <kpushbutton.h> 
 #include <QVariant>
 #include <QImage>
 #include <QPixmap>
@@ -59,6 +60,17 @@ class ColoredListBoxText : public Q3ListBoxText {
     QColor color;
 };
 
+NewsDialog::NewsDialog(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
+  : QDialog(parent, name, modal, fl)
+{
+  setupUi(this);
+  closeButton->setGuiItem(KStandardGuiItem::Close);
+}
+
+NewsDialog::~NewsDialog()
+{
+}
+
 bool NewsDialog::loadNews()
 {
   QString tmpFile;
@@ -143,34 +155,8 @@ void NewsDialog::visitButton_clicked()
                static_cast<QWidget *>(parent()));
 }
 
-/*
- *  Constructs a NewsDialog as a child of 'parent', with the
- *  name 'name' and widget flags set to 'f'.
- *
- *  The dialog will by default be modeless, unless you set 'modal' to
- *  true to construct a modal dialog.
- */
-NewsDialog::NewsDialog(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
-{
-    setupUi(this);
-
-}
-
-/*
- *  Destroys the object and frees any allocated resources
- */
-NewsDialog::~NewsDialog()
-{
-    // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
 void NewsDialog::languageChange()
 {
-    retranslateUi(this);
+  retranslateUi(this);
 }
 

+ 3 - 0
ktigcc/preferencesdlg.cpp

@@ -47,6 +47,7 @@
 #include <kfiledialog.h>
 #include <kcursor.h>
 #include <kurl.h>
+#include <kpushbutton.h> 
 #include "ktigcc.h"
 #include "selectstyle.h"
 #include "selectcolors.h"
@@ -106,6 +107,8 @@ Preferences::Preferences(QWidget* parent, const char* name, bool modal, Qt::Wind
   : QDialog(parent, name, modal, fl)
 {
   setupUi(this);
+  okButton->setGuiItem(KStandardGuiItem::Ok);
+  cancelButton->setGuiItem(KStandardGuiItem::Cancel);
 
   // General
   stopAtFirstError->setChecked(preferences.stopAtFirstError);

+ 37 - 52
ktigcc/programoptions.cpp

@@ -30,9 +30,45 @@
 #include <QMouseEvent>
 #include <QAssistantClient>
 #include <QButtonGroup>
+#include <kpushbutton.h> 
 #include "ktigcc.h"
 #include "tpr.h"
 
+ProgramOptions::ProgramOptions(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
+  : QDialog(parent, name, modal, fl)
+{
+  setupUi(this);
+  buttonClose->setGuiItem(KStandardGuiItem::Close);
+  // Create button groups
+  QButtonGroup *group;
+  //Tab: Reloc Format
+  group=new QButtonGroup(this);
+  group->addButton(RelocAMS);
+  group->addButton(RelocKernel);
+  group->addButton(RelocCompressed);
+  group->addButton(RelocMlink);
+  group=new QButtonGroup(this);
+  group->addButton(ROMCallDirect);
+  group->addButton(ROMCallKernel);
+  group->addButton(ROMCallCompressed);
+  group->addButton(ROMCallMlink);
+  group->addButton(ROMCallFLine);
+  //Tab: BSS/Data Format
+  group=new QButtonGroup(this);
+  group->addButton(BSSMerge);
+  group->addButton(BSSKernel);
+  group->addButton(BSSCompressed);
+  group->addButton(BSSMlink);
+  group=new QButtonGroup(this);
+  group->addButton(DataVarKernel);
+  group->addButton(DataVarCompressed);
+  group->addButton(DataVarMlink);
+}
+
+ProgramOptions::~ProgramOptions()
+{
+}
+
 void ProgramOptions::ImportSettings()
 {
   //Tab: Calculator
@@ -178,7 +214,6 @@ void ProgramOptions::CalcCheckbox_toggled(bool on __attribute__((unused)))
   }
 }
 
-
 void ProgramOptions::KernelRadiobutton_toggled(bool on __attribute__((unused)))
 {
   static bool inEvent=FALSE;
@@ -255,7 +290,6 @@ void ProgramOptions::KernelRadiobutton_toggled(bool on __attribute__((unused)))
   }
 }
 
-
 void ProgramOptions::RelocSettings_toggled(bool on __attribute__((unused)))
 {
   static bool inEvent=FALSE;
@@ -291,7 +325,6 @@ void ProgramOptions::RelocSettings_toggled(bool on __attribute__((unused)))
   }
 }
 
-
 void ProgramOptions::mousePressEvent( QMouseEvent * e )
 {
   if (e->button()==Qt::RightButton) {
@@ -309,57 +342,9 @@ void ProgramOptions::mousePressEvent( QMouseEvent * e )
   }
 }
 
-/*
- *  Constructs a ProgramOptions as a child of 'parent', with the
- *  name 'name' and widget flags set to 'f'.
- *
- *  The dialog will by default be modeless, unless you set 'modal' to
- *  true to construct a modal dialog.
- */
-ProgramOptions::ProgramOptions(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
-{
-  setupUi(this);
-  // Create button groups
-  QButtonGroup *group;
-  //Tab: Reloc Format
-  group=new QButtonGroup(this);
-  group->addButton(RelocAMS);
-  group->addButton(RelocKernel);
-  group->addButton(RelocCompressed);
-  group->addButton(RelocMlink);
-  group=new QButtonGroup(this);
-  group->addButton(ROMCallDirect);
-  group->addButton(ROMCallKernel);
-  group->addButton(ROMCallCompressed);
-  group->addButton(ROMCallMlink);
-  group->addButton(ROMCallFLine);
-  //Tab: BSS/Data Format
-  group=new QButtonGroup(this);
-  group->addButton(BSSMerge);
-  group->addButton(BSSKernel);
-  group->addButton(BSSCompressed);
-  group->addButton(BSSMlink);
-  group=new QButtonGroup(this);
-  group->addButton(DataVarKernel);
-  group->addButton(DataVarCompressed);
-  group->addButton(DataVarMlink);
-}
-
-/*
- *  Destroys the object and frees any allocated resources
- */
-ProgramOptions::~ProgramOptions()
-{
-    // no need to delete child widgets, Qt does it all for us
-}
 
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
 void ProgramOptions::languageChange()
 {
-    retranslateUi(this);
+  retranslateUi(this);
 }
 

+ 6 - 20
ktigcc/programoutput.cpp

@@ -1,34 +1,20 @@
 #include "programoutput.h"
 
 #include <QVariant>
-/*
- *  Constructs a ProgramOutput as a child of 'parent', with the
- *  name 'name' and widget flags set to 'f'.
- *
- *  The dialog will by default be modeless, unless you set 'modal' to
- *  true to construct a modal dialog.
- */
+#include <kpushbutton.h> 
+
 ProgramOutput::ProgramOutput(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
+  : QDialog(parent, name, modal, fl)
 {
-    setupUi(this);
-
+  setupUi(this);
+  buttonClose->setGuiItem(KStandardGuiItem::Close);
 }
 
-/*
- *  Destroys the object and frees any allocated resources
- */
 ProgramOutput::~ProgramOutput()
 {
-    // no need to delete child widgets, Qt does it all for us
 }
 
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
 void ProgramOutput::languageChange()
 {
-    retranslateUi(this);
+  retranslateUi(this);
 }
-

+ 3 - 0
ktigcc/projectoptions.cpp

@@ -29,6 +29,7 @@
 #include <kfiledialog.h>
 #include <kshell.h>
 #include <kurl.h>
+#include <kpushbutton.h> 
 #include "ktigcc.h"
 #include "tpr.h"
 #include "programoptions.h"
@@ -40,6 +41,8 @@ ProjectOptions::ProjectOptions(QWidget* parent, const char* name, bool modal, Qt
   : QDialog(parent, name, modal, fl)
 {
   setupUi(this);
+  buttonOk->setGuiItem(KStandardGuiItem::Ok);
+  buttonCancel->setGuiItem(KStandardGuiItem::Cancel);
   if (!have_fargo) FargoProgram->hide();
   if (!have_flashos) FlashOperatingSystem->hide();
   //Create the Program Options dialog

+ 14 - 27
ktigcc/selectcolors.cpp

@@ -21,12 +21,25 @@
 #include "selectcolors.h"
 
 #include <kcolordialog.h>
+#include <kpushbutton.h> 
 #include <QVariant>
 #include <QImage>
 #include <QPixmap>
 #include <QColor>
 #include "colorlistitem.h"
 
+SelectColors::SelectColors(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
+  : QDialog(parent, name, modal, fl)
+{
+  setupUi(this);
+  okButton->setGuiItem(KStandardGuiItem::Ok);
+  cancelButton->setGuiItem(KStandardGuiItem::Cancel);
+}
+
+SelectColors::~SelectColors()
+{
+}
+
 void SelectColors::colorList_selectionChanged()
 {
   bool haveSelectedItem=!!colorList->selectedItem();
@@ -56,34 +69,8 @@ void SelectColors::editButton_clicked()
   }
 }
 
-/*
- *  Constructs a SelectColors as a child of 'parent', with the
- *  name 'name' and widget flags set to 'f'.
- *
- *  The dialog will by default be modeless, unless you set 'modal' to
- *  true to construct a modal dialog.
- */
-SelectColors::SelectColors(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
-{
-    setupUi(this);
-
-}
-
-/*
- *  Destroys the object and frees any allocated resources
- */
-SelectColors::~SelectColors()
-{
-    // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
 void SelectColors::languageChange()
 {
-    retranslateUi(this);
+  retranslateUi(this);
 }
 

+ 14 - 27
ktigcc/selectstyle.cpp

@@ -23,6 +23,19 @@
 #include <QVariant>
 #include <QImage>
 #include <QPixmap>
+#include <kpushbutton.h> 
+
+SelectStyle::SelectStyle(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
+  : QDialog(parent, name, modal, fl)
+{
+  setupUi(this);
+  okButton->setGuiItem(KStandardGuiItem::Ok);
+  cancelButton->setGuiItem(KStandardGuiItem::Cancel);
+}
+
+SelectStyle::~SelectStyle()
+{
+}
 
 void SelectStyle::customStyle_toggled(bool on)
 {
@@ -38,34 +51,8 @@ void SelectStyle::customStyle_toggled(bool on)
   strikeoutChk->setEnabled(on);
 }
 
-/*
- *  Constructs a SelectStyle as a child of 'parent', with the
- *  name 'name' and widget flags set to 'f'.
- *
- *  The dialog will by default be modeless, unless you set 'modal' to
- *  true to construct a modal dialog.
- */
-SelectStyle::SelectStyle(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
-{
-    setupUi(this);
-
-}
-
-/*
- *  Destroys the object and frees any allocated resources
- */
-SelectStyle::~SelectStyle()
-{
-    // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
 void SelectStyle::languageChange()
 {
-    retranslateUi(this);
+  retranslateUi(this);
 }
 

+ 4 - 1
ktigcc/toolprops.cpp

@@ -28,12 +28,15 @@
 #include <kurlrequester.h>
 #include <kfiledialog.h>
 #include <kshell.h>
+#include <kpushbutton.h> 
 #include "ktigcc.h"
 
 ToolProperties::ToolProperties(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
+  : QDialog(parent, name, modal, fl)
 {
   setupUi(this);
+  okButton->setGuiItem(KStandardGuiItem::Ok);
+  cancelButton->setGuiItem(KStandardGuiItem::Cancel);
   workingDirectory->setMode(KFile::LocalOnly|KFile::ExistingOnly|KFile::Directory);
 
   if (toolIndex>=0) {

+ 4 - 1
ktigcc/toolsdlg.cpp

@@ -24,13 +24,16 @@
 #include <QImage>
 #include <QPixmap>
 #include <k3listview.h>
+#include <kpushbutton.h> 
 #include "ktigcc.h"
 #include "toolprops.h"
 
 ToolsDialog::ToolsDialog(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
+  : QDialog(parent, name, modal, fl)
 {
   setupUi(this);
+  okButton->setGuiItem(KStandardGuiItem::Ok);
+  cancelButton->setGuiItem(KStandardGuiItem::Cancel);
   tempTools=tools;
   listView->clear();
   listView->setSorting(-1);

+ 6 - 19
ktigcc/wordlist.cpp

@@ -3,35 +3,22 @@
 #include <QVariant>
 #include <QImage>
 #include <QPixmap>
+#include <kpushbutton.h> 
 
-/*
- *  Constructs a WordList as a child of 'parent', with the
- *  name 'name' and widget flags set to 'f'.
- *
- *  The dialog will by default be modeless, unless you set 'modal' to
- *  true to construct a modal dialog.
- */
 WordList::WordList(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
-    : QDialog(parent, name, modal, fl)
+  : QDialog(parent, name, modal, fl)
 {
-    setupUi(this);
-
+  setupUi(this);
+  okButton->setGuiItem(KStandardGuiItem::Ok);
+  cancelButton->setGuiItem(KStandardGuiItem::Cancel);
 }
 
-/*
- *  Destroys the object and frees any allocated resources
- */
 WordList::~WordList()
 {
-    // no need to delete child widgets, Qt does it all for us
 }
 
-/*
- *  Sets the strings of the subwidgets using the current
- *  language.
- */
 void WordList::languageChange()
 {
-    retranslateUi(this);
+  retranslateUi(this);
 }