diff options
Diffstat (limited to 'superkaramba')
104 files changed, 617 insertions, 678 deletions
diff --git a/superkaramba/CMakeLists.txt b/superkaramba/CMakeLists.txt index 21dbc7e..7aaf596 100644 --- a/superkaramba/CMakeLists.txt +++ b/superkaramba/CMakeLists.txt @@ -10,6 +10,7 @@ ################################################# add_subdirectory( src ) +add_subdirectory( examples ) add_subdirectory( icons ) add_subdirectory( mimetypes ) diff --git a/superkaramba/examples/CMakeLists.txt b/superkaramba/examples/CMakeLists.txt new file mode 100644 index 0000000..0eefb51 --- /dev/null +++ b/superkaramba/examples/CMakeLists.txt @@ -0,0 +1,7 @@ +add_subdirectory( globalMouse ) + +install( + DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}/ + DESTINATION ${DATA_INSTALL_DIR}/superkaramba/examples + PATTERN CMakeLists.txt EXCLUDE +) diff --git a/superkaramba/examples/autoHide/main.py b/superkaramba/examples/autoHide/main.py index 85e2b37..0dce2e0 100644 --- a/superkaramba/examples/autoHide/main.py +++ b/superkaramba/examples/autoHide/main.py @@ -18,7 +18,6 @@ def widgetUpdated(widget): hidden = 1 karamba.moveWidget(widget, 0, -210) - #This gets called everytime our widget is clicked. #Notes: # widget = reference to our widget @@ -33,21 +32,10 @@ def widgetUpdated(widget): def widgetClicked(widget, x, y, button): pass -#This gets called everytime our widget is clicked. -#Notes -# widget = reference to our widget -# x = x position (relative to our widget) -# y = y position (relative to our widget) -# botton = button being held: -# 0 = No Mouse Button -# 1 = Left Mouse Button -# 2 = Middle Mouse Button -# 3 = Right Mouse Button, but this will never happen -# because the right mouse button brings up the -# Karamba menu. +#This gets called everytime the mouse moves on the widget area +#Warning: Don't do anything too intensive here +#You don't want to run some complex piece of code everytime the mouse moves def widgetMouseMoved(widget, x, y, button): - #Warning: Don't do anything too intensive here - #You don't want to run some complex piece of code everytime the mouse moves global hidden global counter if (hidden==1): @@ -55,8 +43,6 @@ def widgetMouseMoved(widget, x, y, button): hidden = 0 counter = 0 - - # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/bar/bar.py b/superkaramba/examples/bar/bar.py index b018fe8..2ec029d 100644 --- a/superkaramba/examples/bar/bar.py +++ b/superkaramba/examples/bar/bar.py @@ -24,9 +24,9 @@ def widgetUpdated(widget): # vertical & bitmap b = karamba.getBarVertical(widget, bars[7]) - print "getVertical: " + str(b) + print("getVertical: " + str(b)) bmp = karamba.getBarImage(widget, bars[7]) - print "getBitmap: " + str(bmp) + print("getBitmap: " + str(bmp)) b = (b+1)%2 karamba.setBarVertical(widget, bars[7], b) if(b): @@ -38,13 +38,13 @@ def widgetUpdated(widget): # size & resize size = karamba.getBarSize(widget, bars[1]) - print "getBarSize: " + str(size) + print("getBarSize: " + str(size)) size = ((b * 100) + 100, size[1]) karamba.resizeBar(widget, bars[1], size[0], size[1]) # pos & move pos = karamba.getBarPos(widget, bars[2]) - print "getBarPos: " + str(pos) + print("getBarPos: " + str(pos)) pos = (b * 200, pos[1]) karamba.moveBar(widget, bars[2], pos[0], pos[1]) @@ -56,19 +56,19 @@ def widgetUpdated(widget): # Value v = karamba.getBarValue(widget, bars[5]) - print "getBarValue: ", v + print("getBarValue: ", v) v = (v + 10) % 110 karamba.setBarValue(widget, bars[5], v) # Min Max minmax = karamba.getBarMinMax(widget, bars[6]) - print "getBarMinMax: " + str(minmax) + print("getBarMinMax: " + str(minmax)) minmax = (0, (b * 100) + 100) karamba.setBarMinMax(widget, bars[6], minmax[0], minmax[1]) # Sensor sensor = karamba.getBarSensor(widget, bars[4]) - print "getSensor: " + str(sensor) + print("getSensor: " + str(sensor)) if(b): karamba.setBarSensor(widget, bars[4], 'SENSOR=SENSOR TYPE="cpu_temp"') else: @@ -90,4 +90,4 @@ def widgetMouseMoved(widget, x, y, button): pass # This will be printed when the widget loads. -print "Loaded Bar test python extension!" +print("Loaded Bar test python extension!") diff --git a/superkaramba/examples/change_interval/interval.py b/superkaramba/examples/change_interval/interval.py index 6c3422a..6a72434 100644 --- a/superkaramba/examples/change_interval/interval.py +++ b/superkaramba/examples/change_interval/interval.py @@ -11,50 +11,53 @@ text = None #this is called when you widget is initialized def initWidget(widget): - - karamba.redrawWidget(widget) + global seq + global text + seq = 0 + text = None + karamba.redrawWidget(widget) # sequence drops down to zero and changes the time interval to 1 second. # keeps counting down thereafter... def widgetUpdated(widget): - global seq - global text + global seq + global text - seq -= 1 + seq -= 1 - if seq <= 0: - karamba.changeInterval(widget, 1000) + if seq <= 0: + karamba.changeInterval(widget, 1000) - if seq <= 0: - message = "biding-time seq:%d" % -seq - else: - message = "wiggle seq:%d" % seq + if seq <= 0: + message = "biding-time seq:%d" % -seq + else: + message = "wiggle seq:%d" % seq - # delete previous text if exists. - if text is not None: - karamba.deleteText(widget, text) + # delete previous text if exists. + if text is not None: + karamba.deleteText(widget, text) - # display new message - text = karamba.createText(widget, 0, 20, 300, 20, message) - karamba.changeTextColor(widget, text, 252,252,252) + # display new message + text = karamba.createText(widget, 0, 20, 300, 20, message) + karamba.changeTextColor(widget, text, 252,252,252) - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) # wiggle the mouse over the widget to get the sequence number increased more. # also set the refresh rate to 50ms so that the theme has to fight against # the wiggling. def widgetMouseMoved(widget, x, y, button): - global seq + global seq - if seq <= 0: - seq = 0 - karamba.changeInterval(widget, 50) + if seq <= 0: + seq = 0 + karamba.changeInterval(widget, 50) - seq += 1 - + seq += 1 + # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/taskBar/cleanbar/README b/superkaramba/examples/cleanbar/README index 2c6b146..2c6b146 100644 --- a/superkaramba/examples/taskBar/cleanbar/README +++ b/superkaramba/examples/cleanbar/README diff --git a/superkaramba/examples/taskBar/cleanbar/cleanbar.py b/superkaramba/examples/cleanbar/cleanbar.py index c0da2a2..16bd18f 100644 --- a/superkaramba/examples/taskBar/cleanbar/cleanbar.py +++ b/superkaramba/examples/cleanbar/cleanbar.py @@ -34,7 +34,7 @@ havexwi = os.system("which xwininfo") if (havexwi == 0): pass else: - print "\nCan't find xwininfo in your path." + print("\nCan't find xwininfo in your path.") fp = os.popen("xwininfo -root -stats") output = fp.read() @@ -49,8 +49,6 @@ for x in output: resY = int(param[1]) - - def drawTaskbar(widget): global taskPanels global taskText @@ -81,40 +79,41 @@ def drawTaskbar(widget): #build groups list that contains sub-lists of taskInfo sorted by group for j in range(len(taskList)): taskinfo = karamba.getTaskInfo(widget, taskList[j]) - - if knownGroups.has_key(taskinfo[2]) == 0: - groupCount = groupCount + 1 - if (taskinfo[7] == 1): - activeGroup = groupCount - knownGroups[taskinfo[2]] = 1 - thisGroup = [] - thisGroup.append(taskinfo) - groupRefs[taskinfo[2]] = len(groups) - groups.append(thisGroup) - else: - if (taskinfo[7] == 1): - activeGroup = groupRefs[taskinfo[2]] + 1 - knownGroups[taskinfo[2]] = knownGroups[taskinfo[2]] + 1 - thisGroup = groups[groupRefs[taskinfo[2]]] - thisGroup.append(taskinfo) - + + if (taskinfo[2] in knownGroups) == 0: + groupCount = groupCount + 1 + if (taskinfo[7] == 1): + activeGroup = groupCount + knownGroups[taskinfo[2]] = 1 + thisGroup = [] + thisGroup.append(taskinfo) + groupRefs[taskinfo[2]] = len(groups) + groups.append(thisGroup) + else: + if (taskinfo[7] == 1): + activeGroup = groupRefs[taskinfo[2]] + 1 + knownGroups[taskinfo[2]] = knownGroups[taskinfo[2]] + 1 + thisGroup = groups[groupRefs[taskinfo[2]]] + thisGroup.append(taskinfo) + #fill out the task bar j = 0 - for group in groups: + for group in groups: #safety check (could be more task groups than bar is long) if (j < length): - karamba.showImage(widget, taskPanels[j]) - if len(group) != 1: - karamba.changeText(widget, taskText[j], group[0][2] + " [" + str(len(group)) + "]") - else: - karamba.changeText(widget, taskText[j], (group[0][0])) - j = j + 1 + karamba.showImage(widget, taskPanels[j]) + if len(group) != 1: + karamba.changeText(widget, taskText[j], group[0][2].decode('utf-8') + ' [' + str(len(group)) + ']') + else: + karamba.changeText(widget, taskText[j], group[0][0].decode('utf-8')) + j = j + 1 if (activeGroup != 0): - karamba.changeTextShadow(widget, taskText[activeGroup - 1], 1) - karamba.changeTextColor(widget, taskText[activeGroup - 1], 239, 220, 11) + karamba.changeTextShadow(widget, taskText[activeGroup - 1], 1) + karamba.changeTextColor(widget, taskText[activeGroup - 1], 239, 220, 11) - + karamba.moveWidget(widget, 0, resY - 32) + karamba.resizeWidget(widget, resX, resY) karamba.redrawWidget(widget) #this is called when your widget is initialized @@ -126,7 +125,7 @@ def initWidget(widget): global timeText karamba.createImage(widget, resX - 149, 0, "pics/rightend_new.png") - numOfTasks = (resX - 198 - 149)/121 + numOfTasks = (resX - 198 - 149) // 121 timeText = karamba.createText(widget, resX - 149 + 54, 10, 140, 20, "time") karamba.changeTextColor(widget, timeText, 0,0,0) @@ -143,13 +142,13 @@ def initWidget(widget): # called to indicate that a new task is currently started def startupAdded(widget, startup): - pass + pass # called whenever a startup is removed. Which either means the task is # successfully started (and taskAdded will be called), or the task could # not be started for some reason. def startupRemoved(widget, startup): - pass + pass # called whenever a new task has been started def taskAdded(widget, task): @@ -190,78 +189,75 @@ def widgetClicked(widget, x, y, button): global taskMenu global taskMenuLookup - taskSelected = (x-198)/121 + taskSelected = (x-198) // 121 ## Make sure its a valid task if (0 <= taskSelected < numOfTasks): taskList = karamba.getTaskList(widget) #free last menu - karamba.deleteMenu(widget, taskMenu) - - #create new menu - taskMenu = karamba.createMenu(widget) - taskMenuLoopup = {} - - length = len(taskList) - if (numOfTasks < length): - length = numOfTasks - - - knownGroups = {} - groups = [] - groupRefs = {} - for j in range(len(taskList)): - taskinfo = karamba.getTaskInfo(widget, taskList[j]) - - if knownGroups.has_key(taskinfo[2]) == 0: - knownGroups[taskinfo[2]] = 1 - thisGroup = [] - thisGroup.append(taskinfo) - groupRefs[taskinfo[2]] = len(groups) - groups.append(thisGroup) - else: - knownGroups[taskinfo[2]] = knownGroups[taskinfo[2]] + 1 - thisGroup = groups[groupRefs[taskinfo[2]]] - thisGroup.append(taskinfo) - - if taskSelected < len(groups): - taskGroup = groups[taskSelected] - - - if len(taskGroup) == 1: - #only one task in group - just switch to that app - ## perform the task action (see Task API for list of numbers) - karamba.performTaskAction(widget, taskGroup[0][8], 8) - - else: - #more than one task in this group, make a popup - for task in taskGroup: - #if it's minimized, put []'s around name - if task[5] == 1: - item = karamba.addMenuItem(widget, taskMenu, "[ " + task[0] + " ]", task[2]) - else: - item = karamba.addMenuItem(widget, taskMenu, task[0], task[2]) - #save the taskInfo item for later use - #so we will know info for the task that - #will be clicked in the callback - taskMenuLookup[item] = task - - numOfItems = len(taskGroup) - karamba.popupMenu(widget, taskMenu, 198 + (121*taskSelected), -1 * (numOfItems * 26)) - - + karamba.deleteMenu(widget, taskMenu) + + #create new menu + taskMenu = karamba.createMenu(widget) + taskMenuLoopup = {} + + length = len(taskList) + if (numOfTasks < length): + length = numOfTasks + + + knownGroups = {} + groups = [] + groupRefs = {} + for j in range(len(taskList)): + taskinfo = karamba.getTaskInfo(widget, taskList[j]) + + if (taskinfo[2] in knownGroups) == 0: + knownGroups[taskinfo[2]] = 1 + thisGroup = [] + thisGroup.append(taskinfo) + groupRefs[taskinfo[2]] = len(groups) + groups.append(thisGroup) + else: + knownGroups[taskinfo[2]] = knownGroups[taskinfo[2]] + 1 + thisGroup = groups[groupRefs[taskinfo[2]]] + thisGroup.append(taskinfo) + + if taskSelected < len(groups): + taskGroup = groups[taskSelected] + + if len(taskGroup) == 1: + #only one task in group - just switch to that app + ## perform the task action (see Task API for list of numbers) + karamba.performTaskAction(widget, taskGroup[0][8], 8) + else: + #more than one task in this group, make a popup + for task in taskGroup: + #if it's minimized, put []'s around name + if task[5] == 1: + item = karamba.addMenuItem(widget, taskMenu, "[ " + task[0].decode('utf-8') + " ]", task[2].decode('utf-8')) + else: + item = karamba.addMenuItem(widget, taskMenu, task[0].decode('utf-8'), task[2].decode('utf-8')) + #save the taskInfo item for later use + #so we will know info for the task that + #will be clicked in the callback + taskMenuLookup[item] = task + + numOfItems = len(taskGroup) + karamba.popupMenu(widget, taskMenu, 198 + (121*taskSelected), -1 * (numOfItems * 26)) if (taskSelected == numOfTasks): karamba.toggleShowDesktop(widget) + #This gets called when an item is clicked in a popup menu you have created. # menu = a reference to the menu # id = the number of the item that was clicked. def menuItemClicked(widget, menu, id): - global taskMenuLookup + global taskMenuLookup - taskinfo = taskMenuLookup[id] - karamba.performTaskAction(widget, taskinfo[8], 8) - + taskinfo = taskMenuLookup[id] + karamba.performTaskAction(widget, taskinfo[8], 8) + diff --git a/superkaramba/examples/taskBar/cleanbar/cleanbar.theme b/superkaramba/examples/cleanbar/cleanbar.theme index 0dc6faa..0dc6faa 100644 --- a/superkaramba/examples/taskBar/cleanbar/cleanbar.theme +++ b/superkaramba/examples/cleanbar/cleanbar.theme diff --git a/superkaramba/examples/taskBar/cleanbar/pics/bar2.png b/superkaramba/examples/cleanbar/pics/bar2.png Binary files differindex aa1c4f5..aa1c4f5 100644 --- a/superkaramba/examples/taskBar/cleanbar/pics/bar2.png +++ b/superkaramba/examples/cleanbar/pics/bar2.png diff --git a/superkaramba/examples/taskBar/cleanbar/pics/rightend.png b/superkaramba/examples/cleanbar/pics/rightend.png Binary files differindex 7f852bf..7f852bf 100644 --- a/superkaramba/examples/taskBar/cleanbar/pics/rightend.png +++ b/superkaramba/examples/cleanbar/pics/rightend.png diff --git a/superkaramba/examples/taskBar/cleanbar/pics/rightend_new.png b/superkaramba/examples/cleanbar/pics/rightend_new.png Binary files differindex 45adc7b..45adc7b 100644 --- a/superkaramba/examples/taskBar/cleanbar/pics/rightend_new.png +++ b/superkaramba/examples/cleanbar/pics/rightend_new.png diff --git a/superkaramba/examples/taskBar/cleanbar/pics/slickbar.png b/superkaramba/examples/cleanbar/pics/slickbar.png Binary files differindex 57f0830..57f0830 100644 --- a/superkaramba/examples/taskBar/cleanbar/pics/slickbar.png +++ b/superkaramba/examples/cleanbar/pics/slickbar.png diff --git a/superkaramba/examples/taskBar/cleanbar/pics/startup.png b/superkaramba/examples/cleanbar/pics/startup.png Binary files differindex a5a99f1..a5a99f1 100644 --- a/superkaramba/examples/taskBar/cleanbar/pics/startup.png +++ b/superkaramba/examples/cleanbar/pics/startup.png diff --git a/superkaramba/examples/taskBar/cleanbar/pics/task.png b/superkaramba/examples/cleanbar/pics/task.png Binary files differindex f9bc4eb..f9bc4eb 100644 --- a/superkaramba/examples/taskBar/cleanbar/pics/task.png +++ b/superkaramba/examples/cleanbar/pics/task.png diff --git a/superkaramba/examples/taskBar/cleanbar/pics/task_new.png b/superkaramba/examples/cleanbar/pics/task_new.png Binary files differindex 1ac95c8..1ac95c8 100644 --- a/superkaramba/examples/taskBar/cleanbar/pics/task_new.png +++ b/superkaramba/examples/cleanbar/pics/task_new.png diff --git a/superkaramba/examples/control_management/mgmt.py b/superkaramba/examples/control_management/mgmt.py index eae98c2..2e43634 100644 --- a/superkaramba/examples/control_management/mgmt.py +++ b/superkaramba/examples/control_management/mgmt.py @@ -10,40 +10,40 @@ mgmt_txt = None #this is called when you widget is initialized def initWidget(widget): - global do_nothing_txt - global do_something_txt + global do_nothing_txt + global do_something_txt - # display new message - do_nothing_txt = karamba.createText(widget, 0, 00, 300, 20, - "Right mouse click me!") - karamba.changeTextColor(widget, do_nothing_txt, 252,252,252) - mgmt_txt = karamba.createText(widget, 0, 20, 300, 20, - "Righ mouse click me too!") - karamba.changeTextColor(widget, mgmt_txt, 252,252,252) + # display new message + do_nothing_txt = karamba.createText(widget, 0, 00, 300, 20, + "Right mouse click me!") + karamba.changeTextColor(widget, do_nothing_txt, 252,252,252) + mgmt_txt = karamba.createText(widget, 0, 20, 300, 20, + "Righ mouse click me too!") + karamba.changeTextColor(widget, mgmt_txt, 252,252,252) - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) - karamba.setWantRightButton(widget, 1) + karamba.setWantRightButton(widget, 1) def widgetUpdated(widget): - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) def widgetClicked(widget, x, y, button): - global do_nothing_txt + global do_nothing_txt - if y < 20: - if do_nothing_txt is not None: - karamba.deleteText(widget, do_nothing_txt) - do_nothing_txt = karamba.createText(widget, - 0, 0, 300, 20, "I don't do anything when clicking here.") - karamba.changeTextColor(widget, do_nothing_txt, - 255,200,200) - karamba.redrawWidget(widget) - return + if y < 20: + if do_nothing_txt is not None: + karamba.deleteText(widget, do_nothing_txt) + do_nothing_txt = karamba.createText(widget, + 0, 0, 300, 20, "I don't do anything when clicking here.") + karamba.changeTextColor(widget, do_nothing_txt, + 255,200,200) + karamba.redrawWidget(widget) + return - karamba.managementPopup(widget) - + karamba.managementPopup(widget) + # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/disableRightClickMenu/disable_menu.py b/superkaramba/examples/disableRightClickMenu/disable_menu.py index 6c524dd..e903d26 100644 --- a/superkaramba/examples/disableRightClickMenu/disable_menu.py +++ b/superkaramba/examples/disableRightClickMenu/disable_menu.py @@ -45,7 +45,7 @@ def widgetClicked(widget, x, y, button): if text2: karamba.deleteText(widget,text2) text2 = karamba.createText(widget,5,70,400,20,newText) - print newText + print(newText) elif not clicked and button == 1: clicked = True karamba.setWantRightButton(widget, True) @@ -53,9 +53,9 @@ def widgetClicked(widget, x, y, button): if text2: karamba.deleteText(widget,text2) text2 = karamba.createText(widget,5,70,400,20,newText) - print newText + print(newText) if button == 3: - print "Clicking the right mouse button is recognized now." + print("Clicking the right mouse button is recognized now.") karamba.redrawWidget(widget) #This gets called everytime our widget is clicked. @@ -173,4 +173,4 @@ def keyPressed(widget, meter, char): pass # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/globalMouse/CMakeLists.txt b/superkaramba/examples/globalMouse/CMakeLists.txt new file mode 100644 index 0000000..499a26b --- /dev/null +++ b/superkaramba/examples/globalMouse/CMakeLists.txt @@ -0,0 +1,11 @@ +##### xcursor.so ####################### + +include_directories( + ${PYTHON_INCLUDE_DIRS} +) + +tde_add_library( xcursor MODULE NO_LIBTOOL_FILE + SOURCES extension/xcursor.c + LINK ${PYTHON_LIBRARIES} X11 + DESTINATION ${DATA_INSTALL_DIR}/superkaramba/examples/globalMouse +) diff --git a/superkaramba/examples/globalMouse/README b/superkaramba/examples/globalMouse/README index 758ce4b..7d2abc3 100644 --- a/superkaramba/examples/globalMouse/README +++ b/superkaramba/examples/globalMouse/README @@ -19,7 +19,7 @@ INSTALLATION: named build. This file needs to be copied in the same directory as the eyes.theme and eyes.py file. - A precompiled xcursor.so file is included (Compiled on Mandrake 9.1). + A precompiled xcursor.so file is included. CHANGES: * Moving the theme now works as it should. diff --git a/superkaramba/examples/globalMouse/extension/setup.py b/superkaramba/examples/globalMouse/extension/setup.py index f33f8a6..2003334 100644 --- a/superkaramba/examples/globalMouse/extension/setup.py +++ b/superkaramba/examples/globalMouse/extension/setup.py @@ -1,12 +1,14 @@ from distutils.core import setup, Extension -module1 = Extension('xcursor', - include_dirs = ['/usr/X11R6/include'], - libraries = ['X11'], - library_dirs = ['/usr/X11R6/lib'], - sources = ['xcursor.c']) +def main(): + setup(name = 'XMouseCursor', + version = '1.0', + description = 'Determines the position of the X mouse cursor', + ext_modules = [Extension('xcursor', + include_dirs = ['/usr/X11R6/include'], + libraries = ['X11'], + library_dirs = ['/usr/X11R6/lib'], + sources = ['xcursor.c'])]) -setup (name = 'XMouseCursor', - version = '1.0', - description = 'Determines the position of the X mouse cursor', - ext_modules = [module1]) +if __name__ == "__main__": + main() diff --git a/superkaramba/examples/globalMouse/extension/xcursor.c b/superkaramba/examples/globalMouse/extension/xcursor.c index 8dad240..fbe80fa 100644 --- a/superkaramba/examples/globalMouse/extension/xcursor.c +++ b/superkaramba/examples/globalMouse/extension/xcursor.c @@ -26,6 +26,7 @@ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ****************************************************************************/ +#define PY_SSIZE_T_CLEAN #include <Python.h> #include <X11/Xlib.h> @@ -96,9 +97,16 @@ static PyMethodDef xcursorMethods[] = {NULL, NULL, 0, NULL} /* Sentinel */ }; -void initxcursor(void) +static struct PyModuleDef xcursordef = { - (void) Py_InitModule("xcursor", xcursorMethods); -} - + PyModuleDef_HEAD_INIT, + "xcursor", + NULL, + -1, + xcursorMethods +}; +PyMODINIT_FUNC PyInit_xcursor(void) +{ + return PyModule_Create(&xcursordef); +} diff --git a/superkaramba/examples/globalMouse/eyes.py b/superkaramba/examples/globalMouse/eyes.py index b95f86d..f6f3804 100644 --- a/superkaramba/examples/globalMouse/eyes.py +++ b/superkaramba/examples/globalMouse/eyes.py @@ -38,117 +38,122 @@ lp_width, lp_height = 11, 17 rp_width, rp_height = 11, 17 def pupille(mouse_x, mouse_y, eye_center_x, eye_center_y, eye_a, eye_b, widget_x, widget_y): - x = mouse_x - eye_center_x - widget_x - y = mouse_y - eye_center_y - widget_y - #print x, y + x = mouse_x - eye_center_x - widget_x + y = mouse_y - eye_center_y - widget_y + #print(x, y) - r = math.sqrt(x * x + y * y) - phi = math.atan2(y, x) - #print phi * math.pi + r = math.sqrt(x * x + y * y) + phi = math.atan2(y, x) + #print(phi * math.pi) - eye_x = eye_a * math.cos(phi) - eye_y = eye_b * math.sin(phi) - - eye_r = math.sqrt(eye_x * eye_x + eye_y * eye_y) + eye_x = eye_a * math.cos(phi) + eye_y = eye_b * math.sin(phi) + + eye_r = math.sqrt(eye_x * eye_x + eye_y * eye_y) - if eye_r < r: - return int(eye_x + eye_center_x), int(eye_y + eye_center_y) - - return int(x + eye_center_x), int(y + eye_center_y) + if eye_r < r: + return int(eye_x + eye_center_x), int(eye_y + eye_center_y) + + return int(x + eye_center_x), int(y + eye_center_y) - + #this is called when you widget is initialized def initWidget(widget): - pass + global init + global linkePupille + global rechtePupille + init = 0 + linkePupille = "" + rechtePupille = "" #this is called everytime your widget is updated #the update inverval is specified in the .theme file def widgetUpdated(widget): - global init - global linkePupille - global rechtePupille - - global w_width - global w_height + global init + global linkePupille + global rechtePupille + + global w_width + global w_height - global w_x - global w_y + global w_x + global w_y - global lx - global ly - global la - global lb + global lx + global ly + global la + global lb - global lp_width - global lp_height + global lp_width + global lp_height - global rx - global ry - global ra - global rb + global rx + global ry + global ra + global rb - global rp_width - global rp_height + global rp_width + global rp_height - global x_old - global y_old + global x_old + global y_old - if init == 0: - theme_path = karamba.getThemePath(widget) + "/" - - # read widget coordinates from eyes.theme - # f = open(theme_path + "eyes.theme") + if init == 0: + theme_path = karamba.getThemePath(widget) + "/" + + # read widget coordinates from eyes.theme + # f = open(theme_path + "eyes.theme") - # karamba_line = "" - #while re.compile('KARAMBA').search(karamba_line) == None: - # karamba_line = f.readline() + # karamba_line = "" + #while re.compile('KARAMBA').search(karamba_line) == None: + # karamba_line = f.readline() - #w_x = int(re.compile('X=([0-9]+)').search(karamba_line).group(1)) - #w_y = int(re.compile('Y=([0-9]+)').search(karamba_line).group(1)) + #w_x = int(re.compile('X=([0-9]+)').search(karamba_line).group(1)) + #w_y = int(re.compile('Y=([0-9]+)').search(karamba_line).group(1)) - #f.close() + #f.close() - #karamba.createWidgetMask(widget, theme_path + "pics/mask.png") + #karamba.createWidgetMask(widget, theme_path + "pics/mask.png") - linkePupille = karamba.createImage(widget, 15, 30, theme_path + "pics/pupille.png") - rechtePupille = karamba.createImage(widget, 100, 30, theme_path + "pics/pupille.png") - init = 1 + linkePupille = karamba.createImage(widget, 15, 30, theme_path + "pics/pupille.png") + rechtePupille = karamba.createImage(widget, 100, 30, theme_path + "pics/pupille.png") + init = 1 - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) - # query mouse-cursor position - x, y = xcursor.position() - - #fp = os.popen("./xpos") - #output = fp.read() - #x, y = output.split() - - #print x, y + # query mouse-cursor position + x, y = xcursor.position() + + #fp = os.popen("./xpos") + #output = fp.read() + #x, y = output.split() + + #print(x, y) - if x != x_old or y != y_old: - x_old, y_old = x, y - # Get Widget Position - w_x, w_y = karamba.getWidgetPosition(widget) + if x != x_old or y != y_old: + x_old, y_old = x, y + # Get Widget Position + w_x, w_y = karamba.getWidgetPosition(widget) - # Calc left pupille - xp, yp = pupille (int(x), int(y), lx, ly, la, lb, w_x, w_y) + # Calc left pupille + xp, yp = pupille (int(x), int(y), lx, ly, la, lb, w_x, w_y) - xp = xp - lp_width / 2 - yp = yp - lp_height / 2 - #print xp, yp + xp = xp - lp_width // 2 + yp = yp - lp_height // 2 + #print(xp, yp) - karamba.moveImage(widget, linkePupille, xp, yp) + karamba.moveImage(widget, linkePupille, xp, yp) - # Calc right pupille - xp, yp = pupille (int(x), int(y), rx, ry, ra, rb, w_x, w_y) + # Calc right pupille + xp, yp = pupille (int(x), int(y), rx, ry, ra, rb, w_x, w_y) - xp = xp - rp_width / 2 - yp = yp - rp_height / 2 - #print xp, yp + xp = xp - rp_width // 2 + yp = yp - rp_height // 2 + #print(xp, yp) - karamba.moveImage(widget, rechtePupille, xp, yp) + karamba.moveImage(widget, rechtePupille, xp, yp) - karamba.redrawWidget(widget) + karamba.redrawWidget(widget) #This gets called everytime our widget is clicked. #Notes: @@ -180,13 +185,13 @@ def widgetClicked(widget, x, y, button): def widgetMouseMoved(widget, x, y, button): #Warning: Don't do anything too intensive here #You don't want to run some complex piece of code everytime the mouse moves - pass - #global linkePupille + pass + #global linkePupille - #karamba.moveImage(widget, linkePupille, x, y) - #karamba.redrawWidget(widget) + #karamba.moveImage(widget, linkePupille, x, y) + #karamba.redrawWidget(widget) # This will be printed when the widget loads. -print "Loaded Karamba Eyes" +print("Loaded Karamba Eyes") diff --git a/superkaramba/examples/globalMouse/xcursor.so b/superkaramba/examples/globalMouse/xcursor.so Binary files differdeleted file mode 100644 index 1ff08d5..0000000 --- a/superkaramba/examples/globalMouse/xcursor.so +++ /dev/null diff --git a/superkaramba/examples/graph/graph.py b/superkaramba/examples/graph/graph.py index 5798612..56beab1 100644 --- a/superkaramba/examples/graph/graph.py +++ b/superkaramba/examples/graph/graph.py @@ -28,20 +28,20 @@ def widgetUpdated(widget): if(graphs[0]): karamba.deleteGraph(widget, graphs[0]) graphs[0] = 0 - print "Deleted graph." + print("Deleted graph.") else: graphs[0] = karamba.createGraph(widget, 0, 20, 400, 30, 400) - print "Created graph: " + str(graphs[0]) + print("Created graph: " + str(graphs[0])) # size & resize size = karamba.getGraphSize(widget, graphs[1]) - print "getGraphSize: " + str(size) + print("getGraphSize: " + str(size)) size = ((b * 200) + 200, size[1]) karamba.resizeGraph(widget, graphs[1], size[0], size[1]) # pos & move pos = karamba.getGraphPos(widget, graphs[2]) - print "getGraphPos: " + str(pos) + print("getGraphPos: " + str(pos)) pos = (b * 200, pos[1]) karamba.moveGraph(widget, graphs[2], pos[0], pos[1]) @@ -53,7 +53,7 @@ def widgetUpdated(widget): # Sensor sensor = karamba.getGraphSensor(widget, graphs[4]) - print "getSensor: " + str(sensor) + print("getSensor: " + str(sensor)) if(b): karamba.setGraphSensor(widget, graphs[4], 'SENSOR=NETWORK FORMAT="%in"') else: @@ -61,19 +61,19 @@ def widgetUpdated(widget): # Min Max minmax = karamba.getGraphMinMax(widget, graphs[5]) - print "getGraphMinMax: " + str(minmax) + print("getGraphMinMax: " + str(minmax)) minmax = (0, (b * 25) + 25) karamba.setGraphMinMax(widget, graphs[5], minmax[0], minmax[1]) # Value v = karamba.getGraphValue(widget, graphs[6]) - print "getGraphValue: ", v + print("getGraphValue: ", v) v = (v + 1) % 30 karamba.setGraphValue(widget, graphs[6], v) # Color c = karamba.getGraphColor(widget, graphs[7]) - print "getGraphColor: ", c + print("getGraphColor: ", c) r = (c[0] + 10) % 255 g = (c[1] + 10) % 255 bl = (c[2] + 10) % 255 @@ -86,4 +86,4 @@ def widgetMouseMoved(widget, x, y, button): pass # This will be printed when the widget loads. -print "Loaded Graph test python extension!" +print("Loaded Graph test python extension!") diff --git a/superkaramba/examples/image/image.py b/superkaramba/examples/image/image.py index 97656eb..54f2106 100644 --- a/superkaramba/examples/image/image.py +++ b/superkaramba/examples/image/image.py @@ -44,22 +44,22 @@ def widgetUpdated(widget): # size & resize size = karamba.getImageSize(widget, images[1]) - print "getImageSize: " + str(size) - print "getImageWidth: " + str(karamba.getImageWidth(widget, images[1])) - print "getImageHeight: " + str(karamba.getImageHeight(widget, images[1])) + print("getImageSize: " + str(size)) + print("getImageWidth: " + str(karamba.getImageWidth(widget, images[1]))) + print("getImageHeight: " + str(karamba.getImageHeight(widget, images[1]))) # Auto size #size = ((b * 200) + 200, size[1]) #karamba.resizeImage(widget, images[1], size[0], size[1]) # pos & move pos = karamba.getImagePos(widget, images[2]) - print "getImagePos: " + str(pos) + print("getImagePos: " + str(pos)) pos = (b * 200, pos[1]) karamba.moveImage(widget, images[2], pos[0], pos[1]) # Sensor sensor = karamba.getImageSensor(widget, images[3]) - print "getSensor: " + str(sensor) + print("getSensor: " + str(sensor)) if(b): karamba.setImageSensor(widget, images[3], 'SENSOR=PROGRAM PROGRAM="/tmp/test1.sh"') else: @@ -67,7 +67,7 @@ def widgetUpdated(widget): # Value v = karamba.getImagePath(widget, images[4]) - print "getImagePath: ", v + print("getImagePath: ", v) if(b): v = 'flag.png' else: @@ -118,4 +118,4 @@ def widgetMouseMoved(widget, x, y, button): pass # This will be printed when the widget loads. -print "Loaded Image test python extension!" +print("Loaded Image test python extension!") diff --git a/superkaramba/examples/input_api/input_api.py b/superkaramba/examples/input_api/input_api.py index 59dc9ba..0a9725f 100644 --- a/superkaramba/examples/input_api/input_api.py +++ b/superkaramba/examples/input_api/input_api.py @@ -182,4 +182,4 @@ def keyPressed(widget, meter, char): pass # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/input_example/input_example.py b/superkaramba/examples/input_example/input_example.py index c0145c9..62a369f 100644 --- a/superkaramba/examples/input_example/input_example.py +++ b/superkaramba/examples/input_example/input_example.py @@ -153,7 +153,7 @@ def wallpaperChanged(widget, desktop): def keyPressed(widget, meter, char): global input, output if meter == input: - print "keyPressed: key= '", char, "'" + print("keyPressed: key= '", char, "'") text = karamba.getInputBoxValue(widget, input) karamba.changeText(widget, output, "Searched: " + text) try: @@ -161,9 +161,9 @@ def keyPressed(widget, meter, char): url = "konqueror leo:" + text os.system(url + "&") except TypeError: - print "There was a type error" + print("There was a type error") karamba.redrawWidget(widget) # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/mouseDrag/karmix/images/bar.png b/superkaramba/examples/mouseDrag/images/bar.png Binary files differindex 07ae19d..07ae19d 100644 --- a/superkaramba/examples/mouseDrag/karmix/images/bar.png +++ b/superkaramba/examples/mouseDrag/images/bar.png diff --git a/superkaramba/examples/mouseDrag/karmix/images/bg.png b/superkaramba/examples/mouseDrag/images/bg.png Binary files differindex 6ac12bc..6ac12bc 100644 --- a/superkaramba/examples/mouseDrag/karmix/images/bg.png +++ b/superkaramba/examples/mouseDrag/images/bg.png diff --git a/superkaramba/examples/mouseDrag/karmix/karmix.py b/superkaramba/examples/mouseDrag/karmix.py index 225eefb..bd167db 100644 --- a/superkaramba/examples/mouseDrag/karmix/karmix.py +++ b/superkaramba/examples/mouseDrag/karmix.py @@ -186,5 +186,5 @@ def activeTaskChanged(widget, task): pass # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/mouseDrag/karmix/karmix.theme b/superkaramba/examples/mouseDrag/karmix.theme index 3844663..3844663 100644 --- a/superkaramba/examples/mouseDrag/karmix/karmix.theme +++ b/superkaramba/examples/mouseDrag/karmix.theme diff --git a/superkaramba/examples/mouseDrop/mousedrop.py b/superkaramba/examples/mouseDrop/mousedrop.py index 521f0ee..b83c1df 100644 --- a/superkaramba/examples/mouseDrop/mousedrop.py +++ b/superkaramba/examples/mouseDrop/mousedrop.py @@ -134,5 +134,5 @@ def activeTaskChanged(widget, task): pass # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/openCloseTheme/1.py b/superkaramba/examples/openCloseTheme/1.py index 26281aa..fa659e0 100644 --- a/superkaramba/examples/openCloseTheme/1.py +++ b/superkaramba/examples/openCloseTheme/1.py @@ -1,7 +1,7 @@ import dcop import dcopext import karamba -from qt import QString, QCString +from qt import TQString, QCString def closeTheme(theme): dc = dcop.DCOPClient() diff --git a/superkaramba/examples/popupMenu/popupMenu.py b/superkaramba/examples/popupMenu/popupMenu.py index 8df5aef..39010f7 100644 --- a/superkaramba/examples/popupMenu/popupMenu.py +++ b/superkaramba/examples/popupMenu/popupMenu.py @@ -20,21 +20,21 @@ def initWidget(widget): global id5 menu1 = karamba.createMenu(widget) - print "menu 1 created!" + print("menu 1 created!") menu2 = karamba.createMenu(widget) - print "menu 2 created!" + print("menu 2 created!") id1 = karamba.addMenuItem(widget, menu1, "menu 1 first item", "kword") - print "item 1 entered in menu 1" + print("item 1 entered in menu 1") id2 = karamba.addMenuItem(widget, menu1, "menu 1 second item", "kate") - print "item 2 entered in menu 1" + print("item 2 entered in menu 1") id3 = karamba.addMenuItem(widget, menu2, "menu 2 first item", "kword") - print "item 1 entered in menu 2" + print("item 1 entered in menu 2") id4 = karamba.addMenuItem(widget, menu2, "menu 2 second item", "kate") - print "item 2 entered in menu 2" + print("item 2 entered in menu 2") id5 = karamba.addMenuItem(widget, menu2, "menu 2 third item", "/opt/kde/share/icons/kdeclassic/16x16/apps/kicker.png") - print "item 3 entered in menu 2" + print("item 3 entered in menu 2") @@ -95,23 +95,23 @@ def menuItemClicked(widget, menu, id): if (menu == menu1): if(id == id1): - print "item 1 in menu 1 clicked." + print("item 1 in menu 1 clicked.") elif(id == id2): - print "item 2 in menu 1 clicked, removing item 2 in menu 2" + print("item 2 in menu 1 clicked, removing item 2 in menu 2") karamba.removeMenuItem(widget, menu2, id4) elif (menu == menu2): if(id == id3): - print "item 1 in menu 2 clicked." + print("item 1 in menu 2 clicked.") elif(id == id4): - print "item 2 in menu 2 clicked, deleting menu 1 (if menu1 still exists...)" + print("item 2 in menu 2 clicked, deleting menu 1 (if menu1 still exists...)") karamba.deleteMenu(widget, menu1) elif(id == id5): - print "item 3 in menu 2 clicked, removing item 2 in menu 1 (if menu1 still exists...)" + print("item 3 in menu 2 clicked, removing item 2 in menu 1 (if menu1 still exists...)") karamba.removeMenuItem(widget, menu1, id2) # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/richtext/richtext.py b/superkaramba/examples/richtext/richtext.py index 518aa65..6da4080 100644 --- a/superkaramba/examples/richtext/richtext.py +++ b/superkaramba/examples/richtext/richtext.py @@ -30,7 +30,7 @@ is used to encode the formatting commands.</p> <p><font size=+2>Some features:</font> <ul> <li>Numbered and unnumbered lists</li> -<li>Inline Images <img src=\"""" + karamba.getThemePath(widget) + u"""info.png\"</li> +<li>Inline Images <img src=\"""" + karamba.getThemePath(widget) + """info.png\"</li> <li>Various <font color="red">different</font><font color="blue"> text</font><font color="green"> colours</font></li> <li>Hyperlinks: <a href="kfmclient openURL http://netdragon.sourceforge.net"> Superkaramba Homepage</a></li> <li>Links can also <a href="#trigger">trigger</a> actions in the script</li> @@ -53,7 +53,7 @@ http://doc.trolltech.com/3.0/qstylesheet.html</a>. karamba.moveRichText(widget, richtext, 10, 10) - print "richText Size = ", karamba.getRichTextSize(widget, richtext) + print("richText Size = ", karamba.getRichTextSize(widget, richtext)) karamba.setRichTextWidth(widget, richtext, 345) @@ -104,7 +104,7 @@ def meterClicked(widget, meter, button): global penguin_hidden global richtext - print "Meter clicked", meter + print("Meter clicked", meter) if meter == "trigger": if penguin_hidden: karamba.showImage(widget, penguin) @@ -133,4 +133,4 @@ def widgetMouseMoved(widget, x, y, button): pass # This will be printed when the widget loads. -print "Loaded Karamba Unicode Test" +print("Loaded Karamba Unicode Test") diff --git a/superkaramba/examples/richtext/rtext.py b/superkaramba/examples/richtext/rtext.py index 68c800a..7d30776 100644 --- a/superkaramba/examples/richtext/rtext.py +++ b/superkaramba/examples/richtext/rtext.py @@ -38,19 +38,19 @@ def widgetUpdated(widget): karamba.moveRichText(widget, texts[0], 0, 20) karamba.resizeRichText(widget, texts[0], 200, 20) pos = karamba.getRichTextPos(widget, texts[0]) - print "--getRichTextPos: " + str(pos) + print("--getRichTextPos: " + str(pos)) size = karamba.getRichTextSize(widget, texts[0]) - print "--getRichTextSize: " + str(size) + print("--getRichTextSize: " + str(size)) # size & resize size = karamba.getRichTextSize(widget, texts[1]) - print "getRichTextSize: " + str(size) + print("getRichTextSize: " + str(size)) size = ((b * 200) + 200, size[1]) karamba.resizeRichText(widget, texts[1], size[0], size[1]) # pos & move pos = karamba.getRichTextPos(widget, texts[2]) - print "getRichTextPos: " + str(pos) + print("getRichTextPos: " + str(pos)) pos = (b * 200, pos[1]) karamba.moveRichText(widget, texts[2], pos[0], pos[1]) @@ -62,7 +62,7 @@ def widgetUpdated(widget): # Sensor sensor = karamba.getRichTextSensor(widget, texts[4]) - print "getSensor: " + str(sensor) + print("getSensor: " + str(sensor)) if(b): karamba.setRichTextSensor(widget, texts[4], 'SENSOR=SENSOR TYPE="cpu_temp"') else: @@ -70,19 +70,19 @@ def widgetUpdated(widget): # Value v = karamba.getRichTextValue(widget, texts[5]) - print "getRichTextValue: ", v - v += '.' + print("getRichTextValue: ", v) + v += '.'.encode('utf-8') karamba.changeRichText(widget, texts[5], v) # Font size v = karamba.getRichTextFontSize(widget, texts[7]) - print "getRichTextFontSize: ", v + print("getRichTextFontSize: ", v) v = 10 + ((v-10)+1)%10; karamba.changeRichTextSize(widget, texts[7], v) # RichText Font v = karamba.getRichTextFont(widget, texts[9]) - print "getRichTextFont: ", v + print("getRichTextFont: ", v) if(b): v = 'Bitstream Vera Sans' else: @@ -96,4 +96,4 @@ def widgetMouseMoved(widget, x, y, button): pass # This will be printed when the widget loads. -print "Loaded RichText test python extension!" +print("Loaded RichText test python extension!") diff --git a/superkaramba/examples/service_group/service_group.py b/superkaramba/examples/service_group/service_group.py index 276b9c8..a56835e 100644 --- a/superkaramba/examples/service_group/service_group.py +++ b/superkaramba/examples/service_group/service_group.py @@ -16,23 +16,25 @@ import karamba # simple function to display def create_text(widget, line, depth, disp, name=None, command=None, icon=None): + print(name) + print(disp) x = depth*30 - y = line*7 + y = line*12 width = 400 - height = 8 + height = 12 drop_txt = karamba.createText(widget, x, y, width, height, disp) - karamba.changeTextSize(widget, drop_txt, 7) + karamba.changeTextSize(widget, drop_txt, 11) karamba.changeTextColor(widget, drop_txt, 252,252,252) - # create a (very narrow! only an 8-pixel-high area!) + # create a (very narrow! only an 12-pixel-high area!) # service click area to demonstrate that commands get # executed correctly. if name: karamba.createServiceClickArea( widget, x,y,width,height, - name, command, icon) + str(name), str(command), str(icon)) # okay. you really should be looking up the KDE Developer documentation @@ -92,14 +94,14 @@ def display_svc_group(widget, rel_path, line, depth): for (type, d) in grps: - if type is 0: + if type == 0: # it's a - sub_relpath = d['relpath'] - icon = d.get('icon', 'unknown') - caption = d.get('caption', None) - comment = d.get('comment', None) + sub_relpath = d[b'relpath'].decode('utf-8') + icon = d.get(b'icon', 'unknown').decode('utf-8') + caption = d.get(b'caption', b'').decode('utf-8') + comment = d.get(b'comment', b'').decode('utf-8') cmt = '' # get at least something to display @@ -109,23 +111,24 @@ def display_svc_group(widget, rel_path, line, depth): cmt = caption msg = "SVCGRP: %s %s" % (icon, cmt) + print("MSG="+msg) create_text(widget, line, depth, msg) line += 1 - line = display_svc_group(widget, sub_relpath, + line = display_svc_group(widget, str(sub_relpath), line, depth+1) - elif type is 1 and d.has_key('menuid'): + elif type == 1 and b'menuid' in d: - relpath = d.get('relpath', '') - cmd = d['exec'] - icon = d.get('icon', 'unknown') - name = d.get('name', None) - genericname = d.get('genericname', None) + relpath = d.get(b'relpath', b'').decode('utf-8') + cmd = d[b'exec'].decode('utf-8') + icon = d.get(b'icon', 'unknown').decode('utf-8') + name = d.get(b'name', b'').decode('utf-8') + genericname = d.get(b'genericname', b'') cmt = '' # get at least something to display if genericname: - cmt = genericname + cmt = genericname.decode('utf-8') elif name: cmt = name diff --git a/superkaramba/examples/setIncomingData/2.py b/superkaramba/examples/setIncomingData/2.py index a411b60..1656316 100644 --- a/superkaramba/examples/setIncomingData/2.py +++ b/superkaramba/examples/setIncomingData/2.py @@ -14,7 +14,7 @@ def initWidget(widget): # this resets the text to "" so we know we've never # received anything yet from the other theme name = karamba.getPrettyThemeName(widget) - print "2.py name: ", name + print("2.py name: ", name) karamba.setIncomingData(widget, name, "") karamba.redrawWidget(widget) @@ -47,7 +47,7 @@ def widgetUpdated(widget): # get the "message"... disp = karamba.getIncomingData(widget) - if disp == "": + if disp == "" or disp == b'': return # decode it... @@ -74,5 +74,5 @@ def widgetUpdated(widget): pass # This will be printed when the widget loads. -print "Loaded my python 2.py extension!" +print("Loaded my python 2.py extension!") diff --git a/superkaramba/examples/template.py b/superkaramba/examples/template.py index d79d1a0..dac8db7 100644 --- a/superkaramba/examples/template.py +++ b/superkaramba/examples/template.py @@ -157,4 +157,4 @@ def keyPressed(widget, meter, char): pass # This will be printed when the widget loads. -print "Loaded my python extension!" +print("Loaded my python extension!") diff --git a/superkaramba/examples/test_all.sh b/superkaramba/examples/test_all.sh index 5e95063..4b920b6 100755 --- a/superkaramba/examples/test_all.sh +++ b/superkaramba/examples/test_all.sh @@ -1,27 +1,36 @@ #!/bin/sh -themes=( - "text/text.theme" - "autoHide/main.theme" - "bar/bar.theme" - "graph/graph.theme" - "image/image.theme" - "popupMenu/popupMenu.theme" - "taskBar/cleanbar/cleanbar.theme" - "richtext/richtext.theme" - "richtext/rtext.theme" - "globalMouse/eyes.theme" - "unicode/unicode.theme" - "mouseDrag/karmix/karmix.theme" - "input_api/input_api.theme" - "input_example/input_example.theme" -) +themes=" + autoHide/main.theme + bar/bar.theme + change_interval/interval.theme + cleanbar/cleanbar.theme + control_management/mgmt.theme + disableRightClickMenu/disable_menu.theme + globalMouse/eyes.theme + graph/graph.theme + image/image.theme + input_api/input_api.theme + input_example/input_example.theme + mouseDrag/karmix.theme + mouseDrop/mousedrop.theme + openCloseTheme/1.theme + openCloseTheme/2.theme + popupMenu/popupMenu.theme + richtext/richtext.theme + richtext/rtext.theme + service_group/service_group.theme + setIncomingData/1.theme + setIncomingData/2.theme + text/text.theme + unicode/unicode.theme +" -for theme in "${themes[@]}" +for theme in $themes do - echo $theme - dcop `dcop superkaramba* | head -n 1` default openTheme $PWD/$theme - read a - dcop `dcop superkaramba* | head -n 1` default closeTheme `expr $theme : '.*/\(.*\)\.'` + echo $theme + dcop `dcop superkaramba* | head -n 1` default openTheme $PWD/$theme + read a + dcop `dcop superkaramba* | head -n 1` default closeTheme `expr $theme : '.*/\(.*\)\.'` done #dcop `dcop superkaramba* | head -n 1` default quit diff --git a/superkaramba/examples/text/text.py b/superkaramba/examples/text/text.py index 4612dd5..b5ca3d7 100644 --- a/superkaramba/examples/text/text.py +++ b/superkaramba/examples/text/text.py @@ -38,13 +38,13 @@ def widgetUpdated(widget): # size & resize size = karamba.getTextSize(widget, texts[1]) - print "getTextSize: " + str(size) + print("getTextSize: " + str(size)) size = ((b * 200) + 200, size[1]) karamba.resizeText(widget, texts[1], size[0], size[1]) # pos & move pos = karamba.getTextPos(widget, texts[2]) - print "getTextPos: " + str(pos) + print("getTextPos: " + str(pos)) pos = (b * 200, pos[1]) karamba.moveText(widget, texts[2], pos[0], pos[1]) @@ -56,7 +56,7 @@ def widgetUpdated(widget): # Sensor sensor = karamba.getTextSensor(widget, texts[4]) - print "getSensor: " + str(sensor) + print("getSensor: " + str(sensor)) if(b): karamba.setTextSensor(widget, texts[4], 'SENSOR=SENSOR TYPE="cpu_temp"') else: @@ -64,30 +64,30 @@ def widgetUpdated(widget): # Value v = karamba.getTextValue(widget, texts[5]) - print "getTextValue: ", v + print("getTextValue: ", v) v += '.' karamba.changeText(widget, texts[5], v) # Shadow v = karamba.getTextShadow(widget, texts[6]) - print "getTextShadow: ", v + print("getTextShadow: ", v) v = (v+1)%10; karamba.changeTextShadow(widget, texts[6], v) # Font size v = karamba.getTextFontSize(widget, texts[7]) - print "getTextFontSize: ", v + print("getTextFontSize: ", v) v = 10 + ((v-10)+1)%10; karamba.changeTextSize(widget, texts[7], v) # Text color v = karamba.getTextColor(widget, texts[8]) - print "getTextColor: ", v + print("getTextColor: ", v) karamba.changeTextColor(widget, texts[8], b*255, b*255, b*255) # Text Font v = karamba.getTextFont(widget, texts[9]) - print "getTextFont: ", v + print("getTextFont: ", v) if(b): v = 'Bitstream Vera Sans' else: @@ -97,7 +97,7 @@ def widgetUpdated(widget): # Text Alignment a = (a+1)%3 v = karamba.getTextAlign(widget, texts[10]) - print "getTextAlign: ", v + print("getTextAlign: ", v) karamba.setTextAlign(widget, texts[10], align[a]) def widgetClicked(widget, x, y, button): @@ -107,4 +107,4 @@ def widgetMouseMoved(widget, x, y, button): pass # This will be printed when the widget loads. -print "Loaded Text test python extension!" +print("Loaded Text test python extension!") diff --git a/superkaramba/examples/unicode/unicode.py b/superkaramba/examples/unicode/unicode.py index 13d1136..6e0447a 100644 --- a/superkaramba/examples/unicode/unicode.py +++ b/superkaramba/examples/unicode/unicode.py @@ -9,7 +9,7 @@ import karamba #this is called when you widget is initialized def initWidget(widget): - text=u""" + text=""" <h1>UNICODE Example</h1> <h3>Greek:</h3> \u03B1\u03B2\u03B3\u03B4\u03B5\u03B6\u03B7\u03B8\u03B9\u03BA\u03BB\u03BC\u03BD\u03BE\u03BF\u03C0 @@ -113,4 +113,4 @@ def widgetMouseMoved(widget, x, y, button): pass # This will be printed when the widget loads. -print "Loaded Karamba Unicode Test" +print("Loaded Karamba Unicode Test") diff --git a/superkaramba/src/bar.h b/superkaramba/src/bar.h index 3c0562a..09dbd96 100644 --- a/superkaramba/src/bar.h +++ b/superkaramba/src/bar.h @@ -17,7 +17,7 @@ class Bar : public Meter { -Q_OBJECT +TQ_OBJECT public: Bar(karamba* k,int ix,int iy,int iw,int ih ); diff --git a/superkaramba/src/clickarea.cpp b/superkaramba/src/clickarea.cpp index a49e4c7..2377aaf 100644 --- a/superkaramba/src/clickarea.cpp +++ b/superkaramba/src/clickarea.cpp @@ -31,7 +31,7 @@ bool ClickArea::click( TQMouseEvent *e ) { //tqDebug(TQString::number(e->type())); //KShellProcess ksp; - if( e->button() != Qt::LeftButton ) + if( e->button() != TQt::LeftButton ) return false; if (!svc_name.isEmpty()) { diff --git a/superkaramba/src/clickarea.h b/superkaramba/src/clickarea.h index d062da1..9e05946 100644 --- a/superkaramba/src/clickarea.h +++ b/superkaramba/src/clickarea.h @@ -39,7 +39,7 @@ **/ class ClickArea : public Meter { - Q_OBJECT + TQ_OBJECT public: ClickArea(karamba* k, int x, int y, int w, int h ); diff --git a/superkaramba/src/clickmap.h b/superkaramba/src/clickmap.h index 33fbf0e..98d68dd 100644 --- a/superkaramba/src/clickmap.h +++ b/superkaramba/src/clickmap.h @@ -22,7 +22,7 @@ **/ class ClickMap : public Meter { -Q_OBJECT +TQ_OBJECT public: ClickMap(karamba* k, int x, int y, int w, int h); diff --git a/superkaramba/src/config_python.cpp b/superkaramba/src/config_python.cpp index 0b9b34b..1a094eb 100644 --- a/superkaramba/src/config_python.cpp +++ b/superkaramba/src/config_python.cpp @@ -172,7 +172,7 @@ PyObject* py_read_config_entry(PyObject *, PyObject *args) return Py_BuildValue((char*)"l", i); } - if (type == TQSTRING_OBJECT_NAME_STRING) + if (type == "TQString") { return Py_BuildValue((char*)"s", entry.toString().ascii()); } diff --git a/superkaramba/src/cpusensor.h b/superkaramba/src/cpusensor.h index e239edb..0d02334 100644 --- a/superkaramba/src/cpusensor.h +++ b/superkaramba/src/cpusensor.h @@ -16,7 +16,7 @@ class CPUSensor : public Sensor { - Q_OBJECT + TQ_OBJECT public: CPUSensor( TQString cpuNbr, int interval ); diff --git a/superkaramba/src/datesensor.cpp b/superkaramba/src/datesensor.cpp index ca5e6e6..24e4675 100644 --- a/superkaramba/src/datesensor.cpp +++ b/superkaramba/src/datesensor.cpp @@ -87,7 +87,7 @@ void DateSensor::toggleCalendar(TQMouseEvent *ev) hidden = false; cal = new DatePicker(0); - connect(cal, TQT_SIGNAL(destroyed()), TQT_SLOT(slotCalendarDeleted())); + connect(cal, TQ_SIGNAL(destroyed()), TQ_SLOT(slotCalendarDeleted())); TQPoint c = (TQPoint(ev->x(), ev->y())); int w = cal->sizeHint().width(); @@ -117,7 +117,7 @@ void DateSensor::mousePressEvent(TQMouseEvent *ev) { switch (ev->button()) { - case Qt::LeftButton: + case TQt::LeftButton: toggleCalendar(ev); break; default: diff --git a/superkaramba/src/datesensor.h b/superkaramba/src/datesensor.h index 67c66db..b0cbdfc 100644 --- a/superkaramba/src/datesensor.h +++ b/superkaramba/src/datesensor.h @@ -26,7 +26,7 @@ private: class DateSensor : public Sensor { -Q_OBJECT +TQ_OBJECT public: DateSensor( int interval ); diff --git a/superkaramba/src/disksensor.cpp b/superkaramba/src/disksensor.cpp index e16d415..50f23ff 100644 --- a/superkaramba/src/disksensor.cpp +++ b/superkaramba/src/disksensor.cpp @@ -18,10 +18,10 @@ DiskSensor::DiskSensor( int msec ) : Sensor( msec ) { - connect(&ksp, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int )), - this,TQT_SLOT(receivedStdout(TDEProcess *, char *, int ))); - connect(&ksp, TQT_SIGNAL(processExited(TDEProcess *)), - this,TQT_SLOT(processExited( TDEProcess * ))); + connect(&ksp, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int )), + this,TQ_SLOT(receivedStdout(TDEProcess *, char *, int ))); + connect(&ksp, TQ_SIGNAL(processExited(TDEProcess *)), + this,TQ_SLOT(processExited( TDEProcess * ))); // update values on startup ksp.clearArguments(); diff --git a/superkaramba/src/disksensor.h b/superkaramba/src/disksensor.h index 7207dd2..4f88237 100644 --- a/superkaramba/src/disksensor.h +++ b/superkaramba/src/disksensor.h @@ -18,7 +18,7 @@ #include <kprocess.h> class DiskSensor : public Sensor { -Q_OBJECT +TQ_OBJECT public: DiskSensor(int msec ); diff --git a/superkaramba/src/graph.h b/superkaramba/src/graph.h index 8c1b3a8..ca11715 100644 --- a/superkaramba/src/graph.h +++ b/superkaramba/src/graph.h @@ -17,7 +17,7 @@ class Graph : public Meter { -Q_OBJECT +TQ_OBJECT public: diff --git a/superkaramba/src/imagelabel.cpp b/superkaramba/src/imagelabel.cpp index 514e7f8..4b934a9 100644 --- a/superkaramba/src/imagelabel.cpp +++ b/superkaramba/src/imagelabel.cpp @@ -39,7 +39,7 @@ Effect::Effect(ImageLabel* img, int msec) : if (msec > 0) { // remove the effect after the given time - //TQTimer::singleShot (millisec, myImage, TQT_SLOT(slotEffectExpired())); + //TQTimer::singleShot (millisec, myImage, TQ_SLOT(slotEffectExpired())); //timer -> changeInterval(millisec); millisec = msec; } @@ -57,7 +57,7 @@ void Effect::startTimer() { if (millisec > 0) { - TQTimer::singleShot (millisec, myImage, TQT_SLOT(slotEffectExpired())); + TQTimer::singleShot (millisec, myImage, TQ_SLOT(slotEffectExpired())); millisec = 0; } } @@ -287,8 +287,8 @@ void ImageLabel::setValue(TQString fn) KTempFile tmpFile; TDEIO::FileCopyJob* copy = TDEIO::file_copy(fileName, tmpFile.name(), 0600, true, false, false); - connect(copy, TQT_SIGNAL(result(TDEIO::Job*)), - this, TQT_SLOT(slotCopyResult(TDEIO::Job*))); + connect(copy, TQ_SIGNAL(result(TDEIO::Job*)), + this, TQ_SLOT(slotCopyResult(TDEIO::Job*))); return; } else @@ -387,15 +387,15 @@ bool ImageLabel::click(TQMouseEvent* e) if (getBoundingBox().contains(e -> x(), e -> y()) && isEnabled()) { TQString program; - if (e -> button() == Qt::LeftButton) + if (e -> button() == TQt::LeftButton) { program = leftButtonAction; } - else if (e -> button() == Qt::MidButton) + else if (e -> button() == TQt::MidButton) { program = middleButtonAction; } - else if (e -> button() == Qt::RightButton) + else if (e -> button() == TQt::RightButton) { program = rightButtonAction; } diff --git a/superkaramba/src/imagelabel.h b/superkaramba/src/imagelabel.h index 1346c2e..57d90e9 100644 --- a/superkaramba/src/imagelabel.h +++ b/superkaramba/src/imagelabel.h @@ -46,7 +46,7 @@ namespace TDEIO { class Effect : public TQObject { -Q_OBJECT +TQ_OBJECT public: @@ -102,7 +102,7 @@ public: class ImageLabel : public Meter { -Q_OBJECT +TQ_OBJECT public: diff --git a/superkaramba/src/input.h b/superkaramba/src/input.h index 6e1601a..9bf7fdb 100644 --- a/superkaramba/src/input.h +++ b/superkaramba/src/input.h @@ -35,7 +35,7 @@ class Input : public Meter { -Q_OBJECT +TQ_OBJECT public: Input(karamba* k, int ix, int iy, int iw, int ih); diff --git a/superkaramba/src/input_python.cpp b/superkaramba/src/input_python.cpp index fb451bd..727daaa 100644 --- a/superkaramba/src/input_python.cpp +++ b/superkaramba/src/input_python.cpp @@ -348,7 +348,7 @@ PyObject* py_getInputFocus(PyObject *, PyObject *args) // TQWidget *obj = ((karamba*)widget)->focusWidget(); - if(obj->isA(TQLINEEDIT_OBJECT_NAME_STRING)) // SKLineEdit is no TQ_Object, but TQLineEdit can only be here as a SKLineEdit + if(obj->isA("TQLineEdit")) // SKLineEdit is no TQ_Object, but TQLineEdit can only be here as a SKLineEdit return Py_BuildValue((char*)"l", ((SKLineEdit*)obj)->getInput()); return Py_BuildValue((char*)"l", 0); diff --git a/superkaramba/src/karamba.cpp b/superkaramba/src/karamba.cpp index 19b30b5..d4a74f7 100644 --- a/superkaramba/src/karamba.cpp +++ b/superkaramba/src/karamba.cpp @@ -77,7 +77,7 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, if(!m_theme.set(url)) { setFixedSize(0, 0); - TQTimer::singleShot(100, this, TQT_SLOT(killWidget())); + TQTimer::singleShot(100, this, TQ_SLOT(killWidget())); return; } // Add self to list of open themes @@ -93,8 +93,8 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, setName(qName.ascii()); KDirWatch *dirWatch = KDirWatch::self(); - connect(dirWatch, TQT_SIGNAL( dirty( const TQString & ) ), - TQT_SLOT( slotFileChanged( const TQString & ) ) ); + connect(dirWatch, TQ_SIGNAL( dirty( const TQString & ) ), + TQ_SLOT( slotFileChanged( const TQString & ) ) ); if(!dirWatch->contains(m_theme.file())) dirWatch->addFile(m_theme.file()); @@ -132,7 +132,7 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, if(m_theme.pythonModuleExists()) { kdDebug() << "Loading python module: " << m_theme.pythonModule() << endl; - TQTimer::singleShot(0, this, TQT_SLOT(initPythonInterface())); + TQTimer::singleShot(0, this, TQ_SLOT(initPythonInterface())); } widgetMask = 0; @@ -142,22 +142,22 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, kWinModule = new KWinModule(); desktop = 0; - connect( kWinModule,TQT_SIGNAL(currentDesktopChanged(int)), this, - TQT_SLOT(currentDesktopChanged(int)) ); - connect( kapp, TQT_SIGNAL(backgroundChanged(int)), this, - TQT_SLOT(currentWallpaperChanged(int))); + connect( kWinModule,TQ_SIGNAL(currentDesktopChanged(int)), this, + TQ_SLOT(currentDesktopChanged(int)) ); + connect( kapp, TQ_SIGNAL(backgroundChanged(int)), this, + TQ_SLOT(currentWallpaperChanged(int))); // Setup of the Task Manager Callbacks - connect(&taskManager, TQT_SIGNAL(activeTaskChanged(Task*)), this, - TQT_SLOT(activeTaskChanged(Task*)) ); - connect(&taskManager, TQT_SIGNAL(taskAdded(Task*)), this, - TQT_SLOT(taskAdded(Task*)) ); - connect(&taskManager, TQT_SIGNAL(taskRemoved(Task*)), this, - TQT_SLOT(taskRemoved(Task*)) ); - connect(&taskManager, TQT_SIGNAL(startupAdded(Startup*)), this, - TQT_SLOT(startupAdded(Startup*)) ); - connect(&taskManager, TQT_SIGNAL(startupRemoved(Startup*)), this, - TQT_SLOT(startupRemoved(Startup*)) ); + connect(&taskManager, TQ_SIGNAL(activeTaskChanged(Task*)), this, + TQ_SLOT(activeTaskChanged(Task*)) ); + connect(&taskManager, TQ_SIGNAL(taskAdded(Task*)), this, + TQ_SLOT(taskAdded(Task*)) ); + connect(&taskManager, TQ_SIGNAL(taskRemoved(Task*)), this, + TQ_SLOT(taskRemoved(Task*)) ); + connect(&taskManager, TQ_SIGNAL(startupAdded(Startup*)), this, + TQ_SLOT(startupAdded(Startup*)) ); + connect(&taskManager, TQ_SIGNAL(startupRemoved(Startup*)), this, + TQ_SLOT(startupRemoved(Startup*)) ); themeConfMenu = new TDEPopupMenu( this); themeConfMenu -> setCheckable(true); @@ -170,8 +170,8 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, toDesktopMenu = new TDEPopupMenu (this); toDesktopMenu -> setCheckable(true); mid = toDesktopMenu -> insertItem (i18n("&All Desktops"), - dslot = new DesktopChangeSlot(TQT_TQOBJECT(this),0), - TQT_SLOT(receive())); + dslot = new DesktopChangeSlot(this,0), + TQ_SLOT(receive())); dslot->setMenuId(mid); toDesktopMenu -> insertSeparator(); @@ -181,7 +181,7 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, name += ('0' + ndesktop); mid = toDesktopMenu -> insertItem (name, - dslot = new DesktopChangeSlot(TQT_TQOBJECT(this), ndesktop), TQT_SLOT(receive())); + dslot = new DesktopChangeSlot(this, ndesktop), TQ_SLOT(receive())); dslot->setMenuId(mid); } @@ -193,11 +193,11 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, menuAccColl = new TDEActionCollection( this ); kpop->insertItem( SmallIconSet("reload"),i18n("Update"), this, - TQT_SLOT(updateSensors()), Key_F5 ); + TQ_SLOT(updateSensors()), Key_F5 ); toggleLocked = new TDEToggleAction ( i18n("Toggle &Locked Position"), SmallIconSet("locked"), - CTRL+Key_L, TQT_TQOBJECT(this), - TQT_SLOT( slotToggleLocked() ), + CTRL+Key_L, this, + TQ_SLOT( slotToggleLocked() ), accColl, "Locked position" ); accColl->insert(toggleLocked); toggleLocked -> setChecked(true); @@ -205,8 +205,8 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, toggleLocked->plug(kpop); toggleFastTransforms = new TDEToggleAction(i18n("Use &Fast Image Scaling"), - CTRL+Key_F, TQT_TQOBJECT(this), - TQT_SLOT( slotToggleFastTransforms() ), + CTRL+Key_F, this, + TQ_SLOT( slotToggleFastTransforms() ), accColl, "Fast transformations"); accColl->insert(toggleFastTransforms); @@ -221,9 +221,9 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, kpop->insertItem(i18n("To Des&ktop"), toDesktopMenu); kpop->insertItem( SmallIconSet("reload3"),i18n("&Reload Theme"),this, - TQT_SLOT(reloadConfig()), CTRL+Key_R ); + TQ_SLOT(reloadConfig()), CTRL+Key_R ); kpop->insertItem( SmallIconSet("window-close"),i18n("&Close This Theme"), this, - TQT_SLOT(killWidget()), CTRL+Key_C ); + TQ_SLOT(killWidget()), CTRL+Key_C ); if(!SuperKarambaSettings::showSysTray()) showMenuExtension(); @@ -262,7 +262,7 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, if( !parseConfig() ) { setFixedSize(0,0); - TQTimer::singleShot( 100, this, TQT_SLOT(killWidget()) ); + TQTimer::singleShot( 100, this, TQ_SLOT(killWidget()) ); tqWarning("Could not read config file."); } else @@ -310,11 +310,11 @@ karamba::karamba(TQString fn, TQString name, bool reloading, int instance, move(xpos, ypos); } - haveUpdated = 0; + haveUpdated = false; this->setMouseTracking(true); - setFocusPolicy(TQ_StrongFocus); + setFocusPolicy(TQWidget::StrongFocus); } karamba::~karamba() @@ -605,7 +605,7 @@ bool karamba::parseConfig() if (!tiptext.isEmpty()) tmp->setTooltip(tiptext); - connect(tmp, TQT_SIGNAL(pixmapLoaded()), this, TQT_SLOT(externalStep())); + connect(tmp, TQ_SIGNAL(pixmapLoaded()), this, TQ_SLOT(externalStep())); setSensor(lineParser, (Meter*) tmp ); meterList->append (tmp ); imageList->append (tmp ); @@ -790,12 +790,12 @@ void karamba::start() { m_sysTimer = new TQTimer(this); - connect(m_sysTimer, TQT_SIGNAL(timeout()), TQT_SLOT(step())); + connect(m_sysTimer, TQ_SIGNAL(timeout()), TQ_SLOT(step())); m_sysTimer->start(m_interval); //Start the widget running - TQTimer::singleShot( 0, this, TQT_SLOT(step()) ); + TQTimer::singleShot( 0, this, TQ_SLOT(step()) ); if( !(onTop || managed) ) lowerTimer.start(); @@ -1015,7 +1015,7 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) int interval = lineParser.getInt("INTERVAL"); interval = (interval == 0)?5000:interval; sensor = ( sensorMap["DISK"] = new DiskSensor( interval ) ); - connect( sensor, TQT_SIGNAL(initComplete()), this, TQT_SLOT(externalStep()) ); + connect( sensor, TQ_SIGNAL(initComplete()), this, TQ_SLOT(externalStep()) ); sensorList->append( sensor ); } // meter->setMax( ((DiskSensor*)sensor)->getTotalSpace(mntPt)/1024 ); @@ -1216,7 +1216,7 @@ void karamba::setSensor(const LineParser& lineParser, Meter* meter) if (sensor != 0) { - TQTimer::singleShot( 0, sensor, TQT_SLOT(update()) ); + TQTimer::singleShot( 0, sensor, TQ_SLOT(update()) ); sensor->start(); } } @@ -1294,11 +1294,11 @@ void karamba::meterClicked(TQMouseEvent* e, Meter* meter) { int button = 0; - if( e->button() == Qt::LeftButton ) + if( e->button() == TQt::LeftButton ) button = 1; - else if( e->button() == Qt::MidButton ) + else if( e->button() == TQt::MidButton ) button = 2; - else if( e->button() == Qt::RightButton ) + else if( e->button() == TQt::RightButton ) button = 3; if (RichTextLabel* richText = dynamic_cast<RichTextLabel*>(meter)) @@ -1351,11 +1351,11 @@ void karamba::passClick(TQMouseEvent *e) { int button = 0; - if( e->button() == Qt::LeftButton ) + if( e->button() == TQt::LeftButton ) button = 1; - else if( e->button() == Qt::MidButton ) + else if( e->button() == TQt::MidButton ) button = 2; - else if( e->button() == Qt::RightButton ) + else if( e->button() == TQt::RightButton ) button = 3; pythonIface->widgetClicked(this, e->x(), e->y(), button); @@ -1416,7 +1416,7 @@ void karamba::management_popup( void ) void karamba::mousePressEvent( TQMouseEvent *e ) { //tqDebug("karamba::mousePressEvent"); - if( e->button() == Qt::RightButton && !want_right_button ) + if( e->button() == TQt::RightButton && !want_right_button ) { management_popup(); } @@ -1512,14 +1512,14 @@ void karamba::mouseMoveEvent( TQMouseEvent *e ) //Modified by Ryan Nickell (p0z3r@mail.com) 03/16/2004 // This will work now, but only when you move at least // one pixel in any direction with your mouse. - //if( e->button() == Qt::LeftButton ) - if( e->state() == Qt::LeftButton) + //if( e->button() == TQt::LeftButton ) + if( e->state() == TQt::LeftButton) button = 1; - //else if( e->button() == Qt::MidButton ) - else if( e->state() == Qt::MidButton ) + //else if( e->button() == TQt::MidButton ) + else if( e->state() == TQt::MidButton ) button = 2; - //else if( e->button() == Qt::RightButton ) - else if( e->state() == Qt::RightButton ) + //else if( e->button() == TQt::RightButton ) + else if( e->state() == TQt::RightButton ) button = 3; pythonIface->widgetMouseMoved(this, e->x(), e->y(), button); @@ -1560,7 +1560,7 @@ void karamba::updateSensors() ((Sensor*) *it)->update(); ++it; } - TQTimer::singleShot( 500, this, TQT_SLOT(step()) ); + TQTimer::singleShot( 500, this, TQ_SLOT(step()) ); } void karamba::updateBackground(TDESharedPixmap* kpm) @@ -1691,14 +1691,13 @@ void karamba::step() if (pythonIface && pythonIface->isExtensionLoaded()) { - if (haveUpdated == 0) + if (!haveUpdated) pythonIface->initWidget(this); else pythonIface->widgetUpdated(this); } - if (haveUpdated == 0) - haveUpdated = 1; + haveUpdated = true; } void karamba::widgetClosed() @@ -1779,16 +1778,16 @@ void karamba::addMenuConfigOption(TQString key, TQString name) //tqDebug("karamba::addMenuConfigOption"); kpop -> setItemEnabled(THEMECONF, true); - SignalBridge* action = new SignalBridge(TQT_TQOBJECT(this), key, menuAccColl); + SignalBridge* action = new SignalBridge(this, key, menuAccColl); TDEToggleAction* confItem = new TDEToggleAction (name, TDEShortcut::null(), - action, TQT_SLOT(receive()), + action, TQ_SLOT(receive()), menuAccColl, key.ascii()); confItem -> setName(key.ascii()); menuAccColl -> insert(confItem); - connect(action, TQT_SIGNAL( enabled(TQString, bool) ), - this, TQT_SLOT( slotToggleConfigOption(TQString, bool) )); + connect(action, TQ_SIGNAL( enabled(TQString, bool) ), + this, TQ_SLOT( slotToggleConfigOption(TQString, bool) )); config -> setGroup("config menu"); confItem -> setChecked(config -> readBoolEntry(key)); @@ -2035,16 +2034,16 @@ void karamba::showMenuExtension() trayMenuToggleId = kglobal->insertItem(SmallIconSet("superkaramba"), i18n("Show System Tray Icon"), this, - TQT_SLOT(slotToggleSystemTray()), + TQ_SLOT(slotToggleSystemTray()), CTRL+Key_S); trayMenuThemeId = kglobal->insertItem(SmallIconSet("knewstuff"), i18n("&Manage Themes..."), this, - TQT_SLOT(slotShowTheme()), CTRL+Key_M); + TQ_SLOT(slotShowTheme()), CTRL+Key_M); trayMenuQuitId = kglobal->insertItem(SmallIconSet("system-log-out"), i18n("&Quit SuperKaramba"), this, - TQT_SLOT(slotQuit()), CTRL+Key_Q); + TQ_SLOT(slotQuit()), CTRL+Key_Q); kglobal->polish(); diff --git a/superkaramba/src/karamba.h b/superkaramba/src/karamba.h index 6930c5c..57843d7 100644 --- a/superkaramba/src/karamba.h +++ b/superkaramba/src/karamba.h @@ -111,7 +111,7 @@ class LineParser; class karamba : public TQWidget { - Q_OBJECT + TQ_OBJECT public: @@ -326,7 +326,7 @@ private slots: */ class DesktopChangeSlot : public TQObject { - Q_OBJECT + TQ_OBJECT public: @@ -347,7 +347,7 @@ class DesktopChangeSlot : public TQObject /** SignalBridge is an ungulate that lives in the forests of wild Wisconsin. */ class SignalBridge : public TQObject { - Q_OBJECT + TQ_OBJECT public: diff --git a/superkaramba/src/karamba_python.cpp b/superkaramba/src/karamba_python.cpp index 73212a0..f732570 100644 --- a/superkaramba/src/karamba_python.cpp +++ b/superkaramba/src/karamba_python.cpp @@ -51,12 +51,7 @@ struct module_state { PyObject *error; }; -#if PY_MAJOR_VERSION >= 3 #define GETSTATE(m) ((struct module_state*)PyModule_GetState(m)) -#else -#define GETSTATE(m) (&_state) -static struct module_state _state; -#endif static PyObject * error_out(PyObject *m) { @@ -356,8 +351,6 @@ static PyMethodDef karamba_methods[] = { {NULL, NULL, 0 ,NULL} }; -#if PY_MAJOR_VERSION >= 3 - static int karamba_traverse(PyObject *m, visitproc visit, void *arg) { Py_VISIT(GETSTATE(m)->error); return 0; @@ -382,22 +375,18 @@ static struct PyModuleDef karambadef = { #define INITERROR return NULL -#else - -#define INITERROR return - -#endif +PyMODINIT_FUNC PyInit_karamba(void) +{ + return PyModule_Create(&karambadef); +} PyThreadState* KarambaPython::mainThreadState = 0; KarambaPython::KarambaPython(const ThemeFile& theme, bool reloading): pythonThemeExtensionLoaded(false), pName(0), pModule(0), pDict(0) { - PyThreadState* myThreadState; char pypath[1024]; - getLock(&myThreadState); - // load the .py file for this .theme PyRun_SimpleString((char*)"import sys"); //Add theme path to python path so that we can find the python file @@ -405,13 +394,7 @@ KarambaPython::KarambaPython(const ThemeFile& theme, bool reloading): PyRun_SimpleString(pypath); PyRun_SimpleString((char*)"sys.path.insert(0, '')"); - PyImport_AddModule((char*)"karamba"); -#if PY_MAJOR_VERSION >= 3 - PyModule_Create(&karambadef); -#else - Py_InitModule((char*)"karamba", karamba_methods); -#endif - pName = PyBytes_FromString(theme.pythonModule().ascii()); + pName = PyUnicode_FromString(theme.pythonModule().utf8()); pModule = PyImport_Import(pName); fprintf(stderr, "%s\n", pypath); @@ -443,72 +426,40 @@ KarambaPython::KarambaPython(const ThemeFile& theme, bool reloading): fprintf(stderr, "------------------------------------------------------\n"); } - releaseLock(myThreadState); } KarambaPython::~KarambaPython() { //Clean up Python references if (pythonThemeExtensionLoaded) { - PyThreadState* myThreadState; - getLock(&myThreadState); - //Displose of current python module so we can reload in constructor. Py_DECREF(pModule); Py_DECREF(pName); - - releaseLock(myThreadState); } } void KarambaPython::initPython() { // initialize Python + PyImport_AppendInittab((char*)"karamba", PyInit_karamba); Py_Initialize(); +#if PY_VERSION_HEX < 0x03070000 // initialize thread support PyEval_InitThreads(); +#endif // save a pointer to the main PyThreadState object mainThreadState = PyThreadState_Get(); - - // release the lock - PyEval_ReleaseLock(); } void KarambaPython::shutdownPython() { // shut down the interpreter - PyInterpreterState * mainInterpreterState = mainThreadState->interp; - // create a thread state object for this thread - PyThreadState * myThreadState = PyThreadState_New(mainInterpreterState); - PyThreadState_Swap(myThreadState); - PyEval_AcquireLock(); + PyThreadState_Swap(mainThreadState); Py_Finalize(); } -void KarambaPython::getLock(PyThreadState** myThreadState) -{ - // get the global lock - PyEval_AcquireLock(); - - // create a thread state object for this thread - *myThreadState = PyThreadState_New(mainThreadState->interp); - PyThreadState_Swap(*myThreadState); -} - -void KarambaPython::releaseLock(PyThreadState* myThreadState) -{ - // swap my thread state out of the interpreter - PyThreadState_Swap(NULL); - // clear out any cruft from thread state object - PyThreadState_Clear(myThreadState); - // delete my thread state object - PyThreadState_Delete(myThreadState); - // release the lock - PyEval_ReleaseLock(); -} - PyObject* KarambaPython::getFunc(const char* function) { PyObject* pFunc = PyDict_GetItemString(pDict, (char*)function); @@ -517,17 +468,11 @@ PyObject* KarambaPython::getFunc(const char* function) return NULL; } -bool KarambaPython::callObject(const char* func, PyObject* pArgs, bool lock) +bool KarambaPython::callObject(const char* func, PyObject* pArgs) { bool result = false; - PyThreadState* myThreadState; - //tqDebug("Calling %s", func); - - if (lock) - getLock(&myThreadState); PyObject* pFunc = getFunc(func); - if (pFunc != NULL) { PyObject* pValue = PyObject_CallObject(pFunc, pArgs); @@ -544,8 +489,6 @@ bool KarambaPython::callObject(const char* func, PyObject* pArgs, bool lock) } } Py_DECREF(pArgs); - if (lock) - releaseLock(myThreadState); return result; } @@ -597,8 +540,7 @@ bool KarambaPython::widgetClicked(karamba* k, int x, int y, int button) return callObject("widgetClicked", pArgs); } -bool KarambaPython::keyPressed(karamba* k, const Meter* meter, - const TQString& text) +bool KarambaPython::keyPressed(karamba* k, const Meter* meter, const TQString& text) { PyObject* pArgs = Py_BuildValue((char*)"(lls)", k, meter, text.ucs2()); return callObject("keyPressed", pArgs); @@ -660,13 +602,8 @@ bool KarambaPython::itemDropped(karamba* k, TQString text, int x, int y) bool KarambaPython::themeNotify(karamba* k, const char *from, const char *str) { - // WARNING WARNING WARNING i had to switch off thread locking to get - // this to work. callNotify is called from INSIDE another locked thread, - // so can never complete because themeNotify will expect locking to be - // released... - // PyObject* pArgs = Py_BuildValue((char*)"(lss)", k, from, str); - return callObject("themeNotify", pArgs, false); + return callObject("themeNotify", pArgs); } bool KarambaPython::systrayUpdated(karamba* k) diff --git a/superkaramba/src/karamba_python.h b/superkaramba/src/karamba_python.h index b3f7a0a..5227d6d 100644 --- a/superkaramba/src/karamba_python.h +++ b/superkaramba/src/karamba_python.h @@ -45,10 +45,8 @@ protected: PyObject *pDict; static PyThreadState* mainThreadState; - void getLock(PyThreadState** myThreadState); PyObject* getFunc(const char* function); - void releaseLock(PyThreadState* myThreadState); - bool callObject(const char* func, PyObject* pArgs, bool lock=true); + bool callObject(const char* func, PyObject* pArgs); public: KarambaPython(const ThemeFile& theme, bool reloading); diff --git a/superkaramba/src/karambaapp.cpp b/superkaramba/src/karambaapp.cpp index d567eb7..b4bf15c 100644 --- a/superkaramba/src/karambaapp.cpp +++ b/superkaramba/src/karambaapp.cpp @@ -141,17 +141,17 @@ void KarambaApplication::setUpSysTray(TDEAboutData* about) TDEPopupMenu *menu = sysTrayIcon->contextMenu(); menu->insertItem(SmallIconSet("superkaramba"), i18n("Hide System Tray Icon"), this, - TQT_SLOT(globalHideSysTray())); + TQ_SLOT(globalHideSysTray())); menu->insertSeparator(); m_helpMenu = new KHelpMenu(themeListWindow, about); - action = KStdAction::help(m_helpMenu, TQT_SLOT(appHelpActivated()), + action = KStdAction::help(m_helpMenu, TQ_SLOT(appHelpActivated()), sysTrayIcon->actionCollection()); action->plug(menu); - action = KStdAction::aboutApp(m_helpMenu, TQT_SLOT(aboutApplication()), + action = KStdAction::aboutApp(m_helpMenu, TQ_SLOT(aboutApplication()), sysTrayIcon->actionCollection()); action->plug(menu); - action = KStdAction::aboutKDE(m_helpMenu, TQT_SLOT(aboutKDE()), + action = KStdAction::aboutKDE(m_helpMenu, TQ_SLOT(aboutKDE()), sysTrayIcon->actionCollection()); action->plug(menu); @@ -164,8 +164,8 @@ void KarambaApplication::setUpSysTray(TDEAboutData* about) sysTrayIcon->hide(); //Connect Systray icon's quit event - TQObject::connect(sysTrayIcon, TQT_SIGNAL(quitSelected()), - this, TQT_SLOT(globalQuitSuperKaramba())); + TQObject::connect(sysTrayIcon, TQ_SIGNAL(quitSelected()), + this, TQ_SLOT(globalQuitSuperKaramba())); } void KarambaApplication::showKarambaMenuExtension(bool show) @@ -296,7 +296,7 @@ void KarambaApplication::addKaramba(karamba* k, bool reloading) karambaApp->dcopClient()->appId(), k->theme().file()); k->setInstance(instance); } - karambaList->append(TQT_TQOBJECT(k)); + karambaList->append(k); } void KarambaApplication::deleteKaramba(karamba* k, bool reloading) @@ -304,12 +304,12 @@ void KarambaApplication::deleteKaramba(karamba* k, bool reloading) if(!reloading && karambaApp->dcopStub()) karambaApp->dcopStub()->themeClosed( karambaApp->dcopClient()->appId(), k->theme().file(), k->instance()); - karambaList->removeRef(TQT_TQOBJECT(k)); + karambaList->removeRef(k); } bool KarambaApplication::hasKaramba(karamba* k) { - return karambaList->containsRef(TQT_TQOBJECT(k)) > 0; + return karambaList->containsRef(k) > 0; } // XXX: I guess this should be made with mutex/semaphores diff --git a/superkaramba/src/karambaapp.h b/superkaramba/src/karambaapp.h index 330a6ed..8e53914 100644 --- a/superkaramba/src/karambaapp.h +++ b/superkaramba/src/karambaapp.h @@ -38,7 +38,7 @@ class TDEAboutData; class KarambaApplication : public TDEApplication { - Q_OBJECT + TQ_OBJECT friend class KarambaIface; diff --git a/superkaramba/src/kwidgetlistbox.cpp b/superkaramba/src/kwidgetlistbox.cpp index 1811f38..56e0769 100644 --- a/superkaramba/src/kwidgetlistbox.cpp +++ b/superkaramba/src/kwidgetlistbox.cpp @@ -33,8 +33,8 @@ KWidgetListbox::KWidgetListbox(TQWidget *parent, const char *name) verticalHeader()->hide(); setSelectionMode(TQTable::NoSelection); setFocusStyle(TQTable::FollowStyle); - connect(this, TQT_SIGNAL(currentChanged(int, int)), - this, TQT_SLOT(selectionChanged(int, int))); + connect(this, TQ_SIGNAL(currentChanged(int, int)), + this, TQ_SLOT(selectionChanged(int, int))); setHScrollBarMode(TQScrollView::AlwaysOff); setVScrollBarMode(TQScrollView::Auto); } diff --git a/superkaramba/src/kwidgetlistbox.h b/superkaramba/src/kwidgetlistbox.h index 680df49..d791337 100644 --- a/superkaramba/src/kwidgetlistbox.h +++ b/superkaramba/src/kwidgetlistbox.h @@ -30,7 +30,7 @@ typedef bool (*show_callback) (int index, TQWidget* widget, void* data); class KWidgetListbox : public TQTable { - Q_OBJECT + TQ_OBJECT public: diff --git a/superkaramba/src/main.cpp b/superkaramba/src/main.cpp index 9ea8503..d336bd4 100644 --- a/superkaramba/src/main.cpp +++ b/superkaramba/src/main.cpp @@ -87,7 +87,7 @@ void karambaMessageOutput(TQtMsgType type, const char *msg) int main(int argc, char **argv) { #ifdef KARAMBA_LOG - tqInstallMsgHandler(karambaMessageOutput); + qInstallMsgHandler(karambaMessageOutput); #endif TDEAboutData about("superkaramba", I18N_NOOP("SuperKaramba"), version, description, @@ -128,7 +128,7 @@ int main(int argc, char **argv) KarambaApplication::unlockKaramba(); - app.connect(tqApp,TQT_SIGNAL(lastWindowClosed()),tqApp,TQT_SLOT(quit())); + app.connect(tqApp,TQ_SIGNAL(lastWindowClosed()),tqApp,TQ_SLOT(quit())); // Try to restore a previous session if applicable. app.checkPreviousSession(app, lst); diff --git a/superkaramba/src/memsensor.cpp b/superkaramba/src/memsensor.cpp index 98eceea..1d6c4dc 100644 --- a/superkaramba/src/memsensor.cpp +++ b/superkaramba/src/memsensor.cpp @@ -57,10 +57,10 @@ MemSensor::MemSensor(int msec) : Sensor(msec) # if defined(Q_OS_FREEBSD) && defined(__FreeBSD_version) && __FreeBSD_version >= 500018 kd = kvm_open("/dev/null", "/dev/null", "/dev/null", O_RDONLY, "kvm_open"); # elif defined Q_OS_FREEBSD - connect(&ksp, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int )), - this,TQT_SLOT(receivedStdout(TDEProcess *, char *, int ))); - connect(&ksp, TQT_SIGNAL(processExited(TDEProcess *)), - this,TQT_SLOT(processExited( TDEProcess * ))); + connect(&ksp, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int )), + this,TQ_SLOT(receivedStdout(TDEProcess *, char *, int ))); + connect(&ksp, TQ_SIGNAL(processExited(TDEProcess *)), + this,TQ_SLOT(processExited( TDEProcess * ))); swapTotal = swapUsed = 0; diff --git a/superkaramba/src/memsensor.h b/superkaramba/src/memsensor.h index 56a91a5..cf00e1d 100644 --- a/superkaramba/src/memsensor.h +++ b/superkaramba/src/memsensor.h @@ -23,7 +23,7 @@ class MemSensor : public Sensor { -Q_OBJECT +TQ_OBJECT public: diff --git a/superkaramba/src/menu_python.cpp b/superkaramba/src/menu_python.cpp index 5d80a75..bc5d9e3 100644 --- a/superkaramba/src/menu_python.cpp +++ b/superkaramba/src/menu_python.cpp @@ -38,10 +38,10 @@ long createMenu(long widget) karamba* currTheme = (karamba*)widget; TDEPopupMenu* tmp = new TDEPopupMenu(currTheme); - currTheme->menuList->append( TQT_TQOBJECT(tmp) ); + currTheme->menuList->append( tmp ); - currTheme->connect(tmp, TQT_SIGNAL(activated(int)), currTheme, - TQT_SLOT(passMenuItemClicked(int))); + currTheme->connect(tmp, TQ_SIGNAL(activated(int)), currTheme, + TQ_SLOT(passMenuItemClicked(int))); return (long)tmp; } @@ -86,7 +86,7 @@ long deleteMenu(long widget, long menu) karamba* currTheme = (karamba*)widget; TDEPopupMenu* tmp = (TDEPopupMenu*)menu; - currTheme->menuList->removeRef(TQT_TQOBJECT(tmp)); + currTheme->menuList->removeRef(tmp); return 1; } diff --git a/superkaramba/src/meter.h b/superkaramba/src/meter.h index 810a8aa..64609e8 100644 --- a/superkaramba/src/meter.h +++ b/superkaramba/src/meter.h @@ -22,7 +22,7 @@ class karamba; class Meter : public TQObject { -Q_OBJECT +TQ_OBJECT public: diff --git a/superkaramba/src/meter_python.cpp b/superkaramba/src/meter_python.cpp index c5d745b..d3f2293 100644 --- a/superkaramba/src/meter_python.cpp +++ b/superkaramba/src/meter_python.cpp @@ -100,11 +100,13 @@ TQString PyString2TQString(PyObject* text) } else if (PyUnicode_CheckExact(text)) { - Py_UNICODE* t = PyUnicode_AsUnicode(text); - if(sizeof(Py_UNICODE) == 4) - qtext = fromUcs4((TQ_UINT32*)t); - else - qtext = TQString::fromUcs2((TQ_UINT16*)t); + int uniSize = PyUnicode_KIND(text); + if (uniSize == PyUnicode_4BYTE_KIND) + qtext = fromUcs4((TQ_UINT32*)PyUnicode_4BYTE_DATA(text)); + else if (uniSize == PyUnicode_2BYTE_KIND) + qtext = TQString::fromUcs2((TQ_UINT16*)PyUnicode_2BYTE_DATA(text)); + else if (uniSize == PyUnicode_1BYTE_KIND) + qtext.setAscii((char*)PyUnicode_1BYTE_DATA(text)); } else { @@ -119,34 +121,11 @@ PyObject* TQString2PyString(TQString string) PyObject *pyString; const unsigned short* tmp = string.ucs2(); - bool dofree = false; if(tmp) { - #if Py_UNICODE_SIZE == 4 - - Py_UNICODE* buf = new Py_UNICODE[string.length()]; - - for(unsigned int i = 0; i < string.length(); i++) - { - buf[i] = tmp[i]; - } - dofree = true; - - #else - - Py_UNICODE* buf = (Py_UNICODE*) tmp; - - #endif - - pyString = PyUnicode_FromUnicode(buf, string.length()); - - if(dofree) - { - delete [] buf; - } + pyString = PyUnicode_FromKindAndData(PyUnicode_2BYTE_KIND, tmp, string.length()); } - else pyString = PyBytes_FromString(""); diff --git a/superkaramba/src/misc_python.cpp b/superkaramba/src/misc_python.cpp index 271ec51..5f60ff0 100644 --- a/superkaramba/src/misc_python.cpp +++ b/superkaramba/src/misc_python.cpp @@ -149,13 +149,13 @@ PyObject* py_execute_command_interactive(PyObject *, PyObject* args) } TQApplication::connect(currTheme->currProcess, - TQT_SIGNAL(processExited(TDEProcess *)), + TQ_SIGNAL(processExited(TDEProcess *)), currTheme, - TQT_SLOT(processExited(TDEProcess *))); + TQ_SLOT(processExited(TDEProcess *))); TQApplication::connect(currTheme->currProcess, - TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int)), + TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int)), currTheme, - TQT_SLOT(receivedStdout(TDEProcess *, char *, int))); + TQ_SLOT(receivedStdout(TDEProcess *, char *, int))); currTheme->currProcess->start(TDEProcess::NotifyOnExit, TDEProcess::Stdout); return Py_BuildValue((char*)"l", (int)(currTheme->currProcess->pid())); diff --git a/superkaramba/src/networksensor.cpp b/superkaramba/src/networksensor.cpp index 2320a6a..34cff5c 100644 --- a/superkaramba/src/networksensor.cpp +++ b/superkaramba/src/networksensor.cpp @@ -108,7 +108,7 @@ void NetworkSensor::getInOutBytes ( unsigned long &in,unsigned long &out) const } if ( line.contains( device ) ) { - TQRegExp rx( "\\W+"+device+":\\D*(\\d+)(?:\\D+\\d+){7}\\D+(\\d+)", false); + TQRegExp rx( "^\\W*"+device+":\\D*(\\d+)(?:\\D+\\d+){7}\\D+(\\d+)", false); rx.search(line); in = rx.cap(1).toULong(); out = rx.cap(2).toULong(); diff --git a/superkaramba/src/networksensor.h b/superkaramba/src/networksensor.h index 5e93517..9ad8eab 100644 --- a/superkaramba/src/networksensor.h +++ b/superkaramba/src/networksensor.h @@ -24,7 +24,7 @@ class NetworkSensor : public Sensor { - Q_OBJECT + TQ_OBJECT public: NetworkSensor( TQString device, int interval ); diff --git a/superkaramba/src/noatunsensor.cpp b/superkaramba/src/noatunsensor.cpp index 129e8e0..0a06473 100644 --- a/superkaramba/src/noatunsensor.cpp +++ b/superkaramba/src/noatunsensor.cpp @@ -144,7 +144,7 @@ TQString NoatunSensor::getTitle() else { TQDataStream reply(replyData, IO_ReadOnly); - if (replyType == TQSTRING_OBJECT_NAME_STRING) + if (replyType == "TQString") { reply >> result; result.replace( TQRegExp("_")," " ); diff --git a/superkaramba/src/programsensor.cpp b/superkaramba/src/programsensor.cpp index 0c2f3e2..6bae664 100644 --- a/superkaramba/src/programsensor.cpp +++ b/superkaramba/src/programsensor.cpp @@ -25,10 +25,10 @@ ProgramSensor::ProgramSensor(const TQString &progName, int interval, TQString en programName = progName; //update(); - connect(&ksp, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int )), - this,TQT_SLOT(receivedStdout(TDEProcess *, char *, int ))); - connect(&ksp, TQT_SIGNAL(processExited(TDEProcess *)), - this,TQT_SLOT(processExited( TDEProcess * ))); + connect(&ksp, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int )), + this,TQ_SLOT(receivedStdout(TDEProcess *, char *, int ))); + connect(&ksp, TQ_SIGNAL(processExited(TDEProcess *)), + this,TQ_SLOT(processExited( TDEProcess * ))); } ProgramSensor::~ProgramSensor() diff --git a/superkaramba/src/programsensor.h b/superkaramba/src/programsensor.h index 672d0e7..cd75405 100644 --- a/superkaramba/src/programsensor.h +++ b/superkaramba/src/programsensor.h @@ -18,7 +18,7 @@ #include <tqtextcodec.h> class ProgramSensor : public Sensor { - Q_OBJECT + TQ_OBJECT public: ProgramSensor(const TQString &programName, int msec=1000, TQString encoding="" ); diff --git a/superkaramba/src/richtextlabel.cpp b/superkaramba/src/richtextlabel.cpp index 999fe0f..d0664da 100644 --- a/superkaramba/src/richtextlabel.cpp +++ b/superkaramba/src/richtextlabel.cpp @@ -165,7 +165,7 @@ bool RichTextLabel::click(TQMouseEvent* e) TQString anchor = text->anchorAt(point); if (anchor[0] != '#') { - if (e->button() == Qt::LeftButton) + if (e->button() == TQt::LeftButton) { KRun :: runCommand(anchor); } diff --git a/superkaramba/src/richtextlabel.h b/superkaramba/src/richtextlabel.h index cae19c6..3d2cb2a 100644 --- a/superkaramba/src/richtextlabel.h +++ b/superkaramba/src/richtextlabel.h @@ -23,7 +23,7 @@ class RichTextLabel : public Meter { - Q_OBJECT + TQ_OBJECT public: RichTextLabel(karamba*); diff --git a/superkaramba/src/rsssensor.h b/superkaramba/src/rsssensor.h index 4361dca..4872504 100644 --- a/superkaramba/src/rsssensor.h +++ b/superkaramba/src/rsssensor.h @@ -21,7 +21,7 @@ **/ class RssSensor : public Sensor { - Q_OBJECT + TQ_OBJECT public: RssSensor( const TQString &source, int interval, const TQString &format, const TQString &encoding=TQString() ); diff --git a/superkaramba/src/sensor.cpp b/superkaramba/src/sensor.cpp index 378cb1d..8655754 100644 --- a/superkaramba/src/sensor.cpp +++ b/superkaramba/src/sensor.cpp @@ -19,7 +19,7 @@ void Sensor::start() { if (!timer.isActive()) { - connect (&timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(update())); + connect (&timer,TQ_SIGNAL(timeout()),this,TQ_SLOT(update())); timer.start( (msec == 0)?1000:msec); } } diff --git a/superkaramba/src/sensor.h b/superkaramba/src/sensor.h index 1fa34b1..50faea0 100644 --- a/superkaramba/src/sensor.h +++ b/superkaramba/src/sensor.h @@ -20,7 +20,7 @@ class Sensor : public TQObject { - Q_OBJECT + TQ_OBJECT public: diff --git a/superkaramba/src/sensorsensor.cpp b/superkaramba/src/sensorsensor.cpp index baea31d..2998ba4 100644 --- a/superkaramba/src/sensorsensor.cpp +++ b/superkaramba/src/sensorsensor.cpp @@ -29,10 +29,10 @@ SensorSensor::SensorSensor(int interval, char tempUnit) : Sensor( interval ) #endif if(tempUnit == 'F') extraParams = " -f"; - connect(&ksp, TQT_SIGNAL(receivedStdout(TDEProcess *, char *, int )), - this,TQT_SLOT(receivedStdout(TDEProcess *, char *, int ))); - connect(&ksp, TQT_SIGNAL(processExited(TDEProcess *)), - this,TQT_SLOT(processExited( TDEProcess * ))); + connect(&ksp, TQ_SIGNAL(receivedStdout(TDEProcess *, char *, int )), + this,TQ_SLOT(receivedStdout(TDEProcess *, char *, int ))); + connect(&ksp, TQ_SIGNAL(processExited(TDEProcess *)), + this,TQ_SLOT(processExited( TDEProcess * ))); // readValues(); } diff --git a/superkaramba/src/sensorsensor.h b/superkaramba/src/sensorsensor.h index c2692ef..1aca4cc 100644 --- a/superkaramba/src/sensorsensor.h +++ b/superkaramba/src/sensorsensor.h @@ -19,7 +19,7 @@ **/ class SensorSensor : public Sensor { - Q_OBJECT + TQ_OBJECT public: SensorSensor(int interval, char tempUnit); diff --git a/superkaramba/src/showdesktop.cpp b/superkaramba/src/showdesktop.cpp index 57d1f46..1259288 100644 --- a/superkaramba/src/showdesktop.cpp +++ b/superkaramba/src/showdesktop.cpp @@ -40,10 +40,10 @@ ShowDesktop::ShowDesktop() kWinModule = new KWinModule( this ); // on desktop changes or when a window is deiconified, we abort the show desktop mode - connect( kWinModule, TQT_SIGNAL(currentDesktopChanged(int)), - TQT_SLOT(slotCurrentDesktopChanged(int))); - connect( kWinModule, TQT_SIGNAL(windowChanged(WId,unsigned int)), - TQT_SLOT(slotWindowChanged(WId,unsigned int))); + connect( kWinModule, TQ_SIGNAL(currentDesktopChanged(int)), + TQ_SLOT(slotCurrentDesktopChanged(int))); + connect( kWinModule, TQ_SIGNAL(windowChanged(WId,unsigned int)), + TQ_SLOT(slotWindowChanged(WId,unsigned int))); } void ShowDesktop::slotCurrentDesktopChanged(int) diff --git a/superkaramba/src/showdesktop.h b/superkaramba/src/showdesktop.h index 22d847f..c26a650 100644 --- a/superkaramba/src/showdesktop.h +++ b/superkaramba/src/showdesktop.h @@ -29,7 +29,7 @@ class KWinModule; */ class ShowDesktop : public TQObject { - Q_OBJECT + TQ_OBJECT public: diff --git a/superkaramba/src/sklineedit.cpp b/superkaramba/src/sklineedit.cpp index 57b9db0..86f281a 100644 --- a/superkaramba/src/sklineedit.cpp +++ b/superkaramba/src/sklineedit.cpp @@ -66,7 +66,7 @@ void SKLineEdit::keyPressEvent(TQKeyEvent* e) if(!e->text().isEmpty()) { - karamba* k = static_cast<karamba*>(TQT_TQWIDGET(parent())); + karamba* k = static_cast<karamba*>(parent()); k->keyPressed(e->text(), m_input); } } diff --git a/superkaramba/src/sknewstuff.cpp b/superkaramba/src/sknewstuff.cpp index c6869b3..327b4cb 100644 --- a/superkaramba/src/sknewstuff.cpp +++ b/superkaramba/src/sknewstuff.cpp @@ -40,7 +40,7 @@ #include "sknewstuff.h" SKNewStuff::SKNewStuff( ThemesDlg *dlg ) : - TDENewStuff( "superkaramba/themes", dlg ), + TDENewStuff( "Karamba & Superkaramba", dlg ), mDlg( dlg ) { } diff --git a/superkaramba/src/systemtray.cpp b/superkaramba/src/systemtray.cpp index ab539cd..ea93889 100644 --- a/superkaramba/src/systemtray.cpp +++ b/superkaramba/src/systemtray.cpp @@ -62,7 +62,7 @@ void Systemtray::updateBackgroundPixmap ( const TQPixmap & pixmap) { //Stupid stupid stupid work around for annoying bug //QXEmbed ignores setBackgroundOrigin(AncestorOrigin).... TQPixmap bug = TQPixmap(emb->size()); - bitBlt(TQT_TQPAINTDEVICE(&bug), 0, 0, TQT_TQPAINTDEVICE(const_cast<TQPixmap*>(&pixmap)), emb->parentWidget()->x()+emb->x(), emb->parentWidget()->y()+emb->y(), emb->width(), emb->height(),TQt::CopyROP, false); + bitBlt(&bug, 0, 0, const_cast<TQPixmap*>(&pixmap), emb->parentWidget()->x()+emb->x(), emb->parentWidget()->y()+emb->y(), emb->width(), emb->height(),TQt::CopyROP, false); emb->setPaletteBackgroundPixmap (bug); } @@ -95,7 +95,7 @@ void Systemtray::initSystray( void ) emb->setAutoDelete(false); - connect(emb, TQT_SIGNAL(embeddedWindowDestroyed()), TQT_SLOT(updateTrayWindows())); + connect(emb, TQ_SIGNAL(embeddedWindowDestroyed()), TQ_SLOT(updateTrayWindows())); m_Wins.append(emb); @@ -107,8 +107,8 @@ void Systemtray::initSystray( void ) updateTrayWindows(); - connect(twin_module, TQT_SIGNAL(systemTrayWindowAdded(WId)), TQT_SLOT(systemTrayWindowAdded(WId))); - connect(twin_module, TQT_SIGNAL(systemTrayWindowRemoved(WId)), TQT_SLOT(systemTrayWindowRemoved(WId))); + connect(twin_module, TQ_SIGNAL(systemTrayWindowAdded(WId)), TQ_SLOT(systemTrayWindowAdded(WId))); + connect(twin_module, TQ_SIGNAL(systemTrayWindowRemoved(WId)), TQ_SLOT(systemTrayWindowRemoved(WId))); TQCString screenstr; screenstr.setNum(tqt_xscreen()); @@ -206,7 +206,7 @@ void Systemtray::systemTrayWindowAdded( WId w ) emb->setAutoDelete(false); //emb->setBackgroundMode(X11ParentRelative); emb->setBackgroundMode(FixedPixmap); - connect(emb, TQT_SIGNAL(embeddedWindowDestroyed()), TQT_SLOT(updateTrayWindows())); + connect(emb, TQ_SIGNAL(embeddedWindowDestroyed()), TQ_SLOT(updateTrayWindows())); m_Wins.append(emb); emb->embed(w); diff --git a/superkaramba/src/systemtray.h b/superkaramba/src/systemtray.h index dbbbed6..ba2d87c 100644 --- a/superkaramba/src/systemtray.h +++ b/superkaramba/src/systemtray.h @@ -33,7 +33,7 @@ typedef long unsigned int Atom; class Systemtray : public TQWidget { - Q_OBJECT + TQ_OBJECT public: Systemtray(TQWidget* parent); diff --git a/superkaramba/src/systray_python.cpp b/superkaramba/src/systray_python.cpp index c953fdb..e0d96a1 100644 --- a/superkaramba/src/systray_python.cpp +++ b/superkaramba/src/systray_python.cpp @@ -111,8 +111,8 @@ long createSystray(long widget, long x, long y, long w, long h) currTheme->systray->move((int)x,(int)y); currTheme->systray->setMinimumSize((int)w,(int)h); currTheme->systray->initSystray(); - TQObject::connect(currTheme->systray,TQT_SIGNAL(updated()), - currTheme,TQT_SLOT(systrayUpdated())); + TQObject::connect(currTheme->systray,TQ_SIGNAL(updated()), + currTheme,TQ_SLOT(systrayUpdated())); currTheme->systray->show(); } diff --git a/superkaramba/src/taskmanager.cpp b/superkaramba/src/taskmanager.cpp index 48cef86..b666d28 100644 --- a/superkaramba/src/taskmanager.cpp +++ b/superkaramba/src/taskmanager.cpp @@ -55,11 +55,11 @@ TaskManager::TaskManager(TQObject *parent, const char *name) twin_module = new KWinModule(); // TDEGlobal::locale()->insertCatalogue("libtaskmanager"); - connect(twin_module, TQT_SIGNAL(windowAdded(WId)), TQT_SLOT(windowAdded(WId))); - connect(twin_module, TQT_SIGNAL(windowRemoved(WId)), TQT_SLOT(windowRemoved(WId))); - connect(twin_module, TQT_SIGNAL(activeWindowChanged(WId)), TQT_SLOT(activeWindowChanged(WId))); - connect(twin_module, TQT_SIGNAL(currentDesktopChanged(int)), TQT_SLOT(currentDesktopChanged(int))); - connect(twin_module, TQT_SIGNAL(windowChanged(WId,unsigned int)), TQT_SLOT(windowChanged(WId,unsigned int))); + connect(twin_module, TQ_SIGNAL(windowAdded(WId)), TQ_SLOT(windowAdded(WId))); + connect(twin_module, TQ_SIGNAL(windowRemoved(WId)), TQ_SLOT(windowRemoved(WId))); + connect(twin_module, TQ_SIGNAL(activeWindowChanged(WId)), TQ_SLOT(activeWindowChanged(WId))); + connect(twin_module, TQ_SIGNAL(currentDesktopChanged(int)), TQ_SLOT(currentDesktopChanged(int))); + connect(twin_module, TQ_SIGNAL(windowChanged(WId,unsigned int)), TQ_SLOT(windowChanged(WId,unsigned int))); // register existing windows const TQValueList<WId> windows = twin_module->windows(); @@ -86,14 +86,14 @@ void TaskManager::configure_startup() return; _startup_info = new TDEStartupInfo( true, this ); connect( _startup_info, - TQT_SIGNAL( gotNewStartup( const TDEStartupInfoId&, const TDEStartupInfoData& )), - TQT_SLOT( gotNewStartup( const TDEStartupInfoId&, const TDEStartupInfoData& ))); + TQ_SIGNAL( gotNewStartup( const TDEStartupInfoId&, const TDEStartupInfoData& )), + TQ_SLOT( gotNewStartup( const TDEStartupInfoId&, const TDEStartupInfoData& ))); connect( _startup_info, - TQT_SIGNAL( gotStartupChange( const TDEStartupInfoId&, const TDEStartupInfoData& )), - TQT_SLOT( gotStartupChange( const TDEStartupInfoId&, const TDEStartupInfoData& ))); + TQ_SIGNAL( gotStartupChange( const TDEStartupInfoId&, const TDEStartupInfoData& )), + TQ_SLOT( gotStartupChange( const TDEStartupInfoId&, const TDEStartupInfoData& ))); connect( _startup_info, - TQT_SIGNAL( gotRemoveStartup( const TDEStartupInfoId&, const TDEStartupInfoData& )), - TQT_SLOT( gotRemoveStartup( const TDEStartupInfoId& ))); + TQ_SIGNAL( gotRemoveStartup( const TDEStartupInfoId&, const TDEStartupInfoData& )), + TQ_SLOT( gotRemoveStartup( const TDEStartupInfoId& ))); c.setGroup( "TaskbarButtonSettings" ); _startup_info->setTimeout( c.readUnsignedNumEntry( "Timeout", 30 )); } @@ -773,14 +773,14 @@ void Task::updateThumbnail() // by the thumbnail generation. This makes things much smoother // on slower machines. // - TQWidget *rootWin = TQT_TQWIDGET(tqApp->desktop()); + TQWidget *rootWin = tqApp->desktop(); TQRect geom = _info.geometry(); _grab = TQPixmap::grabWindow( rootWin->winId(), geom.x(), geom.y(), geom.width(), geom.height() ); if ( !_grab.isNull() ) - TQTimer::singleShot( 200, this, TQT_SLOT( generateThumbnail() ) ); + TQTimer::singleShot( 200, this, TQ_SLOT( generateThumbnail() ) ); } void Task::generateThumbnail() diff --git a/superkaramba/src/taskmanager.h b/superkaramba/src/taskmanager.h index ceb62ff..0626b50 100644 --- a/superkaramba/src/taskmanager.h +++ b/superkaramba/src/taskmanager.h @@ -48,7 +48,7 @@ class TaskManager; */ class Task: public TQObject { - Q_OBJECT + TQ_OBJECT TQ_PROPERTY( TQString name READ name ) TQ_PROPERTY( TQString visibleName READ visibleName ) @@ -375,7 +375,7 @@ private: */ class Startup: public TQObject { - Q_OBJECT + TQ_OBJECT TQ_PROPERTY( TQString text READ text ) TQ_PROPERTY( TQString bin READ bin ) @@ -431,7 +431,7 @@ typedef TQPtrList<Startup> StartupList; */ class TaskManager : public TQObject { - Q_OBJECT + TQ_OBJECT TQ_PROPERTY( int currentDesktop READ currentDesktop ) TQ_PROPERTY( int numberOfDesktops READ numberOfDesktops ) diff --git a/superkaramba/src/textfilesensor.h b/superkaramba/src/textfilesensor.h index 930407a..656f3c6 100644 --- a/superkaramba/src/textfilesensor.h +++ b/superkaramba/src/textfilesensor.h @@ -36,7 +36,7 @@ class TextFileSensor : public Sensor { -Q_OBJECT +TQ_OBJECT public: TextFileSensor( const TQString &fileName, bool rdf, int interval, const TQString &encoding=TQString() ); diff --git a/superkaramba/src/textlabel.cpp b/superkaramba/src/textlabel.cpp index 09b8f98..968973d 100644 --- a/superkaramba/src/textlabel.cpp +++ b/superkaramba/src/textlabel.cpp @@ -342,15 +342,15 @@ bool TextLabel::click(TQMouseEvent* e) if (getBoundingBox().contains(e -> x(), e -> y()) && isEnabled()) { TQString program; - if (e -> button() == Qt::LeftButton) + if (e -> button() == TQt::LeftButton) { program = leftButtonAction; } - else if (e -> button() == Qt::MidButton) + else if (e -> button() == TQt::MidButton) { program = middleButtonAction; } - else if (e -> button() == Qt::RightButton) + else if (e -> button() == TQt::RightButton) { program = rightButtonAction; } diff --git a/superkaramba/src/textlabel.h b/superkaramba/src/textlabel.h index df730d1..8fc167e 100644 --- a/superkaramba/src/textlabel.h +++ b/superkaramba/src/textlabel.h @@ -22,7 +22,7 @@ class TextLabel : public Meter { -Q_OBJECT +TQ_OBJECT public: enum ScrollType { ScrollNone, ScrollNormal, diff --git a/superkaramba/src/themefile.cpp b/superkaramba/src/themefile.cpp index 8cf3b92..84e1590 100644 --- a/superkaramba/src/themefile.cpp +++ b/superkaramba/src/themefile.cpp @@ -209,7 +209,7 @@ bool ThemeFile::set(const KURL &url) { if(!url.isLocalFile() && !url.protocol().isEmpty()) { - if(KMessageBox::warningContinueCancel(TQT_TQWIDGET(kapp->activeWindow()), + if(KMessageBox::warningContinueCancel(kapp->activeWindow(), i18n("You are about to install and run %1 SuperKaramba theme. Since " "themes can contain executable code you should only install themes " "from sources that you trust. Continue?"), i18n("Executable Code Warning"), i18n("Install") @@ -224,7 +224,7 @@ bool ThemeFile::set(const KURL &url) if(localFile.exists()) { - if(KMessageBox::warningContinueCancel(TQT_TQWIDGET(kapp->activeWindow()), + if(KMessageBox::warningContinueCancel(kapp->activeWindow(), i18n("%1 already exists. Do you want to overwrite it?") .arg(localFile.filePath()),i18n("File Exists"),i18n("Overwrite")) == KMessageBox::Cancel) diff --git a/superkaramba/src/themelocale.cpp b/superkaramba/src/themelocale.cpp index f451eaf..9f77c19 100644 --- a/superkaramba/src/themelocale.cpp +++ b/superkaramba/src/themelocale.cpp @@ -162,7 +162,7 @@ void ThemeLocale::setLanguage(const TQStringList &languages) if(m_theme->fileExists(file)) { TQBuffer buffer(m_theme->readThemeFile(file)); - tl_nl_load_domain(TQT_TQIODEVICE(&buffer), buffer.size(), &m_domain); + tl_nl_load_domain(&buffer, buffer.size(), &m_domain); m_language = *it; return; } diff --git a/superkaramba/src/themes_layout.ui b/superkaramba/src/themes_layout.ui index d264187..b6def24 100644 --- a/superkaramba/src/themes_layout.ui +++ b/superkaramba/src/themes_layout.ui @@ -226,17 +226,15 @@ <tabstop>buttonAddToDesktop</tabstop> <tabstop>buttonClose</tabstop> </tabstops> -<Q_SLOTS> +<slots> <slot access="protected">addToDesktop()</slot> <slot access="protected">selectionChanged(int)</slot> <slot access="protected">search(const TQString&)</slot> -</Q_SLOTS> +</slots> <layoutdefaults spacing="6" margin="11"/> <layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> <includes> <include location="global" impldecl="in implementation">kpushbutton.h</include> + <include location="global" impldecl="in implementation">kwidgetlistbox.h</include> </includes> -<includehints> - <includehint>kwidgetlistbox.h</includehint> -</includehints> </UI> diff --git a/superkaramba/src/themesdlg.cpp b/superkaramba/src/themesdlg.cpp index 7534054..4d79048 100644 --- a/superkaramba/src/themesdlg.cpp +++ b/superkaramba/src/themesdlg.cpp @@ -134,8 +134,8 @@ void ThemesDlg::populateListbox() item->buttonGo->setText(i18n("New Stuff...")); #ifdef HAVE_TDENEWSTUFF item->buttonGo->setEnabled(true); - connect(item->buttonGo, TQT_SIGNAL(clicked()), - this, TQT_SLOT(getNewStuff())); + connect(item->buttonGo, TQ_SIGNAL(clicked()), + this, TQ_SLOT(getNewStuff())); #else item->buttonGo->setEnabled(false); #endif @@ -148,8 +148,8 @@ void ThemesDlg::populateListbox() item->setDescriptionText(i18n("Add local theme to the list.")); item->buttonGo->setProperty("stdItem", 18); item->buttonGo->setText(i18n("Open...")); - connect(item->buttonGo, TQT_SIGNAL(clicked()), - this, TQT_SLOT(openLocalTheme())); + connect(item->buttonGo, TQ_SIGNAL(clicked()), + this, TQ_SLOT(openLocalTheme())); tableThemes->insertItem(item); dirs = ksd.findDirs("data", TQString(kapp->name()) + "/themes"); @@ -164,8 +164,8 @@ void ThemesDlg::populateListbox() item = new ThemeWidget(new ThemeFile(dir.filePath(*it))); tableThemes->insertItem(item); item->buttonGo->setText(i18n("Uninstall")); - connect(item->buttonGo, TQT_SIGNAL(clicked()), - this, TQT_SLOT(uninstall())); + connect(item->buttonGo, TQ_SIGNAL(clicked()), + this, TQ_SLOT(uninstall())); } } t = SuperKarambaSettings::userAddedThemes(); @@ -178,8 +178,8 @@ void ThemesDlg::populateListbox() item = new ThemeWidget(file); tableThemes->insertItem(item); item->buttonGo->setText(i18n("Uninstall")); - connect(item->buttonGo, TQT_SIGNAL(clicked()), - this, TQT_SLOT(uninstall())); + connect(item->buttonGo, TQ_SIGNAL(clicked()), + this, TQ_SLOT(uninstall())); } else delete file; @@ -363,8 +363,8 @@ int ThemesDlg::addThemeToList(const TQString &file) i = tableThemes->insertItem(item); item->buttonGo->setText(i18n("Uninstall")); - connect(item->buttonGo, TQT_SIGNAL(clicked()), - this, TQT_SLOT(uninstall())); + connect(item->buttonGo, TQ_SIGNAL(clicked()), + this, TQ_SLOT(uninstall())); } tableThemes->setSelected(i); return i; diff --git a/superkaramba/src/themesdlg.h b/superkaramba/src/themesdlg.h index 1e73288..095f2c9 100644 --- a/superkaramba/src/themesdlg.h +++ b/superkaramba/src/themesdlg.h @@ -39,7 +39,7 @@ class KArchiveDirectory; class ThemesDlg : public ThemesLayout { - Q_OBJECT + TQ_OBJECT public: diff --git a/superkaramba/src/themewidget.h b/superkaramba/src/themewidget.h index 2481cb8..f57918c 100644 --- a/superkaramba/src/themewidget.h +++ b/superkaramba/src/themewidget.h @@ -29,7 +29,7 @@ class ThemeWidget : public ThemeWidgetLayout { - Q_OBJECT + TQ_OBJECT public: ThemeWidget(TQWidget *parent = 0, const char *name = 0); diff --git a/superkaramba/src/themewidget_layout.ui b/superkaramba/src/themewidget_layout.ui index 8a55785..813df4f 100644 --- a/superkaramba/src/themewidget_layout.ui +++ b/superkaramba/src/themewidget_layout.ui @@ -157,9 +157,6 @@ <property name="text"> <string></string> </property> - <property name="accel"> - <string></string> - </property> </widget> </hbox> </widget> diff --git a/superkaramba/src/xmmssensor.h b/superkaramba/src/xmmssensor.h index 20727b1..2e83967 100644 --- a/superkaramba/src/xmmssensor.h +++ b/superkaramba/src/xmmssensor.h @@ -22,7 +22,7 @@ class XMMSSensor : public Sensor { - Q_OBJECT + TQ_OBJECT public: XMMSSensor( int interval, const TQString &encoding=TQString() ); |