Changeset 53 in projects


Ignore:
Timestamp:
Dec 24, 2009, 4:17:54 AM (10 years ago)
Author:
sven
Message:

Punch Card Editor, ongoing development

  • Extended new Deck interface, expanding the undo framework
  • Implemented editor changes via undo framework
  • revised the menu and toolbar actions and structure (now dynamic construction at deck load time), implemented undo viewer
  • Started implementation of device driver framework in menu
  • Embedded the Qextserialport library (http://qextserialport.sourceforge.net/)
  • Started the Documation M200 Client device driver (well, just created the directory structure and qmake project file infrastructure)
  • At the current state, the complete project compiles :-)

Statistics: About 3500 Lines of code (without libqextserialport)

-- sven @ workstation

Location:
punch-card/punch-card-editor/src
Files:
95 added
2 deleted
15 edited

Legend:

Unmodified
Added
Removed
  • punch-card/punch-card-editor/src/Makefile

    r52 r53  
    11#############################################################################
    22# Makefile for building: ../bin/src
    3 # Generated by qmake (2.01a) (Qt 4.5.1) on: Mi. Dez 16 00:32:17 2009
     3# Generated by qmake (2.01a) (Qt 4.5.1) on: Do. Dez 24 03:31:04 2009
    44# Project:  src.pro
    55# Template: app
     
    1111CC            = gcc
    1212CXX           = g++
    13 DEFINES       = -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
     13DEFINES       = -D_TTY_POSIX_ -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED
    1414CFLAGS        = -pipe -g -w -D_REENTRANT $(DEFINES)
    1515CXXFLAGS      = -pipe -g -w -D_REENTRANT $(DEFINES)
    16 INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I../bin -I.
     16INCPATH       = -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I../bin/moc -I.
    1717LINK          = g++
    1818LFLAGS        =
     
    3939####### Output directory
    4040
    41 OBJECTS_DIR   = ../bin/
     41OBJECTS_DIR   = ../bin/obj/
    4242
    4343####### Files
    4444
    45 SOURCES       = app/mainwindow.cc \
     45SOURCES       = app/main.cc \
     46                app/mainwindow.cc \
    4647                app/mainwindow.ui.cc \
    4748                deckviewer/cardeditor.cc \
     
    5657                text/editor.cc \
    5758                text/editordock.cc \
    58                 driver/driver.cc ../bin/moc_mainwindow.cpp \
    59                 ../bin/moc_cardeditor.cpp \
    60                 ../bin/moc_navigatordock.cpp \
    61                 ../bin/moc_navigatormodel.cpp \
    62                 ../bin/moc_navigatorview.cpp \
    63                 ../bin/moc_deck.cpp \
    64                 ../bin/moc_widget.cpp \
    65                 ../bin/moc_editor.cpp \
    66                 ../bin/moc_editordock.cpp
    67 OBJECTS       = ../bin/mainwindow.o \
    68                 ../bin/mainwindow.ui.o \
    69                 ../bin/cardeditor.o \
    70                 ../bin/navigatordock.o \
    71                 ../bin/navigatormodel.o \
    72                 ../bin/navigatorview.o \
    73                 ../bin/card.o \
    74                 ../bin/deck.o \
    75                 ../bin/format.o \
    76                 ../bin/widget.o \
    77                 ../bin/codec.o \
    78                 ../bin/editor.o \
    79                 ../bin/editordock.o \
    80                 ../bin/driver.o \
    81                 ../bin/moc_mainwindow.o \
    82                 ../bin/moc_cardeditor.o \
    83                 ../bin/moc_navigatordock.o \
    84                 ../bin/moc_navigatormodel.o \
    85                 ../bin/moc_navigatorview.o \
    86                 ../bin/moc_deck.o \
    87                 ../bin/moc_widget.o \
    88                 ../bin/moc_editor.o \
    89                 ../bin/moc_editordock.o
     59                driver/driver.cc \
     60                libs/qextserialport/qextserialbase.cpp \
     61                libs/qextserialport/qextserialport.cpp \
     62                libs/qextserialport/posix_qextserialport.cpp \
     63                driver/documation-m200-client/controller.cc ../bin/moc/moc_mainwindow.cpp \
     64                ../bin/moc/moc_cardeditor.cpp \
     65                ../bin/moc/moc_navigatordock.cpp \
     66                ../bin/moc/moc_navigatormodel.cpp \
     67                ../bin/moc/moc_navigatorview.cpp \
     68                ../bin/moc/moc_deck.cpp \
     69                ../bin/moc/moc_widget.cpp \
     70                ../bin/moc/moc_editor.cpp \
     71                ../bin/moc/moc_editordock.cpp \
     72                ../bin/moc/moc_driver.cpp \
     73                ../bin/moc/moc_controller.cpp
     74OBJECTS       = ../bin/obj/main.o \
     75                ../bin/obj/mainwindow.o \
     76                ../bin/obj/mainwindow.ui.o \
     77                ../bin/obj/cardeditor.o \
     78                ../bin/obj/navigatordock.o \
     79                ../bin/obj/navigatormodel.o \
     80                ../bin/obj/navigatorview.o \
     81                ../bin/obj/card.o \
     82                ../bin/obj/deck.o \
     83                ../bin/obj/format.o \
     84                ../bin/obj/widget.o \
     85                ../bin/obj/codec.o \
     86                ../bin/obj/editor.o \
     87                ../bin/obj/editordock.o \
     88                ../bin/obj/driver.o \
     89                ../bin/obj/qextserialbase.o \
     90                ../bin/obj/qextserialport.o \
     91                ../bin/obj/posix_qextserialport.o \
     92                ../bin/obj/controller.o \
     93                ../bin/obj/moc_mainwindow.o \
     94                ../bin/obj/moc_cardeditor.o \
     95                ../bin/obj/moc_navigatordock.o \
     96                ../bin/obj/moc_navigatormodel.o \
     97                ../bin/obj/moc_navigatorview.o \
     98                ../bin/obj/moc_deck.o \
     99                ../bin/obj/moc_widget.o \
     100                ../bin/obj/moc_editor.o \
     101                ../bin/obj/moc_editordock.o \
     102                ../bin/obj/moc_driver.o \
     103                ../bin/obj/moc_controller.o
    90104DIST          = /usr/share/qt4/mkspecs/common/g++.conf \
    91105                /usr/share/qt4/mkspecs/common/unix.conf \
     
    96110                /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
    97111                /usr/share/qt4/mkspecs/features/default_pre.prf \
     112                libs/qextserialport.pri \
     113                driver/documation-m200-client.pri \
    98114                /usr/share/qt4/mkspecs/features/debug.prf \
    99115                /usr/share/qt4/mkspecs/features/default_post.prf \
     
    148164                /usr/share/qt4/mkspecs/features/exclusive_builds.prf \
    149165                /usr/share/qt4/mkspecs/features/default_pre.prf \
     166                libs/qextserialport.pri \
     167                driver/documation-m200-client.pri \
    150168                /usr/share/qt4/mkspecs/features/debug.prf \
    151169                /usr/share/qt4/mkspecs/features/default_post.prf \
     
    170188/usr/share/qt4/mkspecs/features/exclusive_builds.prf:
    171189/usr/share/qt4/mkspecs/features/default_pre.prf:
     190libs/qextserialport.pri:
     191driver/documation-m200-client.pri:
    172192/usr/share/qt4/mkspecs/features/debug.prf:
    173193/usr/share/qt4/mkspecs/features/default_post.prf:
     
    187207
    188208dist:
    189         @$(CHK_DIR_EXISTS) ../bin/src1.0.0 || $(MKDIR) ../bin/src1.0.0
    190         $(COPY_FILE) --parents $(SOURCES) $(DIST) ../bin/src1.0.0/ && $(COPY_FILE) --parents app/mainwindow.h deckviewer/cardeditor.h deckviewer/navigatordock.h deckviewer/navigatormodel.h deckviewer/navigatorview.h qpunchcard/card.h qpunchcard/deck.h qpunchcard/format.h qpunchcard/widget.h text/cardcodes.h text/codec.h text/editor.h text/editordock.h driver/driver.h ../bin/src1.0.0/ && $(COPY_FILE) --parents app/mainwindow.cc app/mainwindow.ui.cc deckviewer/cardeditor.cc deckviewer/navigatordock.cc deckviewer/navigatormodel.cc deckviewer/navigatorview.cc qpunchcard/card.cc qpunchcard/deck.cc qpunchcard/format.cc qpunchcard/widget.cc text/codec.cc text/editor.cc text/editordock.cc driver/driver.cc ../bin/src1.0.0/ && (cd `dirname ../bin/src1.0.0` && $(TAR) src1.0.0.tar src1.0.0 && $(COMPRESS) src1.0.0.tar) && $(MOVE) `dirname ../bin/src1.0.0`/src1.0.0.tar.gz . && $(DEL_FILE) -r ../bin/src1.0.0
     209        @$(CHK_DIR_EXISTS) ../bin/obj/src1.0.0 || $(MKDIR) ../bin/obj/src1.0.0
     210        $(COPY_FILE) --parents $(SOURCES) $(DIST) ../bin/obj/src1.0.0/ && $(COPY_FILE) --parents app/mainwindow.h deckviewer/cardeditor.h deckviewer/navigatordock.h deckviewer/navigatormodel.h deckviewer/navigatorview.h qpunchcard/card.h qpunchcard/deck.h qpunchcard/format.h qpunchcard/widget.h text/cardcodes.h text/codec.h text/editor.h text/editordock.h driver/driver.h libs/qextserialport/qextserialbase.h libs/qextserialport/qextserialport.h libs/qextserialport/posix_qextserialport.h driver/documation-m200-client/controller.h ../../protocols/documation-m200/pc-uc-protocol.h ../bin/obj/src1.0.0/ && $(COPY_FILE) --parents app/main.cc app/mainwindow.cc app/mainwindow.ui.cc deckviewer/cardeditor.cc deckviewer/navigatordock.cc deckviewer/navigatormodel.cc deckviewer/navigatorview.cc qpunchcard/card.cc qpunchcard/deck.cc qpunchcard/format.cc qpunchcard/widget.cc text/codec.cc text/editor.cc text/editordock.cc driver/driver.cc libs/qextserialport/qextserialbase.cpp libs/qextserialport/qextserialport.cpp libs/qextserialport/posix_qextserialport.cpp driver/documation-m200-client/controller.cc ../bin/obj/src1.0.0/ && (cd `dirname ../bin/obj/src1.0.0` && $(TAR) src1.0.0.tar src1.0.0 && $(COMPRESS) src1.0.0.tar) && $(MOVE) `dirname ../bin/obj/src1.0.0`/src1.0.0.tar.gz . && $(DEL_FILE) -r ../bin/obj/src1.0.0
    191211
    192212
     
    207227mocables: compiler_moc_header_make_all compiler_moc_source_make_all
    208228
    209 compiler_moc_header_make_all: ../bin/moc_mainwindow.cpp ../bin/moc_cardeditor.cpp ../bin/moc_navigatordock.cpp ../bin/moc_navigatormodel.cpp ../bin/moc_navigatorview.cpp ../bin/moc_deck.cpp ../bin/moc_widget.cpp ../bin/moc_editor.cpp ../bin/moc_editordock.cpp
     229compiler_moc_header_make_all: ../bin/moc/moc_mainwindow.cpp ../bin/moc/moc_cardeditor.cpp ../bin/moc/moc_navigatordock.cpp ../bin/moc/moc_navigatormodel.cpp ../bin/moc/moc_navigatorview.cpp ../bin/moc/moc_deck.cpp ../bin/moc/moc_widget.cpp ../bin/moc/moc_editor.cpp ../bin/moc/moc_editordock.cpp ../bin/moc/moc_driver.cpp ../bin/moc/moc_controller.cpp
    210230compiler_moc_header_clean:
    211         -$(DEL_FILE) ../bin/moc_mainwindow.cpp ../bin/moc_cardeditor.cpp ../bin/moc_navigatordock.cpp ../bin/moc_navigatormodel.cpp ../bin/moc_navigatorview.cpp ../bin/moc_deck.cpp ../bin/moc_widget.cpp ../bin/moc_editor.cpp ../bin/moc_editordock.cpp
    212 ../bin/moc_mainwindow.cpp: qpunchcard/card.h \
    213                 qpunchcard/deck.h \
    214                 qpunchcard/format.h \
    215                 deckviewer/navigatordock.h \
    216                 deckviewer/navigatormodel.h \
    217                 deckviewer/navigatorview.h \
    218                 app/mainwindow.h \
    219                 deckviewer/cardeditor.h \
    220                 qpunchcard/widget.h \
    221                 text/editordock.h \
    222                 text/codec.h \
    223                 text/editor.h \
     231        -$(DEL_FILE) ../bin/moc/moc_mainwindow.cpp ../bin/moc/moc_cardeditor.cpp ../bin/moc/moc_navigatordock.cpp ../bin/moc/moc_navigatormodel.cpp ../bin/moc/moc_navigatorview.cpp ../bin/moc/moc_deck.cpp ../bin/moc/moc_widget.cpp ../bin/moc/moc_editor.cpp ../bin/moc/moc_editordock.cpp ../bin/moc/moc_driver.cpp ../bin/moc/moc_controller.cpp
     232../bin/moc/moc_mainwindow.cpp: qpunchcard/card.h \
     233                qpunchcard/deck.h \
     234                qpunchcard/format.h \
     235                deckviewer/navigatordock.h \
     236                deckviewer/navigatormodel.h \
     237                deckviewer/navigatorview.h \
     238                app/mainwindow.h \
     239                deckviewer/cardeditor.h \
     240                qpunchcard/widget.h \
     241                text/editordock.h \
     242                text/codec.h \
     243                text/editor.h \
     244                driver/driver.h \
    224245                app/mainwindow.h
    225         /usr/bin/moc $(DEFINES) $(INCPATH) app/mainwindow.h -o ../bin/moc_mainwindow.cpp
    226 
    227 ../bin/moc_cardeditor.cpp: qpunchcard/deck.h \
    228                 qpunchcard/card.h \
    229                 qpunchcard/format.h \
    230                 qpunchcard/widget.h \
    231                 app/mainwindow.h \
    232                 deckviewer/navigatordock.h \
    233                 deckviewer/navigatormodel.h \
    234                 deckviewer/navigatorview.h \
    235                 deckviewer/cardeditor.h \
    236                 text/editordock.h \
    237                 text/codec.h \
    238                 text/editor.h \
     246        /usr/bin/moc $(DEFINES) $(INCPATH) app/mainwindow.h -o ../bin/moc/moc_mainwindow.cpp
     247
     248../bin/moc/moc_cardeditor.cpp: qpunchcard/deck.h \
     249                qpunchcard/card.h \
     250                qpunchcard/format.h \
     251                qpunchcard/widget.h \
     252                app/mainwindow.h \
     253                deckviewer/navigatordock.h \
     254                deckviewer/navigatormodel.h \
     255                deckviewer/navigatorview.h \
     256                deckviewer/cardeditor.h \
     257                text/editordock.h \
     258                text/codec.h \
     259                text/editor.h \
     260                driver/driver.h \
    239261                deckviewer/cardeditor.h
    240         /usr/bin/moc $(DEFINES) $(INCPATH) deckviewer/cardeditor.h -o ../bin/moc_cardeditor.cpp
    241 
    242 ../bin/moc_navigatordock.cpp: deckviewer/navigatormodel.h \
    243                 deckviewer/navigatordock.h \
    244                 deckviewer/navigatorview.h \
    245                 app/mainwindow.h \
    246                 qpunchcard/card.h \
    247                 qpunchcard/deck.h \
    248                 qpunchcard/format.h \
    249                 deckviewer/cardeditor.h \
    250                 qpunchcard/widget.h \
    251                 text/editordock.h \
    252                 text/codec.h \
    253                 text/editor.h \
     262        /usr/bin/moc $(DEFINES) $(INCPATH) deckviewer/cardeditor.h -o ../bin/moc/moc_cardeditor.cpp
     263
     264../bin/moc/moc_navigatordock.cpp: deckviewer/navigatormodel.h \
     265                deckviewer/navigatordock.h \
     266                deckviewer/navigatorview.h \
     267                app/mainwindow.h \
     268                qpunchcard/card.h \
     269                qpunchcard/deck.h \
     270                qpunchcard/format.h \
     271                deckviewer/cardeditor.h \
     272                qpunchcard/widget.h \
     273                text/editordock.h \
     274                text/codec.h \
     275                text/editor.h \
     276                driver/driver.h \
    254277                deckviewer/navigatordock.h
    255         /usr/bin/moc $(DEFINES) $(INCPATH) deckviewer/navigatordock.h -o ../bin/moc_navigatordock.cpp
    256 
    257 ../bin/moc_navigatormodel.cpp: deckviewer/navigatordock.h \
    258                 deckviewer/navigatormodel.h \
    259                 deckviewer/navigatorview.h \
    260                 app/mainwindow.h \
    261                 qpunchcard/card.h \
    262                 qpunchcard/deck.h \
    263                 qpunchcard/format.h \
    264                 deckviewer/cardeditor.h \
    265                 qpunchcard/widget.h \
    266                 text/editordock.h \
    267                 text/codec.h \
    268                 text/editor.h \
     278        /usr/bin/moc $(DEFINES) $(INCPATH) deckviewer/navigatordock.h -o ../bin/moc/moc_navigatordock.cpp
     279
     280../bin/moc/moc_navigatormodel.cpp: deckviewer/navigatordock.h \
     281                deckviewer/navigatormodel.h \
     282                deckviewer/navigatorview.h \
     283                app/mainwindow.h \
     284                qpunchcard/card.h \
     285                qpunchcard/deck.h \
     286                qpunchcard/format.h \
     287                deckviewer/cardeditor.h \
     288                qpunchcard/widget.h \
     289                text/editordock.h \
     290                text/codec.h \
     291                text/editor.h \
     292                driver/driver.h \
    269293                deckviewer/navigatormodel.h
    270         /usr/bin/moc $(DEFINES) $(INCPATH) deckviewer/navigatormodel.h -o ../bin/moc_navigatormodel.cpp
    271 
    272 ../bin/moc_navigatorview.cpp: deckviewer/navigatordock.h \
    273                 deckviewer/navigatormodel.h \
    274                 deckviewer/navigatorview.h \
    275                 app/mainwindow.h \
    276                 qpunchcard/card.h \
    277                 qpunchcard/deck.h \
    278                 qpunchcard/format.h \
    279                 deckviewer/cardeditor.h \
    280                 qpunchcard/widget.h \
    281                 text/editordock.h \
    282                 text/codec.h \
    283                 text/editor.h \
     294        /usr/bin/moc $(DEFINES) $(INCPATH) deckviewer/navigatormodel.h -o ../bin/moc/moc_navigatormodel.cpp
     295
     296../bin/moc/moc_navigatorview.cpp: deckviewer/navigatordock.h \
     297                deckviewer/navigatormodel.h \
     298                deckviewer/navigatorview.h \
     299                app/mainwindow.h \
     300                qpunchcard/card.h \
     301                qpunchcard/deck.h \
     302                qpunchcard/format.h \
     303                deckviewer/cardeditor.h \
     304                qpunchcard/widget.h \
     305                text/editordock.h \
     306                text/codec.h \
     307                text/editor.h \
     308                driver/driver.h \
    284309                deckviewer/navigatorview.h
    285         /usr/bin/moc $(DEFINES) $(INCPATH) deckviewer/navigatorview.h -o ../bin/moc_navigatorview.cpp
    286 
    287 ../bin/moc_deck.cpp: qpunchcard/card.h \
     310        /usr/bin/moc $(DEFINES) $(INCPATH) deckviewer/navigatorview.h -o ../bin/moc/moc_navigatorview.cpp
     311
     312../bin/moc/moc_deck.cpp: qpunchcard/card.h \
    288313                qpunchcard/format.h \
    289314                qpunchcard/deck.h \
    290315                qpunchcard/deck.h
    291         /usr/bin/moc $(DEFINES) $(INCPATH) qpunchcard/deck.h -o ../bin/moc_deck.cpp
    292 
    293 ../bin/moc_widget.cpp: qpunchcard/card.h \
     316        /usr/bin/moc $(DEFINES) $(INCPATH) qpunchcard/deck.h -o ../bin/moc/moc_deck.cpp
     317
     318../bin/moc/moc_widget.cpp: qpunchcard/card.h \
    294319                qpunchcard/widget.h
    295         /usr/bin/moc $(DEFINES) $(INCPATH) qpunchcard/widget.h -o ../bin/moc_widget.cpp
    296 
    297 ../bin/moc_editor.cpp: app/mainwindow.h \
    298                 qpunchcard/card.h \
    299                 qpunchcard/deck.h \
    300                 qpunchcard/format.h \
    301                 deckviewer/navigatordock.h \
    302                 deckviewer/navigatormodel.h \
    303                 deckviewer/navigatorview.h \
    304                 qpunchcard/widget.h \
    305                 deckviewer/cardeditor.h \
    306                 text/editordock.h \
    307                 text/codec.h \
    308                 text/editor.h \
     320        /usr/bin/moc $(DEFINES) $(INCPATH) qpunchcard/widget.h -o ../bin/moc/moc_widget.cpp
     321
     322../bin/moc/moc_editor.cpp: app/mainwindow.h \
     323                qpunchcard/card.h \
     324                qpunchcard/deck.h \
     325                qpunchcard/format.h \
     326                deckviewer/navigatordock.h \
     327                deckviewer/navigatormodel.h \
     328                deckviewer/navigatorview.h \
     329                qpunchcard/widget.h \
     330                deckviewer/cardeditor.h \
     331                text/editordock.h \
     332                text/codec.h \
     333                text/editor.h \
     334                driver/driver.h \
    309335                text/editor.h
    310         /usr/bin/moc $(DEFINES) $(INCPATH) text/editor.h -o ../bin/moc_editor.cpp
    311 
    312 ../bin/moc_editordock.cpp: app/mainwindow.h \
    313                 qpunchcard/card.h \
    314                 qpunchcard/deck.h \
    315                 qpunchcard/format.h \
    316                 deckviewer/navigatordock.h \
    317                 deckviewer/navigatormodel.h \
    318                 deckviewer/navigatorview.h \
    319                 qpunchcard/widget.h \
    320                 deckviewer/cardeditor.h \
    321                 text/editordock.h \
    322                 text/codec.h \
    323                 text/editor.h \
     336        /usr/bin/moc $(DEFINES) $(INCPATH) text/editor.h -o ../bin/moc/moc_editor.cpp
     337
     338../bin/moc/moc_editordock.cpp: app/mainwindow.h \
     339                qpunchcard/card.h \
     340                qpunchcard/deck.h \
     341                qpunchcard/format.h \
     342                deckviewer/navigatordock.h \
     343                deckviewer/navigatormodel.h \
     344                deckviewer/navigatorview.h \
     345                qpunchcard/widget.h \
     346                deckviewer/cardeditor.h \
     347                text/editordock.h \
     348                text/codec.h \
     349                text/editor.h \
     350                driver/driver.h \
    324351                text/editordock.h
    325         /usr/bin/moc $(DEFINES) $(INCPATH) text/editordock.h -o ../bin/moc_editordock.cpp
     352        /usr/bin/moc $(DEFINES) $(INCPATH) text/editordock.h -o ../bin/moc/moc_editordock.cpp
     353
     354../bin/moc/moc_driver.cpp: app/mainwindow.h \
     355                qpunchcard/card.h \
     356                qpunchcard/deck.h \
     357                qpunchcard/format.h \
     358                deckviewer/navigatordock.h \
     359                deckviewer/navigatormodel.h \
     360                deckviewer/navigatorview.h \
     361                qpunchcard/widget.h \
     362                deckviewer/cardeditor.h \
     363                text/editordock.h \
     364                text/codec.h \
     365                text/editor.h \
     366                driver/driver.h \
     367                driver/driver.h
     368        /usr/bin/moc $(DEFINES) $(INCPATH) driver/driver.h -o ../bin/moc/moc_driver.cpp
     369
     370../bin/moc/moc_controller.cpp: driver/driver.h \
     371                app/mainwindow.h \
     372                qpunchcard/card.h \
     373                qpunchcard/deck.h \
     374                qpunchcard/format.h \
     375                deckviewer/navigatordock.h \
     376                deckviewer/navigatormodel.h \
     377                deckviewer/navigatorview.h \
     378                qpunchcard/widget.h \
     379                deckviewer/cardeditor.h \
     380                text/editordock.h \
     381                text/codec.h \
     382                text/editor.h \
     383                driver/documation-m200-client/controller.h
     384        /usr/bin/moc $(DEFINES) $(INCPATH) driver/documation-m200-client/controller.h -o ../bin/moc/moc_controller.cpp
    326385
    327386compiler_rcc_make_all:
     
    344403####### Compile
    345404
    346 ../bin/mainwindow.o: app/mainwindow.cc app/mainwindow.h \
    347                 qpunchcard/card.h \
    348                 qpunchcard/deck.h \
    349                 qpunchcard/format.h \
    350                 deckviewer/navigatordock.h \
    351                 deckviewer/navigatormodel.h \
    352                 deckviewer/navigatorview.h \
    353                 qpunchcard/widget.h \
    354                 deckviewer/cardeditor.h \
    355                 text/editordock.h \
     405../bin/obj/main.o: app/main.cc app/mainwindow.h \
     406                qpunchcard/card.h \
     407                qpunchcard/deck.h \
     408                qpunchcard/format.h \
     409                deckviewer/navigatordock.h \
     410                deckviewer/navigatormodel.h \
     411                deckviewer/navigatorview.h \
     412                qpunchcard/widget.h \
     413                deckviewer/cardeditor.h \
     414                text/editordock.h \
     415                text/codec.h \
     416                text/editor.h \
     417                driver/driver.h
     418        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/main.o app/main.cc
     419
     420../bin/obj/mainwindow.o: app/mainwindow.cc app/mainwindow.h \
     421                qpunchcard/card.h \
     422                qpunchcard/deck.h \
     423                qpunchcard/format.h \
     424                deckviewer/navigatordock.h \
     425                deckviewer/navigatormodel.h \
     426                deckviewer/navigatorview.h \
     427                qpunchcard/widget.h \
     428                deckviewer/cardeditor.h \
     429                text/editordock.h \
     430                text/codec.h \
     431                text/editor.h \
     432                driver/driver.h
     433        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/mainwindow.o app/mainwindow.cc
     434
     435../bin/obj/mainwindow.ui.o: app/mainwindow.ui.cc app/mainwindow.h \
     436                qpunchcard/card.h \
     437                qpunchcard/deck.h \
     438                qpunchcard/format.h \
     439                deckviewer/navigatordock.h \
     440                deckviewer/navigatormodel.h \
     441                deckviewer/navigatorview.h \
     442                qpunchcard/widget.h \
     443                deckviewer/cardeditor.h \
     444                text/editordock.h \
     445                text/codec.h \
     446                text/editor.h \
     447                driver/driver.h
     448        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/mainwindow.ui.o app/mainwindow.ui.cc
     449
     450../bin/obj/cardeditor.o: deckviewer/cardeditor.cc deckviewer/cardeditor.h \
     451                qpunchcard/deck.h \
     452                qpunchcard/card.h \
     453                qpunchcard/format.h \
     454                qpunchcard/widget.h \
     455                app/mainwindow.h \
     456                deckviewer/navigatordock.h \
     457                deckviewer/navigatormodel.h \
     458                deckviewer/navigatorview.h \
     459                text/editordock.h \
     460                text/codec.h \
     461                text/editor.h \
     462                driver/driver.h
     463        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/cardeditor.o deckviewer/cardeditor.cc
     464
     465../bin/obj/navigatordock.o: deckviewer/navigatordock.cc deckviewer/navigatordock.h \
     466                deckviewer/navigatormodel.h \
     467                deckviewer/navigatorview.h \
     468                app/mainwindow.h \
     469                qpunchcard/card.h \
     470                qpunchcard/deck.h \
     471                qpunchcard/format.h \
     472                deckviewer/cardeditor.h \
     473                qpunchcard/widget.h \
     474                text/editordock.h \
     475                text/codec.h \
     476                text/editor.h \
     477                driver/driver.h
     478        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/navigatordock.o deckviewer/navigatordock.cc
     479
     480../bin/obj/navigatormodel.o: deckviewer/navigatormodel.cc deckviewer/navigatormodel.h \
     481                deckviewer/navigatordock.h \
     482                deckviewer/navigatorview.h \
     483                app/mainwindow.h \
     484                qpunchcard/card.h \
     485                qpunchcard/deck.h \
     486                qpunchcard/format.h \
     487                deckviewer/cardeditor.h \
     488                qpunchcard/widget.h \
     489                text/editordock.h \
     490                text/codec.h \
     491                text/editor.h \
     492                driver/driver.h
     493        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/navigatormodel.o deckviewer/navigatormodel.cc
     494
     495../bin/obj/navigatorview.o: deckviewer/navigatorview.cc deckviewer/navigatorview.h \
     496                deckviewer/navigatordock.h \
     497                deckviewer/navigatormodel.h \
     498                app/mainwindow.h \
     499                qpunchcard/card.h \
     500                qpunchcard/deck.h \
     501                qpunchcard/format.h \
     502                deckviewer/cardeditor.h \
     503                qpunchcard/widget.h \
     504                text/editordock.h \
     505                text/codec.h \
     506                text/editor.h \
     507                driver/driver.h
     508        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/navigatorview.o deckviewer/navigatorview.cc
     509
     510../bin/obj/card.o: qpunchcard/card.cc qpunchcard/card.h
     511        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/card.o qpunchcard/card.cc
     512
     513../bin/obj/deck.o: qpunchcard/deck.cc qpunchcard/deck.h \
     514                qpunchcard/card.h \
     515                qpunchcard/format.h
     516        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/deck.o qpunchcard/deck.cc
     517
     518../bin/obj/format.o: qpunchcard/format.cc qpunchcard/format.h \
     519                qpunchcard/card.h \
     520                qpunchcard/deck.h
     521        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/format.o qpunchcard/format.cc
     522
     523../bin/obj/widget.o: qpunchcard/widget.cc qpunchcard/widget.h \
     524                qpunchcard/card.h
     525        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/widget.o qpunchcard/widget.cc
     526
     527../bin/obj/codec.o: text/codec.cc text/codec.h \
     528                qpunchcard/card.h \
     529                qpunchcard/deck.h \
     530                qpunchcard/format.h \
     531                text/cardcodes.h
     532        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/codec.o text/codec.cc
     533
     534../bin/obj/editor.o: text/editor.cc text/editor.h \
     535                app/mainwindow.h \
     536                qpunchcard/card.h \
     537                qpunchcard/deck.h \
     538                qpunchcard/format.h \
     539                deckviewer/navigatordock.h \
     540                deckviewer/navigatormodel.h \
     541                deckviewer/navigatorview.h \
     542                qpunchcard/widget.h \
     543                deckviewer/cardeditor.h \
     544                text/editordock.h \
     545                text/codec.h \
     546                driver/driver.h
     547        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/editor.o text/editor.cc
     548
     549../bin/obj/editordock.o: text/editordock.cc text/editordock.h \
     550                app/mainwindow.h \
     551                qpunchcard/card.h \
     552                qpunchcard/deck.h \
     553                qpunchcard/format.h \
     554                deckviewer/navigatordock.h \
     555                deckviewer/navigatormodel.h \
     556                deckviewer/navigatorview.h \
     557                qpunchcard/widget.h \
     558                deckviewer/cardeditor.h \
     559                driver/driver.h \
    356560                text/codec.h \
    357561                text/editor.h
    358         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/mainwindow.o app/mainwindow.cc
    359 
    360 ../bin/mainwindow.ui.o: app/mainwindow.ui.cc app/mainwindow.h \
     562        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/editordock.o text/editordock.cc
     563
     564../bin/obj/driver.o: driver/driver.cc driver/driver.h \
     565                app/mainwindow.h \
    361566                qpunchcard/card.h \
    362567                qpunchcard/deck.h \
     
    370575                text/codec.h \
    371576                text/editor.h
    372         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/mainwindow.ui.o app/mainwindow.ui.cc
    373 
    374 ../bin/cardeditor.o: deckviewer/cardeditor.cc deckviewer/cardeditor.h \
    375                 qpunchcard/deck.h \
    376                 qpunchcard/card.h \
    377                 qpunchcard/format.h \
    378                 qpunchcard/widget.h \
    379                 app/mainwindow.h \
    380                 deckviewer/navigatordock.h \
    381                 deckviewer/navigatormodel.h \
    382                 deckviewer/navigatorview.h \
     577        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/driver.o driver/driver.cc
     578
     579../bin/obj/qextserialbase.o: libs/qextserialport/qextserialbase.cpp libs/qextserialport/qextserialbase.h
     580        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/qextserialbase.o libs/qextserialport/qextserialbase.cpp
     581
     582../bin/obj/qextserialport.o: libs/qextserialport/qextserialport.cpp libs/qextserialport/qextserialport.h \
     583                libs/qextserialport/posix_qextserialport.h \
     584                libs/qextserialport/qextserialbase.h \
     585                libs/qextserialport/win_qextserialport.h
     586        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/qextserialport.o libs/qextserialport/qextserialport.cpp
     587
     588../bin/obj/posix_qextserialport.o: libs/qextserialport/posix_qextserialport.cpp libs/qextserialport/posix_qextserialport.h \
     589                libs/qextserialport/qextserialbase.h
     590        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/posix_qextserialport.o libs/qextserialport/posix_qextserialport.cpp
     591
     592../bin/obj/controller.o: driver/documation-m200-client/controller.cc driver/documation-m200-client/controller.h \
     593                driver/driver.h \
     594                app/mainwindow.h \
     595                qpunchcard/card.h \
     596                qpunchcard/deck.h \
     597                qpunchcard/format.h \
     598                deckviewer/navigatordock.h \
     599                deckviewer/navigatormodel.h \
     600                deckviewer/navigatorview.h \
     601                qpunchcard/widget.h \
     602                deckviewer/cardeditor.h \
    383603                text/editordock.h \
    384604                text/codec.h \
    385605                text/editor.h
    386         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/cardeditor.o deckviewer/cardeditor.cc
    387 
    388 ../bin/navigatordock.o: deckviewer/navigatordock.cc deckviewer/navigatordock.h \
    389                 deckviewer/navigatormodel.h \
    390                 deckviewer/navigatorview.h \
    391                 app/mainwindow.h \
    392                 qpunchcard/card.h \
    393                 qpunchcard/deck.h \
    394                 qpunchcard/format.h \
    395                 deckviewer/cardeditor.h \
    396                 qpunchcard/widget.h \
    397                 text/editordock.h \
    398                 text/codec.h \
    399                 text/editor.h
    400         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/navigatordock.o deckviewer/navigatordock.cc
    401 
    402 ../bin/navigatormodel.o: deckviewer/navigatormodel.cc deckviewer/navigatormodel.h \
    403                 deckviewer/navigatordock.h \
    404                 deckviewer/navigatorview.h \
    405                 app/mainwindow.h \
    406                 qpunchcard/card.h \
    407                 qpunchcard/deck.h \
    408                 qpunchcard/format.h \
    409                 deckviewer/cardeditor.h \
    410                 qpunchcard/widget.h \
    411                 text/editordock.h \
    412                 text/codec.h \
    413                 text/editor.h
    414         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/navigatormodel.o deckviewer/navigatormodel.cc
    415 
    416 ../bin/navigatorview.o: deckviewer/navigatorview.cc deckviewer/navigatorview.h \
    417                 deckviewer/navigatordock.h \
    418                 deckviewer/navigatormodel.h \
    419                 app/mainwindow.h \
    420                 qpunchcard/card.h \
    421                 qpunchcard/deck.h \
    422                 qpunchcard/format.h \
    423                 deckviewer/cardeditor.h \
    424                 qpunchcard/widget.h \
    425                 text/editordock.h \
    426                 text/codec.h \
    427                 text/editor.h
    428         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/navigatorview.o deckviewer/navigatorview.cc
    429 
    430 ../bin/card.o: qpunchcard/card.cc qpunchcard/card.h
    431         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/card.o qpunchcard/card.cc
    432 
    433 ../bin/deck.o: qpunchcard/deck.cc qpunchcard/deck.h \
    434                 qpunchcard/card.h \
    435                 qpunchcard/format.h
    436         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/deck.o qpunchcard/deck.cc
    437 
    438 ../bin/format.o: qpunchcard/format.cc qpunchcard/format.h \
    439                 qpunchcard/card.h \
    440                 qpunchcard/deck.h
    441         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/format.o qpunchcard/format.cc
    442 
    443 ../bin/widget.o: qpunchcard/widget.cc qpunchcard/widget.h \
    444                 qpunchcard/card.h
    445         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/widget.o qpunchcard/widget.cc
    446 
    447 ../bin/codec.o: text/codec.cc text/codec.h \
    448                 qpunchcard/card.h \
    449                 text/cardcodes.h
    450         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/codec.o text/codec.cc
    451 
    452 ../bin/editor.o: text/editor.cc text/editor.h \
    453                 app/mainwindow.h \
    454                 qpunchcard/card.h \
    455                 qpunchcard/deck.h \
    456                 qpunchcard/format.h \
    457                 deckviewer/navigatordock.h \
    458                 deckviewer/navigatormodel.h \
    459                 deckviewer/navigatorview.h \
    460                 qpunchcard/widget.h \
    461                 deckviewer/cardeditor.h \
    462                 text/editordock.h \
    463                 text/codec.h
    464         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/editor.o text/editor.cc
    465 
    466 ../bin/editordock.o: text/editordock.cc text/editordock.h \
    467                 app/mainwindow.h \
    468                 qpunchcard/card.h \
    469                 qpunchcard/deck.h \
    470                 qpunchcard/format.h \
    471                 deckviewer/navigatordock.h \
    472                 deckviewer/navigatormodel.h \
    473                 deckviewer/navigatorview.h \
    474                 qpunchcard/widget.h \
    475                 deckviewer/cardeditor.h \
    476                 text/codec.h \
    477                 text/editor.h
    478         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/editordock.o text/editordock.cc
    479 
    480 ../bin/driver.o: driver/driver.cc driver/driver.h \
    481                 app/mainwindow.h \
    482                 qpunchcard/card.h \
    483                 qpunchcard/deck.h \
    484                 qpunchcard/format.h \
    485                 deckviewer/navigatordock.h \
    486                 deckviewer/navigatormodel.h \
    487                 deckviewer/navigatorview.h \
    488                 qpunchcard/widget.h \
    489                 deckviewer/cardeditor.h \
    490                 text/editordock.h \
    491                 text/codec.h \
    492                 text/editor.h
    493         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/driver.o driver/driver.cc
    494 
    495 ../bin/moc_mainwindow.o: ../bin/moc_mainwindow.cpp
    496         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/moc_mainwindow.o ../bin/moc_mainwindow.cpp
    497 
    498 ../bin/moc_cardeditor.o: ../bin/moc_cardeditor.cpp
    499         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/moc_cardeditor.o ../bin/moc_cardeditor.cpp
    500 
    501 ../bin/moc_navigatordock.o: ../bin/moc_navigatordock.cpp
    502         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/moc_navigatordock.o ../bin/moc_navigatordock.cpp
    503 
    504 ../bin/moc_navigatormodel.o: ../bin/moc_navigatormodel.cpp
    505         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/moc_navigatormodel.o ../bin/moc_navigatormodel.cpp
    506 
    507 ../bin/moc_navigatorview.o: ../bin/moc_navigatorview.cpp
    508         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/moc_navigatorview.o ../bin/moc_navigatorview.cpp
    509 
    510 ../bin/moc_deck.o: ../bin/moc_deck.cpp
    511         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/moc_deck.o ../bin/moc_deck.cpp
    512 
    513 ../bin/moc_widget.o: ../bin/moc_widget.cpp
    514         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/moc_widget.o ../bin/moc_widget.cpp
    515 
    516 ../bin/moc_editor.o: ../bin/moc_editor.cpp
    517         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/moc_editor.o ../bin/moc_editor.cpp
    518 
    519 ../bin/moc_editordock.o: ../bin/moc_editordock.cpp
    520         $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/moc_editordock.o ../bin/moc_editordock.cpp
     606        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/controller.o driver/documation-m200-client/controller.cc
     607
     608../bin/obj/moc_mainwindow.o: ../bin/moc/moc_mainwindow.cpp
     609        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_mainwindow.o ../bin/moc/moc_mainwindow.cpp
     610
     611../bin/obj/moc_cardeditor.o: ../bin/moc/moc_cardeditor.cpp
     612        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_cardeditor.o ../bin/moc/moc_cardeditor.cpp
     613
     614../bin/obj/moc_navigatordock.o: ../bin/moc/moc_navigatordock.cpp
     615        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_navigatordock.o ../bin/moc/moc_navigatordock.cpp
     616
     617../bin/obj/moc_navigatormodel.o: ../bin/moc/moc_navigatormodel.cpp
     618        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_navigatormodel.o ../bin/moc/moc_navigatormodel.cpp
     619
     620../bin/obj/moc_navigatorview.o: ../bin/moc/moc_navigatorview.cpp
     621        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_navigatorview.o ../bin/moc/moc_navigatorview.cpp
     622
     623../bin/obj/moc_deck.o: ../bin/moc/moc_deck.cpp
     624        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_deck.o ../bin/moc/moc_deck.cpp
     625
     626../bin/obj/moc_widget.o: ../bin/moc/moc_widget.cpp
     627        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_widget.o ../bin/moc/moc_widget.cpp
     628
     629../bin/obj/moc_editor.o: ../bin/moc/moc_editor.cpp
     630        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_editor.o ../bin/moc/moc_editor.cpp
     631
     632../bin/obj/moc_editordock.o: ../bin/moc/moc_editordock.cpp
     633        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_editordock.o ../bin/moc/moc_editordock.cpp
     634
     635../bin/obj/moc_driver.o: ../bin/moc/moc_driver.cpp
     636        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_driver.o ../bin/moc/moc_driver.cpp
     637
     638../bin/obj/moc_controller.o: ../bin/moc/moc_controller.cpp
     639        $(CXX) -c $(CXXFLAGS) $(INCPATH) -o ../bin/obj/moc_controller.o ../bin/moc/moc_controller.cpp
    521640
    522641####### Install
  • punch-card/punch-card-editor/src/app/main.cc

    r44 r53  
    11#include <QApplication>
    2 #include "editorwindow.h"
     2#include "app/mainwindow.h"
     3
     4using namespace QPunchCard;
    35
    46int main(int argc, char** argv) {
    57        QApplication app(argc, argv);
    6         EditorWindow win;
     8        App::MainWindow win;
    79        win.show();
    810        return app.exec();
  • punch-card/punch-card-editor/src/app/mainwindow.cc

    r52 r53  
    88#include <QtDebug>
    99#include <QListView>
     10#include <QUndoView>
    1011#include <QDockWidget>
    1112#include <QHBoxLayout>
     
    4445        createStatusBar();
    4546        createDockWindows();
     47        createDevices();
    4648
    4749        // Titel einrichten und so
    4850        connect(this, SIGNAL(fileOpened(bool)), this, SLOT(window_update_on_file_state(bool)));
     51        connect(this, SIGNAL(fileOpened(bool)), this, SLOT(actions_update_on_file_state(bool)));
    4952        // und jetzt:
    5053
     
    6265}
    6366
    64 void MainWindow::window_update_on_file_state(bool opened) {
    65         // * Window Title setzen
    66         // * contentsChanged-Signal broadcasten
    67         if(opened) {
    68                 // titel setzen
    69                 setWindowFilePath(QFileInfo(file).filePath());
    70                 setWindowTitle(tr("%1[*] - %2").arg(
    71                         file.fileName().isEmpty() ? tr("New Card Deck") : file.fileName()
    72                         ).arg(tr("Punch Card Editor")));
    73                 // Modified-Stern ([*]) verbinden
    74                 connect(deck, SIGNAL(modified(bool)), this, SLOT(setWindowModified(bool)));
    75 
    76                 // Broadcasting von "Edited" verbinden
    77                 connect(deck, SIGNAL(contentsChanged(DeckIndex, DeckIndex)), this, SIGNAL(contentsChanged(DeckIndex,DeckIndex)));
    78         } else {
    79                 setWindowTitle(tr("Punch Card Editor"));
    80                 // passiert folgendes nicht sowieso automatisch?
    81                 disconnect(this, SLOT(setWindowModified(bool)));
    82                 // urhm, den broadcaster... nicht die slots freisetzen, waere bloed.
    83         }
    84 }
    8567
    8668bool MainWindow::maybeSave() {
     
    10082                        return true; // discard the file
    10183        }
    102 }
    103 
    104 void MainWindow::newWindow() {
    105         // einfacher gehts nicht:
    106         new MainWindow();
    10784}
    10885
     
    147124
    148125void MainWindow::newFile() {
     126        // KISS: Simply open a new window. Don't touch current window.
     127        MainWindow* window = new MainWindow();
     128        window->show();
     129        // This would open a new file in current window.
     130        /*
    149131        if(maybeSave()) {
    150132                // alte Datei schliessen.
     
    154136                deck = new Deck();
    155137                notifyFileOpened();
    156         }
     138        }*/
    157139}
    158140
     
    220202void MainWindow::closeFile() {
    221203        if(maybeSave()) {
     204                // Fenster schliessen. Deck schliesst damit automatisch.
     205
    222206                // Deck schliessen und fertig.
    223                 closeDeck();
     207                // closeDeck();
    224208        }
    225209}
     
    240224
    241225void MainWindow::help() {
    242 
     226        qDebug("Display some help viewer...");
    243227}
    244228
     
    341325}
    342326
     327void MainWindow::createStatusBar() {
     328        this->statusBar()->showMessage(tr("Welcome to the Punch Card Editor"), 1000);
     329}
     330
     331void MainWindow::createDevices() {
     332        QList<QString> driver_names = Device::DriverFactory::availableDrivers();
     333        qDebug() << "Driver names: " << driver_names;
     334        for(int i = 0; i < driver_names.count(); i++) {
     335                Device::Dock* dock = new Device::Dock(driver_names[i], this);
     336                this->addDockWidget(Qt::TopDockWidgetArea, dock);
     337                dock->setVisible(false);
     338                device_docks.append(dock);
     339                devices_menu->addAction( dock->toggleViewAction() );
     340        }
     341}
     342
    343343
    344344void MainWindow::createDockWindows() {
  • punch-card/punch-card-editor/src/app/mainwindow.h

    r52 r53  
    44#include <QMainWindow>
    55#include <QAction>
     6#include <QUndoView>
    67#include <QMenu>
    78#include <QMenuBar>
     
    2223#include "deckviewer/cardeditor.h"
    2324#include "text/editordock.h"
     25#include "driver/driver.h"
    2426
    2527namespace QPunchCard {
     
    3840        QPointer<Navigator::Dock> navigator;
    3941        QPointer<CardEditor> graphical_editor;
    40         QList< QPointer<Text::EditorDock> > text_editors; // eigentlich nur fuer exportText()
     42        QList< QPointer<QPunchCard::Text::EditorDock> > text_editors; // eigentlich nur fuer exportText()
     43        QList< QPointer<QPunchCard::Device::Dock> > device_docks;
    4144
    4245        MainWindow();
     
    5861public slots:
    5962        void newFile();
    60         void newWindow();
    6163        void openFile();
    6264        /// Speichert Datei. Wenn kein Dateiname, ruft saveFileAs auf.
     
    9395private slots:
    9496        void window_update_on_file_state(bool opened);
     97        void actions_update_on_file_state(bool opened);
    9598
    9699private:
     100        void createDevices();
    97101        void createGraphicalEditor();
    98102        void createActions();
    99103        void createMenus();
     104        void createDynamicMenus();
    100105        void createToolBars();
     106        void createDynamicToolBars();
    101107        void createStatusBar();
    102108        void createDockWindows();
     
    104110        void notifyFileOpened();
    105111
     112        // top level menus
    106113        QMenu* file_menu;
    107114        QMenu* edit_menu;
     
    110117        QMenu* help_menu;
    111118
     119        // sub menus
     120        QMenu* toolbars_view_menu;
     121        QMenu* docks_view_menu;
     122
    112123        QToolBar* navi_bar;
     124        QToolBar* main_bar;
    113125
    114         // Hauptactions
    115         QAction* new_file_action;
    116         QAction* new_window_action;
    117         QAction* open_file_action;
    118         QAction* save_file_action;
    119         QAction* save_file_as_action;
    120         QAction* export_text_action;
    121         QAction* export_picture_action;
    122         QAction* close_file_action;
    123         QAction* quit_action;
    124         QAction* help_action;
    125         QAction* about_action;
     126        QUndoView* undo_view;
    126127
    127         // Editactions
    128         QAction* undo_action;
    129         QAction* redo_action;
     128        // FILE Actions
     129        QAction
     130                * new_file_action,
     131                * open_file_action,
     132                * save_file_action,
     133                * save_file_as_action,
     134                * export_text_action,
     135                * export_picture_action,
     136                * close_action,
     137                * help_action,
     138                * about_action;
     139
     140        // EDIT Actions
     141        QAction
     142                * undo_action,
     143                * redo_action,
     144                * undo_view_action;
     145
    130146
    131147        QAction* new_text_editor_action;
  • punch-card/punch-card-editor/src/app/mainwindow.ui.cc

    r52 r53  
    1818using namespace App;
    1919
     20
     21void MainWindow::window_update_on_file_state(bool opened) {
     22        // * Window Title setzen
     23        // * contentsChanged-Signal broadcasten
     24        // * Menus und Actions erstellen
     25        if(opened) {
     26                // titel setzen
     27                setWindowFilePath(QFileInfo(file).filePath());
     28                setWindowTitle(tr("%1[*] - %2").arg(
     29                        file.fileName().isEmpty() ? tr("New Card Deck") : file.fileName()
     30                        ).arg(tr("Punch Card Editor")));
     31                // Modified-Stern ([*]) verbinden
     32                connect(deck, SIGNAL(modified(bool)), this, SLOT(setWindowModified(bool)));
     33
     34                // Broadcasting von "Edited" verbinden
     35                connect(deck, SIGNAL(contentsChanged(DeckIndex, DeckIndex)), this, SIGNAL(contentsChanged(DeckIndex,DeckIndex)));
     36        } else {
     37                setWindowTitle(tr("Punch Card Editor"));
     38                // passiert folgendes nicht sowieso automatisch?
     39                disconnect(this, SLOT(setWindowModified(bool)));
     40                // urhm, den broadcaster... nicht die slots freisetzen, waere bloed.
     41        }
     42}
     43
     44void MainWindow::actions_update_on_file_state(bool opened) {
     45        // 1#
     46        if(opened) {
     47                // Actions erstellen
     48                undo_action = deck->createUndoAction();
     49                redo_action = deck->createRedoAction();
     50
     51                // Undo view
     52                QDockWidget* undo_view_dock = new QDockWidget(tr("Editing History"), this);
     53                this->addDockWidget(Qt::RightDockWidgetArea, undo_view_dock);
     54                undo_view_dock->setVisible(false);
     55                undo_view_action = undo_view_dock->toggleViewAction();
     56                undo_view = new QUndoView(deck->getUndoStack(), undo_view_dock);
     57                undo_view_dock->setWidget(undo_view);
     58
     59                // Signale verbinden
     60                connect(deck, SIGNAL(modified(bool)), save_file_action, SLOT(setEnabled(bool)));
     61                connect(deck, SIGNAL(modified(bool)), save_file_as_action, SLOT(setEnabled(bool)));
     62
     63                // dynamische Menues und Toolbars erstellen
     64                createDynamicMenus();
     65                createDynamicToolBars();
     66        } else {
     67                // dieser Status existiert gar nicht und so!11 (oh man, aber echt)
     68                qDebug("Calling bad state in actions_update_on_file_state");
     69        }
     70}
     71
    2072void MainWindow::createActions() {
    21         new_file_action = new QAction(tr("&New File (Empty Card Deck)"), this);
     73        //----------------------- FILE ------------------------------
     74        // new File: Always possible, open new Window with empty file
     75        new_file_action = new QAction(tr("&New"), this);
    2276        new_file_action->setShortcuts(QKeySequence::New);
    23         new_file_action->setStatusTip(tr("Create a new empty card deck"));
     77        new_file_action->setStatusTip(tr("Open a new window with an empty card deck"));
    2478        connect(new_file_action, SIGNAL(triggered()), this, SLOT(newFile()));
    2579
    26         new_window_action = new QAction(tr("&New Window"), this);
    27         new_window_action->setStatusTip(tr("Open a new Application window to edit two card decks concurrently"));
    28         connect(new_window_action, SIGNAL(triggered()), this, SLOT(newWindow()));
    29 
     80        // open File: Always possible, open file in current window
    3081        open_file_action = new QAction(tr("&Open File..."), this);
    3182        open_file_action->setShortcuts(QKeySequence::Open);
     
    3384        connect(open_file_action, SIGNAL(triggered()), this, SLOT(openFile()));
    3485
     86        // save File: Only possible if current deck can be saved
    3587        save_file_action = new QAction(tr("&Save File"), this);
    3688        save_file_action->setShortcuts(QKeySequence::Save);
    3789        save_file_action->setStatusTip(tr("Save the current file as card deck"));
    3890        connect(save_file_action, SIGNAL(triggered()), this, SLOT(saveFile()));
    39 
     91        // connection to deck will be etabilshed when deck is loaded
     92
     93        // save File as: Only possible if current deck can be saved
    4094        save_file_as_action = new QAction(tr("&Save File as..."), this);
    4195        save_file_as_action->setShortcuts(QKeySequence::SaveAs);
    4296        save_file_as_action->setStatusTip(tr("Save the current card deck as another file"));
    4397        connect(save_file_as_action, SIGNAL(triggered()), this, SLOT(saveFileAs()));
    44 
     98        // connection to deck will be etabilshed when deck is loaded
     99
     100        // export Text: Always possible with present deck, deck always present
    45101        export_text_action = new QAction(tr("&Export Text..."), this);
    46102        export_text_action->setStatusTip(tr("Save the decoded plaintext of the current card deck"));
    47103        connect(export_text_action, SIGNAL(triggered()), this, SLOT(exportText()));
    48104
     105        // export Picture: Always possible with present deck, deck always present
    49106        export_picture_action = new QAction(tr("&Export Picture of Card..."), this);
    50107        export_picture_action->setStatusTip(tr("Save the visualisation of one or more cards as a picture"));
    51108        connect(export_picture_action, SIGNAL(triggered()), this, SLOT(exportPicture()));
    52109
    53         close_file_action = new QAction(tr("&Close File"), this);
    54         close_file_action->setStatusTip(tr("Close current file while staying in the application"));
    55         connect(close_file_action, SIGNAL(triggered()), this, SLOT(closeFile()));
    56 
    57         quit_action = new QAction(tr("&Quit"), this);
    58         quit_action->setStatusTip(tr("Quit Application"));
    59         connect(quit_action, SIGNAL(triggered()), qApp, SLOT(closeAllWindows()));
    60 
     110        // close Window: Always possible. Will close Window and if no more windows left => quitting.
     111        close_action = new QAction(tr("&Quit"), this);
     112        close_action->setShortcuts(QKeySequence::Close);
     113        close_action->setStatusTip(tr("Close current file while staying in the application"));
     114        connect(close_action, SIGNAL(triggered()), this, SLOT(close()));
     115
     116        // Display Help: Always possible.
    61117        help_action = new QAction(tr("&Help"), this);
     118        help_action->setShortcuts(QKeySequence::HelpContents);
    62119        help_action->setStatusTip(tr("Get Help about the usage of this program"));
    63120        connect(help_action, SIGNAL(triggered()), this, SLOT(help()));
    64121
     122        // Display about box: Always possible
    65123        about_action = new QAction(tr("&About"), this);
    66124        about_action->setStatusTip(tr("Display some information about the author and program version"));
    67125        connect(about_action, SIGNAL(triggered()), this, SLOT(about()));
    68126
     127        //----------------------- EDIT ------------------------------
     128
     129
     130        // Open new Text Editor: Always possible with deck present, deck always present
    69131        new_text_editor_action = new QAction(tr("Open new &Text editor"), this);
    70132        new_text_editor_action->setStatusTip(tr("Display another text editor for editing the dock using a card code"));
    71133        connect(new_text_editor_action, SIGNAL(triggered()), this, SLOT(newTextEditor()));
    72 
    73         undo_action = new QAction(tr("&Undo"), this);
    74         redo_action = new QAction(tr("&Redo"), this);
    75         undo_action->setStatusTip(tr("Undo latest changes"));
    76         redo_action->setStatusTip(tr("Redo latest changes"));
    77134
    78135        next_card_action = new QAction(tr("&Next Card"), this);
     
    110167        file_menu->addAction(export_picture_action);
    111168        file_menu->addSeparator();
    112         file_menu->addAction(close_file_action);
    113         file_menu->addAction(quit_action);
    114 
     169        file_menu->addAction(close_action);
     170
     171        // Inhalte von Edit und View erst bei actions_update_on_file_state zugeordnet
    115172        edit_menu = menuBar()->addMenu(tr("&Edit"));
     173        view_menu = menuBar()->addMenu(tr("&View"));
     174
     175        // Submenus
     176        toolbars_view_menu = new QMenu("&Toolbars", this);
     177        docks_view_menu = new QMenu("&Docks", this);
     178
     179        devices_menu = menuBar()->addMenu(tr("&Devices"));
     180        // hier alle Geraete auflisten, fuer die es Treiber gibt (=> driver, DriverOverview oder so)
     181        // wird von createDevices() gemacht
     182
     183        menuBar()->addSeparator(); // for Motif ;-)
     184        help_menu = menuBar()->addMenu(tr("&Help"));
     185        help_menu->addAction(help_action);
     186        help_menu->addSeparator();
     187        help_menu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
     188        help_menu->addAction(about_action);
     189}
     190
     191void MainWindow::createDynamicMenus() {
     192        // nur von actions_update_on_file_state aufzurufen.
     193        edit_menu->clear();
    116194        edit_menu->addAction(undo_action);
    117195        edit_menu->addAction(redo_action);
     196        edit_menu->addAction(undo_view_action);
    118197        edit_menu->addSeparator();
    119         // ---
    120         // Cut, Copy, Insert
    121         // --
    122         // Insert punch card
    123         // usw.
    124 
    125         view_menu = menuBar()->addMenu(tr("&View"));
     198        // Cut, Copy, Insert => Waere ziemlich kompliziert wegen der vielen Modelle
     199        edit_menu->addAction(new_card_action);
     200        edit_menu->addAction(move_backwards_action);
     201        edit_menu->addAction(move_forwards_action);
     202
     203        view_menu->clear();
    126204        view_menu->addAction(new_text_editor_action);
    127205        view_menu->addSeparator();
     206        // hier jetzt actions von der EditorKomponente
     207        // (Zoom, usw.)
     208        view_menu->addSeparator();
     209        view_menu->addMenu(toolbars_view_menu);
     210        view_menu->addMenu(docks_view_menu);
    128211        // Ansichten:
    129212        // - Neue Textansicht hinzufuegen
     
    133216        // - Vor/Zurueck bei Lochkarte oder Spalte (letzteres doof)
    134217
    135         devices_menu = menuBar()->addMenu(tr("&Devices"));
    136         // hier alle Geraete auflisten, fuer die es Treiber gibt (=> driver, DriverOverview oder so)
    137 
    138         help_menu = menuBar()->addMenu(tr("&Help"));
    139         help_menu->addAction(help_action);
    140         help_menu->addAction(tr("About &Qt"), qApp, SLOT(aboutQt()));
    141         help_menu->addAction(about_action);
     218
    142219}
    143220
    144221void MainWindow::createToolBars() {
    145         // ja ne... waere momentan noch das gleiche wie die Menus, also
    146         // schon irgendwie iditisch. Egal:
     222        main_bar = addToolBar(tr("Main"));
     223        toolbars_view_menu->addAction(main_bar->toggleViewAction());
     224
     225        main_bar->addAction(new_file_action);
     226        main_bar->addAction(open_file_action);
     227        main_bar->addSeparator();
     228        main_bar->addAction(save_file_action);
     229        main_bar->addAction(save_file_as_action);
     230        main_bar->addSeparator();
     231        main_bar->addAction(export_text_action);
     232        // usw.
    147233
    148234        navi_bar = addToolBar(tr("Navigation"));
     235        toolbars_view_menu->addAction(navi_bar->toggleViewAction());
     236
    149237        navi_bar->addAction(prev_card_action);
    150238        navi_bar->addAction(next_card_action);
     
    153241        navi_bar->addAction(this->move_forwards_action);
    154242}
     243
     244void MainWindow::createDynamicToolBars() {
     245        // hier halt sowas wie undo, redo, usw.
     246        // eigentlich brauchen wir auch nur eine Toolbar...
     247}
  • punch-card/punch-card-editor/src/driver/driver.cc

    r52 r53  
    11#include "driver.h"
    22
     3#include <QLabel>
     4
    35using namespace QPunchCard;
    4 using namespace Driver;
     6using namespace Device;
     7
     8Dock::Dock(QString driver_name, App::MainWindow* parent) : QDockWidget(parent), main(parent), driver_name(driver_name) {
     9        setWindowTitle( tr("%1 Device Driver").arg(driver_name) );
     10        connect(this, SIGNAL(visibilityChanged(bool)), this, SLOT(visibilityHook(bool)));
     11}
     12
     13void Dock::visibilityHook(bool visible) {
     14        // Singleton behaviour
     15        if(!visible || controller)
     16                return;
     17
     18        qDebug() << "Firing up device driver " << driver_name;
     19        // first making visible. Create controller widget.
     20        controller = DriverFactory::createController(driver_name, this);
     21        if(!controller) {
     22                // Bad name! So create an error message
     23                controller = new QLabel(tr("<b>Bad controller:</b> <i>%1</i> doesn't exist").arg(driver_name), this);
     24        }
     25        setWidget(controller);
     26        controller->setVisible(true);
     27}
    528
    629QList<QString> DriverFactory::availableDrivers() {
    730        QList<QString> ret;
    8         // now just empty
     31        ret << "Test";
    932        return ret;
    1033}
    1134
    12 Driver* DriverFactory::createDriver(const QString& name) {
    13         // uhrm:
    14         return 0;
    15         // yeah.
     35QWidget* DriverFactory::createController(const QString& name, QWidget* parent) {
     36        if(name == "Test") {
     37                return new QLabel("This is the Test driver :-)", parent);
     38        } else {
     39                qDebug() << "DriverFactory: Bad driver: " << name;
     40                return 0;
     41        }
    1642}
    1743
     44Dock* DriverFactory::createDock(const QString& name, App::MainWindow* window) {
     45        // yay, this is senseless...
     46        return new Dock(name, window);
     47}
     48
  • punch-card/punch-card-editor/src/driver/driver.h

    r52 r53  
    22#define DRIVER_H
    33
     4#include <QDockWidget>
    45#include <QString>
    56#include <QList>
    67
    78namespace QPunchCard {
    8 namespace Driver {
    9         class Driver;
     9namespace Device {
     10        class Dock;
     11        class Driver; // Backend
    1012        class DriverFactory;
    1113};
     
    1517
    1618namespace QPunchCard {
    17 namespace Driver {
     19namespace Device {
    1820
     21class Dock : public QDockWidget {
     22        Q_OBJECT
    1923
    20 class Driver {
     24        App::MainWindow* main;
     25        QString driver_name;
     26        QPointer<QWidget> controller;
    2127public:
    22         virtual void execute() = 0;
     28        Dock(QString driver_name, App::MainWindow* parent);
     29        bool isStarted() const { return controller; }
     30private slots:
     31        void visibilityHook(bool visible);
    2332};
    2433
    2534class DriverFactory {
     35public:
    2636        static QList<QString> availableDrivers();
    27         static Driver* createDriver(const QString& name);
     37        static Dock* createDock(const QString& name, App::MainWindow* window);
     38        static QWidget* createController(const QString& name, QWidget* parent = 0);
    2839};
    2940
  • punch-card/punch-card-editor/src/qpunchcard/card.h

    r52 r53  
    1414
    1515namespace QPunchCard {
    16         class Column; class Deck; class DeckIndex;
     16        class Column;
     17        class Card;
     18        class CardIndex;
    1719};
    1820
     
    7779
    7880        ~Card() {};
     81}; // class Card
     82
     83/**
     84 * An int with bounds (i is in [0, 79]). Behaves like DeckIndex (deck.h),
     85 * but slightly less intelligent since it does not need to know the
     86 * corresponding Card since all cards have same length (80 columns).
     87 * Use this class as an integer.
     88 **/
     89class CardIndex {
     90private:
     91        int i;
     92
     93public:
     94        // behaves like int, copy constructor and operator= will be created automatically
     95        CardIndex(int i = 0) : i(i) {}
     96        operator int() const { return normalized(); }
     97        int asInt() const { return normalized(); }
     98
     99        bool isValid() const { return i >= 0 && i < 80; }
     100
     101        // "normalisierung" = in Card bounds
     102        bool isNormalized() const { return i == normalized(); }
     103        int normalized() const { if(i < 0) return 0; else if(i >= 80) return 79; else return i; }
     104        void normalize() { i = normalized(); }
     105
     106        // special positions
     107        bool isFirst() const { return i == 0; }
     108        bool isLast() const { return i == 79; }
     109
     110        CardIndex& operator++() { i++; return *this; }
     111        CardIndex& operator+=(int x) { i+= x; return *this; }
    79112};
    80 
    81113
    82114/****************************************************************************
  • punch-card/punch-card-editor/src/qpunchcard/deck.cc

    r52 r53  
    4949}
    5050
     51void Deck::run(DeckUndoCommand* command, bool call_redo) {
     52        this->undo_stack.push(command);
     53        if(call_redo)
     54                command->redo();
     55}
    5156
    5257bool Deck::isValid(int i) {
  • punch-card/punch-card-editor/src/qpunchcard/deck.h

    r52 r53  
    1111        class DeckIndex;
    1212
     13        class DeckUndoCommand;
    1314        class DeckAppendCard;
    1415        class DeckModifyCard;
     
    6869        // =========== Undo Framework ==================
    6970        bool isModified() const { return !undo_stack.isClean(); }
     71        /// for advanced usage. Handle with care. Object still owned by the Deck.
     72        QUndoStack* getUndoStack() { return &undo_stack; }
     73        QAction* createRedoAction(const QString& prefix = QString()) { return undo_stack.createRedoAction(this,prefix); }
     74        QAction* createUndoAction(const QString& prefix = QString()) { return undo_stack.createUndoAction(this,prefix); }
     75
    7076
    7177        // =========== Index Handling, reading access to cards ==================
     
    8086public:
    8187        // =========== Editing (Undo captured) ==================
     88        /**
     89         * The main editing command interface. Your code creates a undo
     90         * command and executes it by calling this method. It will push
     91         * the command on the undo stack *AND* call command->redo() (by
     92         * default), if call_redo is true.
     93         * It won't return anything. If command is associated with no
     94         * or another deck, it will be changed.
     95         **/
     96        void run(DeckUndoCommand* command, bool call_redo = true);
     97
     98        // all following functions are shorthands for run() with
     99        // appropriate commands.
     100
    82101        /// Insert one new card
    83102        bool insert(DeckIndex after);
     
    93112
    94113        // Quick & dirty, no official standard
    95         inline void emitChanged(DeckIndex lower, DeckIndex upper);
     114        void emitChanged(DeckIndex lower, DeckIndex upper);
    96115
    97116signals:
     
    147166        bool isLast() const { return i == deck->count(); }
    148167
    149         const QPointer<Deck> getDeck() const { return deck; }
     168        QPointer<Deck> getDeck() const { return deck; }
    150169        void setDeck(Deck* deck) { this->deck = deck; }
    151170        bool assertDeck(Deck* fallback) { if(!deck) deck=fallback; return deck == fallback; }
     
    164183
    165184/**
     185 * The base undo command. Still abstract.
     186 **/
     187class DeckUndoCommand : public QUndoCommand {
     188public:
     189        DeckUndoCommand(Deck* deck = 0, QUndoCommand* parent = 0) : QUndoCommand(parent) {
     190                this->deck = deck;
     191        }
     192        //const QPointer<Deck> getDeck() const { return deck; }
     193protected:
     194        QPointer<Deck> deck;
     195};
     196
     197/**
    166198 * Lauter schoene UndoCommands
    167199 **/
    168 class DeckAppendCard : public QUndoCommand {
    169 public:
    170         DeckAppendCard(Deck* deck, Card* card, QUndoCommand* parent = 0) : QUndoCommand(parent) {
     200class DeckAppendCard : public DeckUndoCommand {
     201public:
     202        DeckAppendCard(Deck* deck, Card* card, QUndoCommand* parent = 0) : DeckUndoCommand(deck, parent) {
    171203                this->deck = deck;
    172204                this->card = card;
     
    180212};
    181213
    182 class DeckModifyCard : public QUndoCommand {
    183 public:
    184         DeckModifyCard(DeckIndex& position, Card new_content, QUndoCommand* parent=0)
    185                         : QUndoCommand(parent), position(position), new_content(new_content) {
     214class DeckModifyCard : public DeckUndoCommand {
     215public:
     216        DeckModifyCard(Deck* deck, DeckIndex& position, Card new_content, QUndoCommand* parent=0)
     217                        : DeckUndoCommand(deck, parent), position(position), new_content(new_content) {
     218                position.assertDeck(deck);
     219                Q_ASSERT(this->deck);
     220
    186221                // alten Inhalt irgendwie sichern
    187222                old_content = *position.getCard();
    188223                setText(position.getDeck()->tr("Changed contents of card").arg(position));
    189224        }
    190         void undo() { position.getDeck()->cards[position] = old_content; }
    191         void redo() { position.getDeck()->cards[position] = new_content; }
     225        void undo() {
     226                position.getDeck()->cards[position] = old_content;
     227                deck->emitChanged(position, position);
     228        }
     229        void redo() {
     230                position.getDeck()->cards[position] = new_content;
     231                deck->emitChanged(position, position);
     232        }
    192233private:
    193234        DeckIndex position;
  • punch-card/punch-card-editor/src/src.pro

    r52 r53  
    22
    33DESTDIR = ../bin
    4 MOC_DIR = ../bin
    5 OBJECTS_DIR = ../bin
     4MOC_DIR = ../bin/moc
     5OBJECTS_DIR = ../bin/obj
    66
    77# INCLUDEPATH += ../../protocols/documation-m200
    88
    99CONFIG += warn_off
     10
     11#CONFIG += debug
     12#CONFIG += release
    1013
    1114HEADERS += \
     
    2629
    2730SOURCES += \
     31    app/main.cc \
    2832    app/mainwindow.cc \
    2933    app/mainwindow.ui.cc \
     
    4044    text/editordock.cc \
    4145    driver/driver.cc
     46
     47include( driver/documation-m200-client.pri )
  • punch-card/punch-card-editor/src/src.pro.user

    r52 r53  
    1111 <data>
    1212  <variable>RunConfiguration0-Executable</variable>
    13   <value type="QString" >/mnt/data/Programme/Lochstreifen/punch-card/punch-card-editor/bin/app</value>
     13  <value type="QString" >/mnt/data/Programme/Lochstreifen/punch-card/punch-card-editor/bin/src</value>
    1414 </data>
    1515 <data>
    1616  <variable>RunConfiguration0-RunConfiguration.name</variable>
    17   <value type="QString" >Führe /mnt/data/Programme/Lochstreifen/punch-card/punch-card-editor/bin/app aus</value>
     17  <value type="QString" >Führe /mnt/data/Programme/Lochstreifen/punch-card/punch-card-editor/bin/src aus</value>
    1818 </data>
    1919 <data>
     
    123123    <value type="QString" >CONFIG_PROTECT_MASK=/etc/sandbox.d /etc/env.d/java/ /etc/php/cli-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/texmf/web2c /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/revdep-rebuild</value>
    124124    <value type="QString" >CVS_RSH=ssh</value>
    125     <value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-vzwgm8k2Vq,guid=150068ebec32c42f933101be4b27f534</value>
     125    <value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-9LL9VRBIRW,guid=0b12c30eaf4d6c14ba5868eb4b3298b5</value>
    126126    <value type="QString" >DCCC_PATH=/usr/lib/distcc/bin</value>
    127127    <value type="QString" >DESKTOP_SESSION=xfce</value>
     
    146146    <value type="QString" >LADSPA_PATH=/usr/lib/ladspa</value>
    147147    <value type="QString" >LANG=de_DE</value>
    148     <value type="QString" >LANGUAGE=</value>
    149148    <value type="QString" >LC_ALL=de_DE</value>
    150149    <value type="QString" >LESS=-R -M --shift 5</value>
     
    162161    <value type="QString" >QTDIR=/usr</value>
    163162    <value type="QString" >SANE_CONFIG_DIR=/etc/sane.d</value>
    164     <value type="QString" >SESSION_MANAGER=local/sveni:@/tmp/.ICE-unix/3934,unix/sveni:/tmp/.ICE-unix/3934</value>
     163    <value type="QString" >SESSION_MANAGER=local/sveni:@/tmp/.ICE-unix/3980,unix/sveni:/tmp/.ICE-unix/3980</value>
    165164    <value type="QString" >SHELL=/bin/bash</value>
    166165    <value type="QString" >SHLVL=1</value>
    167     <value type="QString" >SSH_AGENT_PID=3926</value>
    168     <value type="QString" >SSH_AUTH_SOCK=/tmp/ssh-pobSiq3925/agent.3925</value>
     166    <value type="QString" >SSH_AGENT_PID=3972</value>
     167    <value type="QString" >SSH_AUTH_SOCK=/tmp/ssh-RAyzVU3971/agent.3971</value>
    169168    <value type="QString" >USB_DEVFS_PATH=/dev/bus/usb</value>
    170169    <value type="QString" >USER=sven</value>
     
    173172    <value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value>
    174173    <value type="QString" >XDG_DATA_DIRS=/usr/local/share:/usr/kde/4.2/share:/usr/kde/3.5/share:/usr/share:/usr/share</value>
    175     <value type="QString" >XDG_SESSION_COOKIE=4ca7d15657433fffff2f84004717d7fc-1260909875.503439-977476920</value>
     174    <value type="QString" >XDG_SESSION_COOKIE=4ca7d15657433fffff2f84004717d7fc-1261607092.718129-2000615939</value>
    176175    <value type="QString" >XDM_MANAGED=method=classic</value>
    177176    <value type="QString" >_=/usr/bin/xfce4-session</value>
     
    200199    <value type="QString" >CONFIG_PROTECT_MASK=/etc/sandbox.d /etc/env.d/java/ /etc/php/cli-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/texmf/web2c /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/revdep-rebuild</value>
    201200    <value type="QString" >CVS_RSH=ssh</value>
    202     <value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-vzwgm8k2Vq,guid=150068ebec32c42f933101be4b27f534</value>
     201    <value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-9LL9VRBIRW,guid=0b12c30eaf4d6c14ba5868eb4b3298b5</value>
    203202    <value type="QString" >DCCC_PATH=/usr/lib/distcc/bin</value>
    204203    <value type="QString" >DESKTOP_SESSION=xfce</value>
     
    223222    <value type="QString" >LADSPA_PATH=/usr/lib/ladspa</value>
    224223    <value type="QString" >LANG=de_DE</value>
    225     <value type="QString" >LANGUAGE=</value>
    226224    <value type="QString" >LC_ALL=de_DE</value>
    227225    <value type="QString" >LESS=-R -M --shift 5</value>
     
    239237    <value type="QString" >QTDIR=/usr</value>
    240238    <value type="QString" >SANE_CONFIG_DIR=/etc/sane.d</value>
    241     <value type="QString" >SESSION_MANAGER=local/sveni:@/tmp/.ICE-unix/3934,unix/sveni:/tmp/.ICE-unix/3934</value>
     239    <value type="QString" >SESSION_MANAGER=local/sveni:@/tmp/.ICE-unix/3980,unix/sveni:/tmp/.ICE-unix/3980</value>
    242240    <value type="QString" >SHELL=/bin/bash</value>
    243241    <value type="QString" >SHLVL=1</value>
    244     <value type="QString" >SSH_AGENT_PID=3926</value>
    245     <value type="QString" >SSH_AUTH_SOCK=/tmp/ssh-pobSiq3925/agent.3925</value>
     242    <value type="QString" >SSH_AGENT_PID=3972</value>
     243    <value type="QString" >SSH_AUTH_SOCK=/tmp/ssh-RAyzVU3971/agent.3971</value>
    246244    <value type="QString" >USB_DEVFS_PATH=/dev/bus/usb</value>
    247245    <value type="QString" >USER=sven</value>
     
    250248    <value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value>
    251249    <value type="QString" >XDG_DATA_DIRS=/usr/local/share:/usr/kde/4.2/share:/usr/kde/3.5/share:/usr/share:/usr/share</value>
    252     <value type="QString" >XDG_SESSION_COOKIE=4ca7d15657433fffff2f84004717d7fc-1260909875.503439-977476920</value>
     250    <value type="QString" >XDG_SESSION_COOKIE=4ca7d15657433fffff2f84004717d7fc-1261607092.718129-2000615939</value>
    253251    <value type="QString" >XDM_MANAGED=method=classic</value>
    254252    <value type="QString" >_=/usr/bin/xfce4-session</value>
     
    273271    <value type="QString" >CONFIG_PROTECT_MASK=/etc/sandbox.d /etc/env.d/java/ /etc/php/cli-php5/ext-active/ /etc/php/cgi-php5/ext-active/ /etc/php/apache2-php5/ext-active/ /etc/udev/rules.d /etc/fonts/fonts.conf /etc/gconf /etc/terminfo /etc/texmf/web2c /etc/texmf/language.dat.d /etc/texmf/language.def.d /etc/texmf/updmap.d /etc/revdep-rebuild</value>
    274272    <value type="QString" >CVS_RSH=ssh</value>
    275     <value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ebkbOdFEJV,guid=24fbcd9fb1a83886c102f0364b2278cc</value>
     273    <value type="QString" >DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-9LL9VRBIRW,guid=0b12c30eaf4d6c14ba5868eb4b3298b5</value>
    276274    <value type="QString" >DCCC_PATH=/usr/lib/distcc/bin</value>
    277275    <value type="QString" >DESKTOP_SESSION=xfce</value>
     
    296294    <value type="QString" >LADSPA_PATH=/usr/lib/ladspa</value>
    297295    <value type="QString" >LANG=de_DE</value>
    298     <value type="QString" >LANGUAGE=</value>
    299296    <value type="QString" >LC_ALL=de_DE</value>
    300297    <value type="QString" >LESS=-R -M --shift 5</value>
     
    312309    <value type="QString" >QTDIR=/usr</value>
    313310    <value type="QString" >SANE_CONFIG_DIR=/etc/sane.d</value>
    314     <value type="QString" >SESSION_MANAGER=local/sveni:@/tmp/.ICE-unix/3918,unix/sveni:/tmp/.ICE-unix/3918</value>
     311    <value type="QString" >SESSION_MANAGER=local/sveni:@/tmp/.ICE-unix/3980,unix/sveni:/tmp/.ICE-unix/3980</value>
    315312    <value type="QString" >SHELL=/bin/bash</value>
    316313    <value type="QString" >SHLVL=1</value>
    317     <value type="QString" >SSH_AGENT_PID=3910</value>
    318     <value type="QString" >SSH_AUTH_SOCK=/tmp/ssh-eIpvrL3909/agent.3909</value>
     314    <value type="QString" >SSH_AGENT_PID=3972</value>
     315    <value type="QString" >SSH_AUTH_SOCK=/tmp/ssh-RAyzVU3971/agent.3971</value>
    319316    <value type="QString" >USB_DEVFS_PATH=/dev/bus/usb</value>
    320317    <value type="QString" >USER=sven</value>
     
    323320    <value type="QString" >XDG_CONFIG_DIRS=/etc/xdg</value>
    324321    <value type="QString" >XDG_DATA_DIRS=/usr/local/share:/usr/kde/4.2/share:/usr/kde/3.5/share:/usr/share:/usr/share</value>
    325     <value type="QString" >XDG_SESSION_COOKIE=4ca7d15657433fffff2f84004717d7fc-1260550347.423423-1208523191</value>
     322    <value type="QString" >XDG_SESSION_COOKIE=4ca7d15657433fffff2f84004717d7fc-1261607092.718129-2000615939</value>
    326323    <value type="QString" >XDM_MANAGED=method=classic</value>
    327324    <value type="QString" >_=/usr/bin/xfce4-session</value>
  • punch-card/punch-card-editor/src/text/editor.cc

    r52 r53  
    229229        // start translation
    230230        qDebug() << "starting translation";
    231         codec->fromAscii(text, &main->deck->at( card_index ) );
    232         qDebug("Translated successfully");
     231        Card translated;
     232        codec->fromAscii(text, &translated); //&main->deck->at( card_index ) );
     233        qDebug("Translation done. Creating undo command");
     234
     235        DeckModifyCard* command = new DeckModifyCard(main->deck, card_index, translated);
     236        command->setText(tr("Set card %1 content using codec %2 to '%3'").arg(card_index).arg("CodecName").arg(text));
     237        main->deck->run(command, true);
     238
     239        qDebug("Command executed.");
     240
    233241        // urhm... that was all the magic.
    234242        // send "you were changed" thingy! :-)
    235         main->deck->emitChanged(card_index, card_index);
     243        //main->deck->emitChanged(card_index, card_index);
     244        // no. that does the command!
    236245        return true;
    237246}
  • punch-card/punch-card-editor/src/text/editor.h

    r52 r53  
    88namespace Text {
    99        class Editor;
     10        class CharUndoCommand;
     11        class StringUndoCommand;
    1012};
    1113};
     
    1416#include "deckviewer/cardeditor.h"
    1517#include "qpunchcard/card.h"
     18#include "qpunchcard/deck.h"
    1619#include "text/editordock.h"
    1720#include "text/codec.h"
     
    7881        void translateChanges(int position, int charsRemoved, int charsAdded);
    7982
    80 }; // class
     83}; // class Editor
     84
     85/*
     86class CharUndoCommand : public DeckUndoCommand {
     87        CharUndoCommand(Deck* editor, DeckIndex& position, CardIndex column, Card old_content,
     88                        const Codec* codec, char new_char, QUndoCommand *parent = 0) :
     89                DeckUndoCommand(deck, parent), column(column), old_content(old_content),
     90                codec(codec), new_char(new_char) {
     91        }
     92
     93                old_content = *position.getCard();
     94                setText(position.getDeck()->tr("Changed contents of card").arg(position));
     95        }
     96        void undo() { position.getDeck()->cards[position] = old_content; }
     97        void redo() { position.getDeck()->cards[position] = new_content; }
     98private:
     99        DeckIndex position;
     100        Card old_content;
     101        CardIndex column;
     102        const Codec* codec;
     103        char new_char;
     104}; // class CharUndoCommand
     105*/
     106
     107/*
     108class ModifyLine : public DeckModifyCard {
     109public:
     110        ModifyLine(Deck* deck, const QString& new_text, const Codec* codec,
     111                   DeckIndex& position, QUndoCommand* parent=0) : DeckModifyCard(deck, position, Card, parent) {
     112                codec->fromAscii(codec, &new_content);
     113                position.assertDeck(deck);
     114                Q_ASSERT(this->deck);
     115
     116                // alten Inhalt irgendwie sichern
     117                old_content = *position.getCard();
     118                setText(position.getDeck()->tr("Changed contents of card").arg(position));
     119        }
     120        void undo() { position.getDeck()->cards[position] = old_content; }
     121        void redo() { position.getDeck()->cards[position] = new_content; }
     122private:
     123
     124        DeckIndex position;
     125        Card new_content;
     126        Card old_content;
     127};
     128*/
     129
    81130
    82131}; // namespace Text
  • punch-card/punch-card-editor/src/text/editordock.cc

    r52 r53  
    1010using namespace QPunchCard;
    1111
    12 Text::EditorDock::EditorDock(EditorWindow* parent) : QDockWidget(parent), main(parent) {
     12Text::EditorDock::EditorDock(App::MainWindow* parent) : QDockWidget(parent), main(parent) {
    1313        // Title grundsaetzlich angeben (wird ueberall angezeigt)
    1414        setWindowTitle(tr("Text Editor"));
Note: See TracChangeset for help on using the changeset viewer.
© 2008 - 2013 technikum29 • Sven Köppel • Some rights reserved
Powered by Trac
Expect where otherwise noted, content on this site is licensed under a Creative Commons 3.0 License