Commit 29dbd571 authored by Bernd Gehrmann's avatar Bernd Gehrmann
Browse files

* Removed Qt1-specific layout management stuff

* More latin1 conversions removed
* Command line option --resolve filename
  (Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>)

svn path=/trunk/kdesdk/cervisia/; revision=163627
parent 5fd1b0b1
2002-06-28 Bernd Gehrmann <bernd@mail.berlios.de>
* Removed Qt1-specific layout management stuff
* More latin1 conversions removed
* Command line option --resolve filename
(Stanislav Visnovsky <visnovsky@nenya.ms.mff.cuni.cz>)
2002-06-27 Bernd Gehrmann <bernd@mail.berlios.de>
* Mark files with option -kb with a binary icon
......
......@@ -44,7 +44,6 @@ AnnotateDialog::AnnotateDialog(QWidget *parent, const char *name)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......
......@@ -61,7 +61,6 @@ ChangeLogDialog::ChangeLogDialog(QWidget *parent, const char *name)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......
......@@ -145,7 +145,6 @@ CheckoutDialog::CheckoutDialog(ActionType action, QWidget *parent, const char *n
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......
......@@ -45,30 +45,24 @@ CommitDialog::CommitDialog(ActionType action, QWidget *parent, const char *name)
(action==Remove)? i18n("Remove the following files from the repository:") :
i18n("Commit the following &files:"),
this );
textlabel->setMinimumSize(textlabel->sizeHint());
layout->addWidget(textlabel, 0);
listbox = new QListBox(this);
textlabel->setBuddy(listbox);
connect( listbox, SIGNAL(selected(int)), this, SLOT(fileSelected(int)));
listbox->adjustSize();
listbox->setMinimumSize(listbox->size());
layout->addWidget(listbox, 5);
if (action == Commit)
{
QLabel *archivelabel = new QLabel(i18n("Older &messages:"), this);
archivelabel->setMinimumSize(archivelabel->sizeHint());
layout->addWidget(archivelabel, 0);
combo = new QComboBox(this);
archivelabel->setBuddy(combo);
combo->setMinimumSize(combo->sizeHint());
connect( combo, SIGNAL(activated(int)), this, SLOT(comboActivated(int)) );
layout->addWidget(combo, 0);
QLabel *messagelabel = new QLabel(i18n("&Log message:"), this);
messagelabel->setMinimumSize(messagelabel->sizeHint());
layout->addWidget(messagelabel, 0);
edit = new QMultiLineEdit(this);
......@@ -82,7 +76,6 @@ CommitDialog::CommitDialog(ActionType action, QWidget *parent, const char *name)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......
......@@ -41,7 +41,7 @@ CvsIgnoreList::CvsIgnoreList(const QDir &dir)
addEntriesFromString(ignorestr);
// TODO?: addEntriesFromFile($CVSROOT/CVSROOT/cvsignore)
addEntriesFromFile(QDir::homeDirPath() + "/.cvsignore");
addEntriesFromString(getenv("CVSIGNORE"));
addEntriesFromString(::getenv("CVSIGNORE"));
addEntriesFromFile(dir.absPath() + "/.cvsignore");
}
......@@ -56,7 +56,7 @@ void CvsIgnoreList::addEntriesFromString(const QString &str)
if ( *it == "!" )
clear();
else
append((*it).latin1());
append((*it).local8Bit());
}
}
......@@ -65,7 +65,7 @@ void CvsIgnoreList::addEntriesFromFile(const QString &name)
{
char buf[512];
// FIXME: Use QFile
FILE *f = fopen(name.latin1(), "r");
FILE *f = fopen(name.local8Bit(), "r");
if (!f)
return;
......@@ -87,7 +87,7 @@ bool CvsIgnoreList::matches(QFileInfo *fi)
QStrListIterator it(*this);
for (; it.current(); ++it)
{
if (fnmatch(it.current(), fi->fileName().latin1(), FNM_PATHNAME) == 0)
if (::fnmatch(it.current(), fi->fileName().local8Bit(), FNM_PATHNAME) == 0)
return true;
}
......
......@@ -58,7 +58,6 @@ CvsProgressDialog::CvsProgressDialog(const QString &text, QWidget *parent)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......
......@@ -76,7 +76,6 @@ DiffDialog::DiffDialog(QWidget *parent, const char *name, bool modal)
syncbox->setChecked(true);
connect( syncbox, SIGNAL(toggled(bool)),
this, SLOT(toggleSynchronize(bool)) );
syncbox->setMinimumSize(syncbox->sizeHint());
itemscombo = new QComboBox(this);
itemscombo->insertItem("");
......@@ -105,7 +104,6 @@ DiffDialog::DiffDialog(QWidget *parent, const char *name, bool modal)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......@@ -483,7 +481,6 @@ bool DiffDialog::parseCvsDiff(const QString &sandbox, const QString &repository,
}
updateNofN();
itemscombo->setMinimumSize(itemscombo->sizeHint());
return true;
}
......
......@@ -106,31 +106,31 @@ HistoryDialog::HistoryDialog(QWidget *parent, const char *name)
commit_box = new QCheckBox(i18n("Show c&ommit events"), this);
commit_box->setChecked(true);
commit_box->setMinimumSize(commit_box->sizeHint());
// commit_box->setMinimumSize(commit_box->sizeHint());
checkout_box = new QCheckBox(i18n("Show ch&eckout events"), this);
checkout_box->setChecked(true);
checkout_box->setMinimumSize(checkout_box->sizeHint());
// checkout_box->setMinimumSize(checkout_box->sizeHint());
tag_box = new QCheckBox(i18n("Show &tag events"), this);
tag_box->setChecked(true);
tag_box->setMinimumSize(tag_box->sizeHint());
// tag_box->setMinimumSize(tag_box->sizeHint());
other_box = new QCheckBox(i18n("Show &other events"), this);
other_box->setChecked(true);
other_box->setMinimumSize(tag_box->sizeHint());
// other_box->setMinimumSize(tag_box->sizeHint());
onlyuser_box = new QCheckBox(i18n("Only &user:"), this);
onlyuser_box->setMinimumSize(onlyuser_box->sizeHint());
// onlyuser_box->setMinimumSize(onlyuser_box->sizeHint());
onlyfilenames_box = new QCheckBox(i18n("Only &filenames matching:"), this);
onlyfilenames_box->setMinimumSize(onlyfilenames_box->sizeHint());
// onlyfilenames_box->setMinimumSize(onlyfilenames_box->sizeHint());
onlydirnames_box = new QCheckBox(i18n("Only &directories matching:"), this);
onlydirnames_box->setMinimumSize(onlydirnames_box->sizeHint());
// onlydirnames_box->setMinimumSize(onlydirnames_box->sizeHint());
user_edit = new KLineEdit(this);
user_edit->setEnabled(false);
user_edit->setMinimumSize(user_edit->sizeHint());
// user_edit->setMinimumSize(user_edit->sizeHint());
filename_edit = new KLineEdit(this);
filename_edit->setEnabled(false);
filename_edit->setMinimumSize(filename_edit->sizeHint());
// filename_edit->setMinimumSize(filename_edit->sizeHint());
dirname_edit = new KLineEdit(this);
dirname_edit->setEnabled(false);
dirname_edit->setMinimumSize(dirname_edit->sizeHint());
// dirname_edit->setMinimumSize(dirname_edit->sizeHint());
connect( onlyuser_box, SIGNAL(toggled(bool)),
this, SLOT(toggled(bool)) );
......@@ -179,7 +179,7 @@ HistoryDialog::HistoryDialog(QWidget *parent, const char *name)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addSpacing(8);
layout->addWidget(frame, 0);
layout->addSpacing(8);
......@@ -191,7 +191,7 @@ HistoryDialog::HistoryDialog(QWidget *parent, const char *name)
QPushButton *closebutton = buttonbox->addButton(i18n("&Close"));
closebutton->setAutoDefault(false);
buttonbox->layout();
buttonbox->setFixedHeight(buttonbox->height());
// buttonbox->setFixedHeight(buttonbox->height());
layout->addWidget(buttonbox, 0);
connect( helpbutton, SIGNAL(clicked()), SLOT(helpClicked()) );
......
......@@ -59,9 +59,9 @@ LogDialog::LogDialog(QWidget *parent, const char *name)
QTab *tab2 = new QTab(i18n("&List"));
stack->addWidget(list, tabbar->addTab(tab2));
tabbar->adjustSize();
tabbar->setMinimumWidth(tabbar->width());
tabbar->setFixedHeight(tabbar->height());
// tabbar->adjustSize();
// tabbar->setMinimumWidth(tabbar->width());
// tabbar->setFixedHeight(tabbar->height());
layout->addWidget(tabbar, 0);
layout->addWidget(stack, 3);
......@@ -79,7 +79,7 @@ LogDialog::LogDialog(QWidget *parent, const char *name)
{
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
// frame->setMinimumHeight(frame->sizeHint().height());
layout->addSpacing(8);
layout->addWidget(frame);
layout->addSpacing(8);
......@@ -158,6 +158,7 @@ LogDialog::LogDialog(QWidget *parent, const char *name)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
layout->addSpacing(8);
layout->addWidget(frame, 0);
layout->addSpacing(8);
......
......@@ -15,10 +15,13 @@
#include <kaboutdata.h>
#include <kapplication.h>
#include <kcmdlineargs.h>
#include <kconfig.h>
#include <klocale.h>
#include "misc.h"
#include "cervisiashell.h"
#include "cervisiapart.h"
#include "resolvedlg.h"
#include "version.h"
......@@ -26,6 +29,7 @@ int main(int argc, char **argv)
{
static KCmdLineOptions options[] = {
{ "+[directory]", I18N_NOOP("The sandbox to be loaded"), 0 },
{ "resolve <file>", I18N_NOOP("Show resolve dialog for the given file"), 0 },
{ 0, 0, 0 }
};
KAboutData about("cervisia", I18N_NOOP("Cervisia"),
......@@ -36,19 +40,35 @@ int main(int argc, char **argv)
KApplication *app = new KApplication();
if ( app->isRestored() )
{
RESTORE(CervisiaShell);
QString resolvefile = KCmdLineArgs::parsedArgs()->getOption("resolve");
if (!resolvefile.isEmpty()) {
KConfig *config = CervisiaFactory::instance()->config();
config->setGroup("Resolve dialog");
ResolveDialog::loadOptions(config);
ResolveDialog *l = new ResolveDialog();
app->setMainWidget(l);
if (l->parseFile(resolvefile))
l->show();
else
delete l;
int res = app->exec();
config->setGroup("Resolve dialog");
ResolveDialog::saveOptions(config);
delete CervisiaFactory::instance();
return res;
}
else
{
CervisiaShell *t = new CervisiaShell();
if ( app->isRestored() ) {
RESTORE(CervisiaShell);
} else {
QString dirname = QString(KCmdLineArgs::parsedArgs()->count()?
KCmdLineArgs::parsedArgs()->arg(0) : "");
CervisiaShell *t = new CervisiaShell();
t->resize(t->sizeHint().width(),
KApplication::desktop()->height()*8/10);
KApplication::desktop()->height()*8/10);
t->restorePseudo(dirname);
t->setIcon(app->icon());
app->setMainWidget(t);
......
......@@ -128,7 +128,7 @@ void MergeDialog::buttonClicked(bool branch)
QString searchedtype = QString::fromLatin1(branch? "branch" : "revision");
QStrList tags(true);
QStringList tags;
QString str;
while (l.getOneLine(&str))
{
......@@ -144,8 +144,8 @@ void MergeDialog::buttonClicked(bool branch)
QString tag = str.mid(1, pos1-1);
QString type = str.mid(pos2+1, pos3-pos2-1);
if (type == searchedtype && !tags.contains(tag.latin1()))
tags.inSort(tag.latin1());
if (type == searchedtype && !tags.contains(tag))
tags.append(tag);
}
if (branch)
......@@ -155,8 +155,12 @@ void MergeDialog::buttonClicked(bool branch)
tag1_combo->clear();
tag2_combo->clear();
}
QStrListIterator it(tags);
for (; it.current(); ++it)
tags.sort();
QStringList::ConstIterator it;
for (it = tags.begin(); it != tags.end(); ++it)
if (branch)
branch_combo->insertItem(*it);
else
......
......@@ -162,7 +162,6 @@ RepositoryDialog::RepositoryDialog(QWidget *parent, const char *name)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......@@ -195,9 +194,9 @@ void RepositoryDialog::done(int r)
{
// Make list of repositories
QListViewItem *item;
QStrList list;
QStringList list;
for (item = repolist->firstChild(); item; item = item->nextSibling())
list.append(item->text(0).latin1());
list.append(item->text(0));
KConfig *config = CervisiaPart::config();
config->setGroup("Repositories");
......
......@@ -32,7 +32,7 @@
ResolveDialog::Options *ResolveDialog::options = 0;
ResolveDialog::ResolveDialog( QWidget *parent, const char *name)
ResolveDialog::ResolveDialog(QWidget *parent, const char *name)
: QDialog(parent, name, false,
WStyle_Customize|WStyle_NormalBorder|WStyle_Title|WStyle_MinMax)
{
......@@ -43,14 +43,14 @@ ResolveDialog::ResolveDialog( QWidget *parent, const char *name)
QBoxLayout *layout = new QVBoxLayout(this, 10);
QGridLayout *pairlayout = new QGridLayout(2, 2, 10);
pairlayout->setRowStretch(0, 0);
pairlayout->setRowStretch(1, 1);
layout->addLayout(pairlayout, 10);
QLabel *revlabel1 = new QLabel(i18n("Your Version (A):"), this);
revlabel1->setFixedHeight(revlabel1->sizeHint().height());
pairlayout->addWidget(revlabel1, 0, 0);
QLabel *revlabel2 = new QLabel(i18n("Other Version (B):"), this);
revlabel2->setFixedHeight(revlabel2->sizeHint().height());
pairlayout->addWidget(revlabel2, 0, 1);
diff1 = new DiffView(true, false, this);
......@@ -63,7 +63,6 @@ ResolveDialog::ResolveDialog( QWidget *parent, const char *name)
diff2->setPartner(diff1);
QLabel *mergelabel = new QLabel(i18n("Merged Version:"), this);
mergelabel->setFixedHeight(mergelabel->sizeHint().height());
layout->addSpacing(5);
layout->addWidget(mergelabel);
......@@ -109,7 +108,6 @@ ResolveDialog::ResolveDialog( QWidget *parent, const char *name)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......@@ -131,7 +129,6 @@ ResolveDialog::ResolveDialog( QWidget *parent, const char *name)
setMinimumSize(fm.width("0123456789")*12,
fm.lineSpacing()*40);
layout->activate();
if (options)
resize(options->size);
......@@ -556,7 +553,6 @@ ResolveEditorDialog::ResolveEditorDialog(QWidget *parent, const char *name)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......
......@@ -80,7 +80,6 @@ TagDialog::TagDialog(ActionType action, const QString &sbox, const QString &repo
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......@@ -145,7 +144,7 @@ void TagDialog::tagButtonClicked()
if (!l.execCommand(sandbox, repository, cmdline, ""))
return;
QStrList tags(true);
QStringList tags;
QString str;
while (l.getOneLine(&str))
{
......@@ -161,13 +160,14 @@ void TagDialog::tagButtonClicked()
QString tag = str.mid(1, pos1-1);
QString type = str.mid(pos2+1, pos3-pos2-1);
if (type == QString::fromLatin1("revision") && !tags.contains(tag.latin1()))
tags.inSort(tag.latin1());
if (type == QString::fromLatin1("revision") && !tags.contains(tag))
tags.append(tag);
}
tag_combo->clear();
QStrListIterator it(tags);
for (; it.current(); ++it)
tags.sort();
QStringList::ConstIterator it;
for (it = tags.begin(); it != tags.end(); ++it)
tag_combo->insertItem(*it);
}
......
......@@ -128,7 +128,7 @@ void UpdateDialog::buttonClicked(bool branch)
QComboBox *combo = branch? branch_combo : tag_combo;
QString searchedtype = QString::fromLatin1(branch? "branch" : "revision");
QStrList tags(true);
QStringList tags;
QString str;
while (l.getOneLine(&str))
{
......@@ -144,13 +144,15 @@ void UpdateDialog::buttonClicked(bool branch)
QString tag = str.mid(1, pos1-1);
QString type = str.mid(pos2+1, pos3-pos2-1);
if (type == searchedtype && !tags.contains(tag.latin1()))
tags.inSort(tag.latin1());
if (type == searchedtype && !tags.contains(tag))
tags.append(tag);
}
combo->clear();
QStrListIterator it(tags);
for (; it.current(); ++it)
tags.sort();
QStringList::ConstIterator it;
for (it = tags.begin(); it != tags.end(); ++it)
combo->insertItem(*it);
}
......
......@@ -37,17 +37,14 @@ WatchDialog::WatchDialog(ActionType action, QWidget *parent, const char *name)
QLabel *textlabel = new QLabel
( (action==Add)? i18n("Add watches for the following events:")
: i18n("Remove watches for the following events:"), this );
textlabel->setMinimumSize(textlabel->sizeHint());
layout->addWidget(textlabel, 0);
all_button = new QRadioButton(i18n("&All"), this);
all_button->setFocus();
all_button->setChecked(true);
all_button->setMinimumSize(all_button->sizeHint());
layout->addWidget(all_button);
only_button = new QRadioButton(i18n("&Only:"), this);
only_button->setMinimumSize(only_button->sizeHint());
layout->addWidget(only_button);
QGridLayout *eventslayout = new QGridLayout(3, 2);
......@@ -58,17 +55,14 @@ WatchDialog::WatchDialog(ActionType action, QWidget *parent, const char *name)
commitbox = new QCheckBox(i18n("&Commits"), this);
commitbox->setEnabled(false);
commitbox->setMinimumSize(commitbox->sizeHint());
eventslayout->addWidget(commitbox, 0, 1, AlignLeft);
editbox = new QCheckBox(i18n("&Edits"), this);
editbox->setEnabled(false);
editbox->setMinimumSize(editbox->sizeHint());
eventslayout->addWidget(editbox, 1, 1, AlignLeft);
uneditbox = new QCheckBox(i18n("&Unedits"), this);
uneditbox->setEnabled(false);
uneditbox->setMinimumSize(uneditbox->sizeHint());
eventslayout->addWidget(uneditbox, 2, 1, AlignLeft);
group = new QButtonGroup();
......@@ -83,7 +77,6 @@ WatchDialog::WatchDialog(ActionType action, QWidget *parent, const char *name)
QFrame *frame = new QFrame(this);
frame->setFrameStyle(QFrame::HLine | QFrame::Sunken);
frame->setMinimumHeight(frame->sizeHint().height());
layout->addWidget(frame, 0);
KButtonBox *buttonbox = new KButtonBox(this);
......
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