From: Michael Andreen Date: Sat, 8 Sep 2001 22:27:47 +0000 (+0000) Subject: Changed lots of classnames from Bc to BS X-Git-Tag: HBS_0_1_0~66 X-Git-Url: https://ruin.nu/git/?p=hbs.git;a=commitdiff_plain;h=1bb3da557a983d00ec3ff37ff94152e6f109ee4a Changed lots of classnames from Bc to BS --- diff --git a/bs/battlesum.cpp b/bs/battlesum.cpp index 307392d..bcb1f8f 100644 --- a/bs/battlesum.cpp +++ b/bs/battlesum.cpp @@ -1,19 +1,53 @@ -#include "bcmainview.h" +#include "battlesum.h" /* - * Constructs a BcMainView which is a child of 'parent', with the + * Constructs a BattleSum which is a child of 'parent', with the * name 'name' and widget flags set to 'f' */ -BcMainView::BcMainView( QWidget* parent, const char* name, WFlags fl ) - : BcViewBase( parent, name, fl ) +BattleSum::BattleSum( QWidget* parent, const char* name, WFlags fl ) + : BattleSumBase( parent, name, fl ) { } /* * Destroys the object and frees any allocated resources */ -BcMainView::~BcMainView() +BattleSum::~BattleSum() { // no need to delete child widgets, Qt does it all for us } +/* + * public slot + */ +void BattleSum::slotSetMaxTick( int i ) +{ + qWarning( "BattleSum::slotSetMaxTick( int i ) not yet implemented!" ); +} + +/* + * public slot + */ +void BattleSum::slotSetMinTick( int i ) +{ + qWarning( "BattleSum::slotSetMinTick( int i ) not yet implemented!" ); +} + + +/* + * protected slot + */ +void BattleSum::init() +{ + qWarning( "BattleSum::init() not yet implemented!" ); +} + +/* + * protected slot + */ +void BattleSum::destroy() +{ + qWarning( "BattleSum::destroy() not yet implemented!" ); +} + + diff --git a/bs/battlesum.h b/bs/battlesum.h index 8ce8243..c1e35ca 100644 --- a/bs/battlesum.h +++ b/bs/battlesum.h @@ -1,15 +1,23 @@ -#ifndef BCMAINVIEW_H -#define BCMAINVIEW_H -#include "ui/bcviewbase.h" +#ifndef BATTLESUM_H +#define BATTLESUM_H +#include "ui/battlesumbase.h" -class BcMainView : public BcViewBase +class BattleSum : public BattleSumBase { Q_OBJECT public: - BcMainView( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); - ~BcMainView(); + BattleSum( QWidget* parent = 0, const char* name = 0, WFlags fl = 0 ); + ~BattleSum(); + +public slots: + void slotSetMaxTick( int i ); + void slotSetMinTick( int i ); + +protected slots: + void init(); + void destroy(); }; -#endif // BCMAINVIEW_H +#endif // BATTLESUM_H diff --git a/bs/bs.cpp b/bs/bs.cpp index 1422dcd..42dc30a 100644 --- a/bs/bs.cpp +++ b/bs/bs.cpp @@ -18,12 +18,12 @@ #include "../config.h" #include -#include "bc.h" +#include "bs.h" #include "filesave.xpm" #include "fileopen.xpm" #include "filenew.xpm" -BcApp::BcApp() +BSApp::BSApp() { setCaption(tr("Bc " VERSION)); @@ -41,12 +41,12 @@ BcApp::BcApp() viewStatusBar->setOn(true); } -BcApp::~BcApp() +BSApp::~BSApp() { } /** initializes all QActions of the application */ -void BcApp::initActions(){ +void BSApp::initActions(){ QPixmap openIcon, saveIcon, newIcon; newIcon = QPixmap(filenew); @@ -121,7 +121,7 @@ void BcApp::initActions(){ } -void BcApp::initMenuBar() +void BSApp::initMenuBar() { /////////////////////////////////////////////////////////////////// // MENUBAR @@ -171,7 +171,7 @@ void BcApp::initMenuBar() } -void BcApp::initToolBar() +void BSApp::initToolBar() { /////////////////////////////////////////////////////////////////// // TOOLBAR @@ -184,27 +184,27 @@ void BcApp::initToolBar() } -void BcApp::initStatusBar() +void BSApp::initStatusBar() { /////////////////////////////////////////////////////////////////// //STATUSBAR statusBar()->message(tr("Ready."), 2000); } -void BcApp::initDoc() +void BSApp::initDoc() { - doc=new BcDoc(); + doc=new BSDoc(); } -void BcApp::initView() +void BSApp::initView() { //////////////////////////////////////////////////////////////////// // set the main widget here - view=new BcView(this, doc); + view=new BSView(this, doc); setCentralWidget(view); } -bool BcApp::queryExit() +bool BSApp::queryExit() { int exit=QMessageBox::information(this, tr("Quit..."), tr("Do your really want to quit?"), @@ -227,14 +227,14 @@ bool BcApp::queryExit() ///////////////////////////////////////////////////////////////////// -void BcApp::slotFileNew() +void BSApp::slotFileNew() { statusBar()->message(tr("Creating new file...")); doc->newDoc(); statusBar()->message(tr("Ready.")); } -void BcApp::slotFileOpen() +void BSApp::slotFileOpen() { statusBar()->message(tr("Opening file...")); @@ -253,14 +253,14 @@ void BcApp::slotFileOpen() } -void BcApp::slotFileSave() +void BSApp::slotFileSave() { statusBar()->message(tr("Saving file...")); doc->save(); statusBar()->message(tr("Ready.")); } -void BcApp::slotFileSaveAs() +void BSApp::slotFileSaveAs() { statusBar()->message(tr("Saving file under new filename...")); QString fn = QFileDialog::getSaveFileName(0, 0, this); @@ -276,14 +276,14 @@ void BcApp::slotFileSaveAs() statusBar()->message(tr("Ready.")); } -void BcApp::slotFileClose() +void BSApp::slotFileClose() { statusBar()->message(tr("Closing file...")); statusBar()->message(tr("Ready.")); } -void BcApp::slotFilePrint() +void BSApp::slotFilePrint() { statusBar()->message(tr("Printing...")); QPrinter printer; @@ -301,7 +301,7 @@ void BcApp::slotFilePrint() statusBar()->message(tr("Ready.")); } -void BcApp::slotFileQuit() +void BSApp::slotFileQuit() { statusBar()->message(tr("Exiting application...")); /////////////////////////////////////////////////////////////////// @@ -325,21 +325,21 @@ void BcApp::slotFileQuit() statusBar()->message(tr("Ready.")); } -void BcApp::slotEditCut() +void BSApp::slotEditCut() { statusBar()->message(tr("Cutting selection...")); statusBar()->message(tr("Ready.")); } -void BcApp::slotEditCopy() +void BSApp::slotEditCopy() { statusBar()->message(tr("Copying selection to clipboard...")); statusBar()->message(tr("Ready.")); } -void BcApp::slotEditPaste() +void BSApp::slotEditPaste() { statusBar()->message(tr("Inserting clipboard contents...")); @@ -347,7 +347,7 @@ void BcApp::slotEditPaste() } -void BcApp::slotViewToolBar(bool toggle) +void BSApp::slotViewToolBar(bool toggle) { statusBar()->message(tr("Toggle toolbar...")); /////////////////////////////////////////////////////////////////// @@ -365,7 +365,7 @@ void BcApp::slotViewToolBar(bool toggle) statusBar()->message(tr("Ready.")); } -void BcApp::slotViewStatusBar(bool toggle) +void BSApp::slotViewStatusBar(bool toggle) { statusBar()->message(tr("Toggle statusbar...")); /////////////////////////////////////////////////////////////////// @@ -383,7 +383,7 @@ void BcApp::slotViewStatusBar(bool toggle) statusBar()->message(tr("Ready.")); } -void BcApp::slotHelpAbout() +void BSApp::slotHelpAbout() { QMessageBox::about(this,tr("About..."), tr("Bc\nVersion " VERSION "\n(c) 2001 by Michael Andreen") ); diff --git a/bs/bs.h b/bs/bs.h index f77c74b..efdd22a 100644 --- a/bs/bs.h +++ b/bs/bs.h @@ -36,8 +36,8 @@ #include // application specific includes -#include "bcview.h" -#include "bcdoc.h" +#include "bsview.h" +#include "bsdoc.h" /** * This Class is the base class for your application. It sets up the main @@ -45,15 +45,15 @@ * and statusbar. For the main view, an instance of class BcView is * created which creates your view. */ -class BcApp : public QMainWindow +class BSApp : public QMainWindow { Q_OBJECT public: /** construtor */ - BcApp(); + BSApp(); /** destructor */ - ~BcApp(); + ~BSApp(); /** initializes all QActions of the application */ void initActions(); /** initMenuBar creates the menu_bar and inserts the menuitems */ @@ -110,11 +110,11 @@ class BcApp : public QMainWindow * you can create your view according to your application's needs by * changing the view class. */ - BcView* view; + BSView* view; /** doc represents your actual document and is created only once. It keeps * information such as filename and does the serialization of your files. */ - BcDoc *doc; + BSDoc *doc; /** file_menu contains all items of the menubar entry "File" */ QPopupMenu *fileMenu; diff --git a/bs/bsdoc.cpp b/bs/bsdoc.cpp index 57811c7..3d32cad 100644 --- a/bs/bsdoc.cpp +++ b/bs/bsdoc.cpp @@ -15,38 +15,38 @@ * * ***************************************************************************/ -#include "bcdoc.h" +#include "bsdoc.h" -BcDoc::BcDoc() +BSDoc::BSDoc() { modified = false; } -BcDoc::~BcDoc() +BSDoc::~BSDoc() { } -void BcDoc::newDoc() +void BSDoc::newDoc() { } -bool BcDoc::save() +bool BSDoc::save() { return true; } -bool BcDoc::saveAs(const QString &filename) +bool BSDoc::saveAs(const QString &filename) { return true; } -bool BcDoc::load(const QString &filename) +bool BSDoc::load(const QString &filename) { emit documentChanged(); return true; } -bool BcDoc::isModified() const +bool BSDoc::isModified() const { return modified; } diff --git a/bs/bsdoc.h b/bs/bsdoc.h index 6ff9216..0c02c6f 100644 --- a/bs/bsdoc.h +++ b/bs/bsdoc.h @@ -26,13 +26,13 @@ * the Document Class */ -class BcDoc : public QObject +class BSDoc : public QObject { Q_OBJECT public: - BcDoc(); - ~BcDoc(); + BSDoc(); + ~BSDoc(); void newDoc(); bool save(); bool saveAs(const QString &filename); diff --git a/bs/bsview.cpp b/bs/bsview.cpp index 7ad7e19..042adf7 100644 --- a/bs/bsview.cpp +++ b/bs/bsview.cpp @@ -15,9 +15,9 @@ * * ***************************************************************************/ -#include "bcview.h" +#include "bsview.h" -#include "bcmainview.h" +#include "battlesum.h" #include "scanview.h" #include "ui/infoview.h" #include "tickview.h" @@ -26,7 +26,7 @@ #include #include -BcView::BcView(QWidget *parent, BcDoc *doc) : QSplitter(parent) +BSView::BSView(QWidget *parent, BSDoc *doc) : QSplitter(parent) { /** connect doc with the view*/ connect(doc, SIGNAL(documentChanged()), this, SLOT(slotDocumentChanged())); @@ -50,31 +50,31 @@ BcView::BcView(QWidget *parent, BcDoc *doc) : QSplitter(parent) m_ScanView = new ScanView(m_RightSplit); //the widget stack - m_BcMainView = new BcMainView(); - m_FleetViews->addWidget(m_BcMainView, 0); + m_BattleSum = new BattleSum(); + m_FleetViews->addWidget(m_BattleSum, 0); //m_FleetViews->raiseWidget(0); connect(m_NumberView, SIGNAL(selectionChanged(QListViewItem *)), SLOT(slotFleetSelection(QListViewItem *))); } -BcView::~BcView() +BSView::~BSView() { } -void BcView::addBattle(QString name) +void BSView::addBattle(QString name) { QListViewItem *battle = new QListViewItem(m_NumberView, name); (void) new QListViewItem(battle, "Defenders"); (void) new QListViewItem(battle, "Attackers"); } -void BcView::slotDocumentChanged() +void BSView::slotDocumentChanged() { //TODO update the view } /** No descriptions */ -void BcView::slotFleetSelection(QListViewItem *lvi){ +void BSView::slotFleetSelection(QListViewItem *lvi){ if (lvi->parent() == '\0') { m_FleetViews->raiseWidget(0); diff --git a/bs/bsview.h b/bs/bsview.h index 89c528c..c90b210 100644 --- a/bs/bsview.h +++ b/bs/bsview.h @@ -22,9 +22,9 @@ #include // application specific includes -#include "bcdoc.h" +#include "bsdoc.h" -class BcMainView; +class BattleSum; class ScanView; class InfoView; class TickView; @@ -39,12 +39,12 @@ class QListViewItem; * This class provides an incomplete base for your application view. */ -class BcView : public QSplitter +class BSView : public QSplitter { Q_OBJECT public: - BcView(QWidget *parent=0, BcDoc* doc=0); - ~BcView(); + BSView(QWidget *parent=0, BSDoc* doc=0); + ~BSView(); void addBattle(QString name); @@ -52,14 +52,14 @@ class BcView : public QSplitter void slotDocumentChanged(); protected: - BcMainView *m_BcMainView; - QListView *m_NumberView; - QSplitter *m_RightSplit; - QSplitter *m_LeftSplit; - ScanView *m_ScanView; - InfoView *m_InfoView; - TickView *m_TickView; - QWidgetStack *m_FleetViews; + BattleSum *m_BattleSum; + QListView *m_NumberView; + QSplitter *m_RightSplit; + QSplitter *m_LeftSplit; + ScanView *m_ScanView; + InfoView *m_InfoView; + TickView *m_TickView; + QWidgetStack *m_FleetViews; public slots: // Public slots /** No descriptions */ diff --git a/bs/main.cpp b/bs/main.cpp index ea8ef3f..e919592 100644 --- a/bs/main.cpp +++ b/bs/main.cpp @@ -20,7 +20,7 @@ #include #include "../config.h" -#include "bc.h" +#include "bs.h" int main(int argc, char *argv[]) { @@ -32,13 +32,13 @@ int main(int argc, char *argv[]) /* uncomment the following line, if you want a Windows 95 look*/ // a.setStyle(WindowsStyle); //a.setStyle(s); - BcApp *bc=new BcApp(); - a.setMainWidget(bc); + BSApp *bs=new BSApp(); + a.setMainWidget(bs); - bc->setCaption("HÃ¥rvalens BattleCalc" VERSION); + bs->setCaption("Harv's BattleSystem" VERSION); //eonsl->showMaximized(); - bc->resize(800,600); - bc->show(); + bs->resize(800,600); + bs->show(); return a.exec(); } diff --git a/bs/ui/battlesumbase.ui b/bs/ui/battlesumbase.ui index 7dbeece..a0935de 100644 --- a/bs/ui/battlesumbase.ui +++ b/bs/ui/battlesumbase.ui @@ -1,11 +1,8 @@ -BcViewBase -qheader.h -bcviewbase.ui.h - +BattleSumBase - BcViewBase + BattleSumBase @@ -67,193 +64,121 @@ Total - - - L/S - - - Total - - - L/S - - - Interceptors - - - Pheonix - - - Warfrigate - - - Devistator - - - Starcruiser - - - Dreadnaught - - - Spider - - - Ghost - - - Tarantula - - - Spectre - - - Astropod - - - Meson - - - Hyperon - - - Neutron - - - Photon - - - ION - - - Resource - - - Metal - - - Crystal - - - Eonium - - - fleetTable @@ -281,9 +206,15 @@ - init() - destroy() - slotSetMaxTick( int i ) - slotSetMinTick( int i ) + + qheader.h + + + init() + destroy() + slotSetMaxTick( int i ) + slotSetMinTick( int i ) + + diff --git a/hbs.pro b/hbs.pro index 20921e2..565dabc 100644 --- a/hbs.pro +++ b/hbs.pro @@ -1,24 +1,11 @@ -TEMPLATE = app -CONFIG = qt warn_on debug thread -HEADERS = bs/bs.h \ - bs/bsdoc.h \ - bs/bsview.h \ - bs/bsmainview.h \ - config.h \ - bs/scanview.h \ - bs/tickview.h -SOURCES = bs/bs.cpp \ - bs/bsdoc.cpp \ - bs/bsview.cpp \ - bs/main.cpp \ - bs/bsmainview.cpp \ - bs/scanview.cpp \ - bs/tickview.cpp +SOURCES += bs/bs.cpp bs/bsdoc.cpp bs/bsview.cpp bs/main.cpp bs/battlesum.cpp bs/scanview.cpp bs/tickview.cpp +HEADERS += bs/bs.h bs/bsdoc.h bs/bsview.h bs/battlesum.h config.h bs/scanview.h bs/tickview.h TARGET = bs/bs -INTERFACES = bs/ui/bsviewbase.ui bs/ui/scanviewbase.ui bs/ui/infoview.ui bs/ui/tickviewbase.ui -DBFILE = bs.db IMAGEFILE = images.cpp PROJECTNAME = BS +FORMS = bs/ui/battlesumbase.ui bs/ui/scanviewbase.ui bs/ui/infoview.ui bs/ui/tickviewbase.ui bs/ui/bsappbase.ui +TEMPLATE =app +CONFIG += qt warn_on debug thread +DBFILE = hbs.db LANGUAGE = C++ -{SOURCES+=images.cpp}