Commit 06d895c1 authored by Tomas Mecir's avatar Tomas Mecir

more porting

parent fc4fafad
......@@ -318,9 +318,9 @@ void cConnection::showConnPrefsDialog ()
d->sdlg = new dlgProfileSettings (KMuddy::self());
//then we connect() all its signals - this handles everything that the dialog offers...
connect (d->sdlg, SIGNAL (okClicked()), this,
connect (d->sdlg, SIGNAL (accepted()), this,
SLOT (getSettingsFromDialog()));
connect (d->sdlg, SIGNAL (applyClicked()), this,
connect (d->sdlg->button (QDialogButtonBox::Apply), SIGNAL (clicked()), this,
SLOT (getSettingsFromDialog()));
//next we fill in its data
......
......@@ -225,8 +225,8 @@ void cTranscript::configure ()
tdlg = new dlgTranscript (cActionManager::self()->mainWidget());
//then we connect() all its signals - this handles everything that the dialog offers...
connect (tdlg, SIGNAL (okClicked()), this, SLOT (applyTranscript ()));
connect (tdlg, SIGNAL (applyClicked()), this, SLOT (applyTranscript ()));
connect (tdlg, SIGNAL (accepted()), this, SLOT (applyTranscript ()));
connect (tdlg->button (QDialogButtonBox::Apply), SIGNAL (clicked()), this, SLOT (applyTranscript ()));
//next we fill in its data
tdlg->setEnabled (running);
......@@ -423,7 +423,7 @@ void cTranscript::dumpBuffer ()
bdlg->setFileName (fName);
bdlg->setType (TRANSCRIPT_HTML);
//then we connect() all its signals - this handles everything that the dialog offers...
connect (bdlg, SIGNAL (okClicked()), this, SLOT (doDumpBuffer ()));
connect (bdlg, SIGNAL (accepted()), this, SLOT (doDumpBuffer ()));
//dialog is ready - show it!
bdlg->exec ();
......
......@@ -29,5 +29,5 @@ set(dialogs_LIB_SRCS
add_library(dialogs STATIC ${dialogs_LIB_SRCS})
target_link_libraries(dialogs KF5::I18n Qt5::Widgets KF5::WidgetsAddons)
target_link_libraries(dialogs KF5::I18n KF5::KDELibs4Support Qt5::Widgets KF5::WidgetsAddons)
......@@ -17,12 +17,13 @@
#include "cdirlist.h"
#include <QFileDialog>
#include <QGridLayout>
#include <QIcon>
#include <QListWidget>
#include <kpushbutton.h>
#include <QPushButton>
#include <kapplication.h>
#include <kfiledialog.h>
#include <klocale.h>
cDirList::cDirList (QWidget *parent) : QWidget(parent)
......@@ -32,10 +33,10 @@ cDirList::cDirList (QWidget *parent) : QWidget(parent)
//create all widgets
listbox = new QListWidget (this);
btadd = new KPushButton (i18n ("&Add..."), this);
btdel = new KPushButton (i18n ("Delete"), this);
btup = new KPushButton (KIcon ("go-up"), i18n ("Move &up"), this);
btdown = new KPushButton (KIcon ("go-down"), i18n ("Move &down"), this);
btadd = new QPushButton (i18n ("&Add..."), this);
btdel = new QPushButton (i18n ("Delete"), this);
btup = new QPushButton (QIcon::fromTheme ("go-up"), i18n ("Move &up"), this);
btdown = new QPushButton (QIcon::fromTheme ("go-down"), i18n ("Move &down"), this);
//add widgets to layout
layout->setSpacing (10);
......@@ -69,12 +70,11 @@ void cDirList::setDirList (const QStringList &dlist)
void cDirList::addEntry ()
{
QString dirName = KFileDialog::getExistingDirectory (QString(), this, i18n ("Choose sound directory"));
if (dirName != QString())
{
dirlist.append (dirName);
update();
}
QString dirName = QFileDialog::getExistingDirectory (this, i18n ("Choose sound directory"));
if (dirName.isEmpty()) return;
dirlist.append (dirName);
update();
}
void cDirList::removeEntry ()
......
......@@ -19,11 +19,11 @@
#define CDIRLIST_H
#include <qstringlist.h>
#include <qwidget.h>
#include <QWidget>
#include <kvbox.h>
class QListWidget;
class KPushButton;
class QPushButton;
/**
A widget that allows you to choose a list of directories.
......@@ -47,7 +47,7 @@ protected:
void update ();
QListWidget *listbox;
KPushButton *btadd, *btdel, *btup, *btdown;
QPushButton *btadd, *btdel, *btup, *btdown;
QStringList dirlist;
};
......
......@@ -31,18 +31,18 @@
#include <QGroupBox>
#include <QHBoxLayout>
#include <QVBoxLayout>
#include <QIcon>
#include <QLabel>
#include <QPushButton>
#include <kapplication.h>
#include <kcolorbutton.h>
#include <kconfig.h>
#include <kfontdialog.h>
#include <kiconloader.h>
#include <kshortcutsdialog.h>
#include <klineedit.h>
#include <klocale.h>
#include <knuminput.h>
#include <kpushbutton.h>
#include <kstandarddirs.h>
dlgAppSettings::dlgAppSettings (QWidget *parent) : KPageDialog (parent)
......@@ -65,28 +65,28 @@ dlgAppSettings::dlgAppSettings (QWidget *parent) : KPageDialog (parent)
KPageWidgetItem *item;
QFrame *frmwindow = new QFrame (this);
item = addPage (frmwindow, i18n ("Window"));
item->setIcon (KIcon ("window-new"));
item->setIcon (QIcon::fromTheme ("window-new"));
QFrame *frmoutputarea = new QFrame (this);
item = addPage (frmoutputarea, i18n ("Output area"));
item->setIcon (KIcon ("format-justify-left"));
item->setIcon (QIcon::fromTheme ("format-justify-left"));
QFrame *frmfont = new QFrame (this);
item = addPage (frmfont, i18n ("Font"));
item->setIcon (KIcon ("preferences-desktop-font"));
item->setIcon (QIcon::fromTheme ("preferences-desktop-font"));
QFrame *frminput = new QFrame (this);
item = addPage (frminput, i18n ("Input line"));
item->setIcon (KIcon ("edit-clear"));
item->setIcon (QIcon::fromTheme ("edit-clear"));
QFrame *frmcolors = new QFrame (this);
item = addPage (frmcolors, i18n ("Colors"));
item->setIcon (KIcon ("color-picker"));
item->setIcon (QIcon::fromTheme ("color-picker"));
QFrame *frmchars = new QFrame (this);
item = addPage (frmchars, i18n ("Strings"));
item->setIcon (KIcon ("format-indent-less"));
item->setIcon (QIcon::fromTheme ("format-indent-less"));
QFrame *frmsound = new QFrame (this);
item = addPage (frmsound, i18n ("Sounds"));
item->setIcon (KIcon ("media-playback-start"));
item->setIcon (QIcon::fromTheme ("media-playback-start"));
QFrame *frmshortcuts = new QFrame (this);
item = addPage (frmshortcuts, i18n ("Shortcuts"));
item->setIcon (KIcon ("configure-shortcuts"));
item->setIcon (QIcon::fromTheme ("configure-shortcuts"));
//page 1
QGridLayout *winlayout = new QGridLayout (frmwindow);
......@@ -288,7 +288,7 @@ dlgAppSettings::dlgAppSettings (QWidget *parent) : KPageDialog (parent)
QLabel *fl1 = new QLabel (i18n ("&Server output"), frmfont);
fonted1 = new QLabel (frmfont);
fonted1->setFrameStyle (QFrame::StyledPanel | QFrame::Sunken);
KPushButton *bfont1 = new KPushButton (i18n ("Choose..."), frmfont);
QPushButton *bfont1 = new QPushButton (i18n ("Choose..."), frmfont);
fl1->setBuddy (bfont1);
connect (bfont1, SIGNAL (clicked()), this, SLOT (fontchooser1 ()));
QString serveroutput = i18n ("Here you can select a font that will be used for main display.");
......@@ -298,7 +298,7 @@ dlgAppSettings::dlgAppSettings (QWidget *parent) : KPageDialog (parent)
QLabel *fl2 = new QLabel (i18n ("&Input line"), frmfont);
fonted2 = new QLabel (frmfont);
fonted2->setFrameStyle (QFrame::StyledPanel | QFrame::Sunken);
KPushButton *bfont2 = new KPushButton (i18n ("Choose..."), frmfont);
QPushButton *bfont2 = new QPushButton (i18n ("Choose..."), frmfont);
fl2->setBuddy (bfont2);
connect (bfont2, SIGNAL (clicked()), this, SLOT (fontchooser2 ()));
QString inputline = i18n ("Here you can select a font that will be used for the input line.");
......@@ -308,7 +308,7 @@ dlgAppSettings::dlgAppSettings (QWidget *parent) : KPageDialog (parent)
QLabel *fl3 = new QLabel (i18n ("&Multi-line input"), frmfont);
fonted3 = new QLabel (frmfont);
fonted3->setFrameStyle (QFrame::StyledPanel | QFrame::Sunken);
KPushButton *bfont3 = new KPushButton (i18n ("Choose..."), frmfont);
QPushButton *bfont3 = new QPushButton (i18n ("Choose..."), frmfont);
fl3->setBuddy (bfont3);
connect (bfont3, SIGNAL (clicked()), this, SLOT (fontchooser3 ()));
QString minputline = i18n ("Here you can select a font that will be used for the multi-line input window.");
......@@ -551,8 +551,8 @@ dlgAppSettings::dlgAppSettings (QWidget *parent) : KPageDialog (parent)
cActionManager::self()->invokeEvent ("dialog-create", 0, "app-prefs");
//then we connect() all its signals - this handles everything that the dialog offers...
connect (this, SIGNAL (okClicked()), this, SLOT (getSettingsFromDialog()));
connect (this, SIGNAL (applyClicked()), this, SLOT (getSettingsFromDialog()));
connect (this, SIGNAL (accepted()), this, SLOT (getSettingsFromDialog()));
connect (button (QDialogButtonBox::Apply), SIGNAL (clicked()), this, SLOT (getSettingsFromDialog()));
}
dlgAppSettings::~dlgAppSettings()
......@@ -561,7 +561,7 @@ dlgAppSettings::~dlgAppSettings()
cDialogList::self()->removeDialog ("app-prefs");
}
QSize dlgConnect::sizeHint() const
QSize dlgAppSettings::sizeHint() const
{
return QSize (600, 400);
}
......
......@@ -48,6 +48,7 @@ public:
~dlgAppSettings();
static void showSettingsDialog ();
QSize sizeHint() const override;
//functions to get/set values
//Window
......
......@@ -74,7 +74,7 @@ dlgConnect::dlgConnect(QWidget *parent) : QDialog (parent)
"profiles."));
chkOffline->setChecked(false);
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *button = buttons->button (QDialogButtonBox::Ok);
button->setText (i18n ("&Connect"));
button->setToolTip (i18n ("Establishes connection with specified parameters."));
......@@ -136,13 +136,14 @@ bool dlgConnect::isOffLine()
void dlgConnect::selectionChanged (const QItemSelection &index)
{
//enable/disable Connect button
enableButtonOk (index.indexes().empty() ? false : true);
QPushButton *button = buttons->button (QDialogButtonBox::Ok);
button->setEnabled (index.indexes().empty() ? false : true);
}
void dlgConnect::doubleClicked (const QModelIndex &index)
{
if (index.isValid ())
slotButtonClicked (KDialog::Ok);
accept();
}
void dlgConnect::addPressed ()
......@@ -151,7 +152,7 @@ void dlgConnect::addPressed ()
mdlg = new dlgEditProfile (this);
//then we connect() all its signals - this handles everything that the dialog offers...
connect (mdlg, SIGNAL (okClicked ()), this, SLOT (doAdd ()));
connect (mdlg, SIGNAL (accepted()), this, SLOT (doAdd ()));
//fill in default login sequence
QStringList ls;
......@@ -175,7 +176,7 @@ void dlgConnect::modifyPressed ()
mdlg = new dlgEditProfile (this);
//then we connect() all its signals - this handles everything that the dialog offers...
connect (mdlg, SIGNAL (okClicked ()), this, SLOT (doModify ()));
connect (mdlg, SIGNAL (accepted()), this, SLOT (doModify ()));
mdlg->setName (mgr->visibleProfileName (profile));
mdlg->setServer (sett->getString ("server"));
......
......@@ -26,6 +26,7 @@
class QTreeView;
class KPushButton;
class QCheckBox;
class QDialogButtonBox;
class dlgEditProfile;
......@@ -49,6 +50,7 @@ protected:
QCheckBox *chkSendNothing;
QCheckBox *chkOffline;
dlgEditProfile *mdlg;
QDialogButtonBox *buttons;
void updateProfileFromDialog (const QString &profile);
protected slots:
......
......@@ -21,6 +21,7 @@
#include <qcheckbox.h>
#include <qcombobox.h>
#include <QDialogButtonBox>
#include <qlabel.h>
#include <qpushbutton.h>
#include <QHBoxLayout>
......@@ -34,7 +35,6 @@ dlgDumpBuffer::dlgDumpBuffer (QWidget *parent) : QDialog (parent)
{
//initial dialog size
setWindowTitle (i18n ("Dump output buffer"));
setButtons (KDialog::Ok | KDialog::Cancel);
//create main dialog's widget
QVBoxLayout *layout = new QVBoxLayout (this);
......@@ -72,6 +72,10 @@ dlgDumpBuffer::dlgDumpBuffer (QWidget *parent) : QDialog (parent)
typelayout->addWidget (lbltype);
typelayout->addWidget (ttype);
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
connect (buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect (buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
//connect the Browse button!
connect (filebutton, SIGNAL (clicked ()), this, SLOT (browseFiles ()));
......@@ -84,6 +88,7 @@ dlgDumpBuffer::dlgDumpBuffer (QWidget *parent) : QDialog (parent)
layout->addWidget (chkcurpos);
layout->addWidget (fileframe);
layout->addWidget (typeframe);
layout->addWidget (buttons);
//initial dialog settings...
chkcurpos->setChecked (false);
......
......@@ -24,6 +24,7 @@
#include "cmudlist.h"
#include "dlgmudlist.h"
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
......@@ -38,7 +39,6 @@
dlgEditProfile::dlgEditProfile(QWidget *parent) : QDialog (parent)
{
setWindowTitle (i18n ("Edit profile"));
setButtons (KDialog::Ok | KDialog::Cancel);
//create main dialog's widget
QGridLayout *layout = new QGridLayout (this);
......@@ -59,6 +59,7 @@ dlgEditProfile::dlgEditProfile(QWidget *parent) : QDialog (parent)
ed3 = new KRestrictedLine (this);
ed3->setValidChars ("0123456789");
ed3->setWhatsThis( i18n ("Enter port on which your MUD running (usually some 4-digit number)."));
ed3->setFixedWidth (80);
QLabel *l4 = new QLabel (i18n ("&Login name:"), this);
ed4 = new KLineEdit (this);
ed4->setWhatsThis( i18n ("Enter your login name on the MUD here.<p><i>This setting is optional.</i>"));
......@@ -77,7 +78,9 @@ dlgEditProfile::dlgEditProfile(QWidget *parent) : QDialog (parent)
"No aliases, no macros, no speed-walk. Also note that empty lines "
"will also be sent, including the very last line."));
ed3->setFixedWidth (80);
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
connect (buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect (buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
l1->setBuddy (ed1);
l2->setBuddy (ed2);
......@@ -100,6 +103,7 @@ dlgEditProfile::dlgEditProfile(QWidget *parent) : QDialog (parent)
layout->addWidget (ed4, 4, 1);
layout->addWidget (ed5, 5, 1);
layout->addWidget (connstr, 7, 0, 1, 2);
layout->addWidget (buttons, 8, 0, 1, 2);
ed1->setFocus ();
}
......@@ -183,7 +187,7 @@ void dlgEditProfile::openMudList ()
setPort (e->port);
}
void dlgEditProfile::slotOk ()
void dlgEditProfile::accept ()
{
QString s = name ().simplified ();
bool failed = false;
......@@ -199,11 +203,9 @@ void dlgEditProfile::slotOk ()
failed = true;
}
//if name is okay, accept() the dialog...
if (!failed)
{
accept ();
emit okClicked ();
}
//if name is okay, accept the dialog...
if (failed) return;
QDialog::accept ();
}
......@@ -53,7 +53,7 @@ public:
void setPassword (QString password);
void setConnectionString (QStringList conn);
protected slots:
void slotOk ();
void accept() override;
void openMudList ();
protected:
......
......@@ -19,9 +19,11 @@
#include "kmuddy.h"
#include <qlabel.h>
#include <QDialogButtonBox>
#include <QLabel>
#include <QPushButton>
#include <klocale.h>
#include <KLocalizedString>
#include <kvbox.h>
dlgGrabKey::dlgGrabKey (QWidget *parent) : QDialog (parent)
......@@ -29,13 +31,17 @@ dlgGrabKey::dlgGrabKey (QWidget *parent) : QDialog (parent)
KMuddy::self()->setGrabDialog (this);
//initial dialog size
setCWindowTitle (i18n ("Keygrabber"));
setButtons (KDialog::Cancel);
setDefaultButton (KDialog::Cancel);
setWindowTitle (i18n ("Keygrabber"));
//create main dialog's widget
KVBox *vbox = new KVBox (this);
new QLabel (i18n ("Press the desired shortcut..."), vbox);
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Cancel, vbox);
QPushButton *button = buttons->button (QDialogButtonBox::Cancel);
button->setDefault(true);
connect (buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect (buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
}
dlgGrabKey::~dlgGrabKey ()
......
......@@ -125,7 +125,8 @@ dlgObjects::dlgObjects (QWidget *parent)
connect (d->lists, SIGNAL (currentIndexChanged (int)),
this, SLOT (listChanged (int)));
connect (d->viewer, SIGNAL (itemActivated (cListObject *)), this, SLOT (activeObjectChanged (cListObject *)));
connect (this, SIGNAL (closeClicked ()), this, SLOT (saveChanges ()));
connect (buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect (this, &QDialog::accepted, this, SLOT (saveChanges()));
d->currentSession = cActionManager::self()->activeSession ();
......
......@@ -21,18 +21,19 @@
#include "cdirlist.h"
#include "cdialoglist.h"
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qlabel.h>
#include <qpushbutton.h>
#include <QCheckBox>
#include <QComboBox>
#include <QFileDialog>
#include <QIcon>
#include <QLabel>
#include <QPushButton>
#include <QGridLayout>
#include <QVBoxLayout>
#include <kapplication.h>
#include <kcodecaction.h>
#include <kfiledialog.h>
#include <kiconloader.h>
#include <klineedit.h>
#include <klocale.h>
#include <KLocalizedString>
dlgProfileSettings::dlgProfileSettings (QWidget *parent) : KPageDialog (parent)
{
......@@ -47,20 +48,20 @@ dlgProfileSettings::dlgProfileSettings (QWidget *parent) : KPageDialog (parent)
KPageWidgetItem *item;
QFrame *frmconn = new QFrame (this);
item = addPage (frmconn, i18n ("Connection"));
item->setIcon (KIcon ("connection-established"));
item->setIcon (QIcon::fromTheme ("connection-established"));
QFrame *frmcommands = new QFrame (this);
item = addPage (frmcommands, i18n ("Commands"));
item->setIcon (KIcon ("gear"));
item->setIcon (QIcon::fromTheme ("gear"));
QFrame *frmdirs = new QFrame (this);
item = addPage (frmdirs, i18n ("Folders"));
item->setIcon (KIcon ("folder"));
item->setIcon (QIcon::fromTheme ("folder"));
QFrame *frmsound = new QFrame (this);
item = addPage (frmsound, i18n ("Sound"));
item->setIcon (KIcon ("media-playback-start"));
item->setIcon (QIcon::fromTheme ("media-playback-start"));
#ifdef HAVE_MXP
QFrame *frmmxp = new QFrame (this);
item = addPage (frmmxp, i18n ("MXP"));
item->setIcon (KIcon ("go-jump"));
item->setIcon (QIcon::fromTheme ("go-jump"));
#endif
//page 1
......@@ -393,17 +394,17 @@ void dlgProfileSettings::setScriptWorkDir (const QString &s)
void dlgProfileSettings::choosedir1 ()
{
edscriptdir->setText (KFileDialog::getExistingDirectory (edscriptdir->text(), this, i18n ("Choose default script location")));
edscriptdir->setText (QFileDialog::getExistingDirectory (this, i18n ("Choose default script location"), edscriptdir->text()));
}
void dlgProfileSettings::choosedir2 ()
{
edscriptworkdir->setText (KFileDialog::getExistingDirectory (edscriptworkdir->text(), this, i18n ("Choose default script working directory")));
edscriptworkdir->setText (QFileDialog::getExistingDirectory (this, i18n ("Choose default script working directory"), edscriptworkdir->text()));
}
void dlgProfileSettings::choosedir3 ()
{
edtranscriptdir->setText (KFileDialog::getExistingDirectory (edtranscriptdir->text(), this, i18n ("Choose default transcript directory")));
edtranscriptdir->setText (QFileDialog::getExistingDirectory (this, i18n ("Choose default transcript directory"), edtranscriptdir->text()));
}
void dlgProfileSettings::encodingChanged (const QString &enc)
......
......@@ -21,10 +21,12 @@
//needed by gcc 3.2
#define max(a,b) (((a) >= (b)) ? (a) : (b))
#include <qlabel.h>
#include <QDialogButtonBox>
#include <QGridLayout>
#include <QLabel>
#include <QPushButton>
#include <klocale.h>
#include <KLocalizedString>
#include <klineedit.h>
#include <krestrictedline.h>
......@@ -32,19 +34,14 @@ dlgQuickConnect::dlgQuickConnect(QWidget *parent) : QDialog (parent)
{
//initial dialog size
setWindowTitle (i18n ("Quick Connect"));
setButtons (KDialog::Ok | KDialog::Cancel);
//create main dialog's widget
QWidget *page = new QWidget (this);
QGridLayout *layout = new QGridLayout (page);
setMainWidget (page);
QGridLayout *layout = new QGridLayout (this);
//put some edit boxes there
QLabel *l1 = new QLabel (i18n ("&Host:"), page);
ed1 = new KLineEdit (page);
QLabel *l2 = new QLabel (i18n ("&Port:"), page);
ed2 = new KRestrictedLine (page);
QLabel *l1 = new QLabel (i18n ("&Host:"), this);
ed1 = new KLineEdit (this);
QLabel *l2 = new QLabel (i18n ("&Port:"), this);
ed2 = new KRestrictedLine (this);
ed2->setValidChars ("0123456789");
int w = max (l1->width(), l2->width());
l1->setFixedWidth (w);
......@@ -55,14 +52,18 @@ dlgQuickConnect::dlgQuickConnect(QWidget *parent) : QDialog (parent)
l1->setBuddy (ed1);
l2->setBuddy (ed2);
QDialogButtonBox *buttons = new QDialogButtonBox (QDialogButtonBox::Ok | QDialogButtonBox::Cancel, this);
QPushButton *button = buttons->button (QDialogButtonBox::Ok);
button->setText (i18n ("&Connect"));
button->setToolTip (i18n ("Establishes connection with specified parameters."));
connect (buttons, &QDialogButtonBox::accepted, this, &QDialog::accept);
connect (buttons, &QDialogButtonBox::rejected, this, &QDialog::reject);
layout->addWidget (l1, 0, 0);
layout->addWidget (l2, 1, 0);
layout->addWidget (ed1, 0, 1);
layout->addWidget (ed2, 1, 1);
//update button text
setButtonText (KDialog::Ok, i18n ("&Connect"));
setButtonToolTip (KDialog::Ok, i18n ("Establishes connection with specified parameters."));
layout->addWidget (buttons, 2, 0, 1, 2);
//humm, this one seems to be causing some X Error 42 BadMatch...
//I have no idea why does it happen; however, everything seems
......
......@@ -36,7 +36,7 @@ dlgTranscript::dlgTranscript (QWidget *parent) :
//initial dialog size
setWindowTitle (i18n ("Session Transcript"));
setFaceType( KPageDialog::Tabbed );
setButtons (KDialog::Ok | KDialog::Cancel | KDialog::Apply);
setStandardButtons (QDialogButtonBox::Ok | QDialogButtonBox::Cancel | QDialogButtonBox::Apply);
//create main dialog's widget
QFrame *page = new QFrame (this);
......
......@@ -1106,9 +1106,7 @@ void KMuddy::showAndHandleConnectDialog ()
{
//so first we have to create the dialog...
cdlg = new dlgConnect (this);
//then we connect() all its signals - this handles everything that the dialog offers...
connect (cdlg, SIGNAL (okClicked()), this, SLOT (doConnect()));
connect (cdlg, SIGNAL (accepted()), this, SLOT (doConnect()));
//dialog is ready - show it!
cdlg->exec ();
......@@ -1123,9 +1121,7 @@ void KMuddy::showAndHandleQuickConnectDialog ()
{
//so first we have to create the dialog...
if (!qdlg) qdlg = new dlgQuickConnect (this);
//then we connect() all its signals - this handles everything that the dialog offers...
connect (qdlg, SIGNAL (okClicked()), this, SLOT (doQuickConnect()));
connect (qdlg, SIGNAL (accepted()), this, SLOT (doQuickConnect()));
//dialog is ready - show it!
qdlg->exec ();
......
......@@ -39,13 +39,13 @@ cDialogList *cDialogList::self ()
return _self;
}
KDialog *cDialogList::getDialog (const QString &name) {
QDialog *cDialogList::getDialog (const QString &name) {
if (dialogs.count (name))
return dialogs[name];
return 0;
}
void cDialogList::addDialog (const QString &name, KDialog *dlg) {
void cDialogList::addDialog (const QString &name, QDialog *dlg) {
dialogs[name] = dlg;
}
......
......@@ -28,7 +28,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kmuddy_export.h>
class KDialog;
class QDialog;
using namespace std;
......@@ -41,13 +41,13 @@ class KMUDDY_EXPORT cDialogList : public cActionBase {
public:
static cDialogList *self ();
~cDialogList();
KDialog *getDialog (const QString &name);
void addDialog (const QString &name, KDialog *dlg);
QDialog *getDialog (const QString &name);
void addDialog (const QString &name, QDialog *dlg);
void removeDialog (const QString &name);
private:
cDialogList();
static cDialogList *_self;
map<QString, KDialog *> dialogs;
map<QString, QDialog *> dialogs;
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment